The Gear was designed to be tilted purely to occupy the least amount of space in the fuselage that way it will allow more cargo space.
Now this is the primary reason but with advances in technology, the tilt can be modified without adding weight, the 777 has a flight position and a retract position and I believe the A340-600 has a similar system for the centre gear, which makes for a smoother landing.
The 777 can't tilt its gear like the 74' wing gear as the gear would become too long and would have to be placed further out on the wing. The 777 gears are only one foot less apart than the 747, but are a lot taller due to the size of the engines.
Now the A330/340 gear is as you said tilted a lot like the 747, but has exactly the same problems as the 777, so what the 330 and 340 do is incorporate a shortening link which pulls the inner cylinder of the strut into the outer as the gear retracts thereby shortening the length of the gear and allowing the gear to be tilted and leave enough room for a centre gear in between. If the shortening link breaks which it has (CX A330) when the gear retracts it hits the landing gear doors due to being full length.
Now on these pic's you can see the wing gear is tilted to take up the minimum fwd/aft space. I'll have to get back to you as my connection is a bit slow at the moment but there are some perfect pic's here on airliners.net to show what I'm babbling on about.
P1 in A330, A340, A346, B742, B744, B748.