PDA

View Full Version : simple but yet complex transformation



diskhub
04-09-2011, 05:28 AM
Hi all,
I am pretty new to opengl.

http://img35.imageshack.us/img35/6280/carbt.jpg

I wish to test out the simple transformation of a moving car...
but with the following requirements:
1. it must behave like a car, with the front two wheels being able to rotate and influence the angle and the distance moved.
2. the front and back wheels are able to rotate as per distance travelled.

How can i do so?
I am lost with the pushMatrix and popMatrix but they don't quite work properly.

And lastly, how can i affect the rotation of each wheels to have it tallied with the distance travelled (2*PI*Radius?) but kinda lost with the algorithm.

Please advice.