Hi guys
i am working on my hw and i ran into a problem.
situation is this. i have a ball continuesly rolling from between three points
A(3, 0 , 5) -> B(-2, 0, 3) - C(2,0,-4) -> back to A
i had implemented glTranslate to move the ball from pt to pt as well as glRotate to simulate the actual rotation.
but the problem is when using glRotate function i can only rotate around x, y ,z axis which obviuosly does to represent actually direction of the ball rolling since it does not roll parallel to these axis. so i need help with 2 things:
1. how to write glRotate function so that it represents motion of the ball rolling A->B (i guess it has something to do being perpendicular to vector AB). i need like a piece of code. something simple. after that i am sure i can ajust it for vector BC
2. how do i change the direction of the balls rotation? right now its roting backwards even though ball is going foward.
thanks everyone
Start Free Trial