Rotating billiard ball
I am having problem understanding how to rotate spheres properly in 3-d.
I made a pool table and a ball. If the ball moves lets say x+=10, y+=10 and z+=0. How do I rotate the ball around x,y&z axis?
Go easy on me. Not the most brilliant guy on this planet...
Please help!
Without getting into a full-on physics simulation, the easiest way to rotate the ball in a way that appears correct is to rotate about an axis perpendicular to the surface normal and the direction of motion, with the amount of rotation computed from the circumference of the ball and the distance traveled.
Thanx for your reply. If I put it in another way...
When I have this:
Example 1
Ballmovement x+10, y+0, z+0
BallRot x+10, y+0, z+0
or...
Example 2
Ballmovement x+0, y+10, z+0
BallRot x+0, y+10, z+0
it works fine... But if the ball is heading (just thinking of x and y) south east (or down and right)...
Example 3
Ballmovement x+10, y+10, z+0
BallRot x+10, y+10, z+0 (Of course the ball travels longer now, than in the first two examples, but... just an example)
When I do this my ball is not rotating correctly (in SE direction), it is swearving. I don't know... Am I using the wrong technic or do I have some other faults in the rest of the programming code? I'm trying this in OpenGL.
Hoping you all understood my question.
When I have this:
Example 1
Ballmovement x+10, y+0, z+0
BallRot x+10, y+0, z+0
or...
Example 2
Ballmovement x+0, y+10, z+0
BallRot x+0, y+10, z+0
it works fine... But if the ball is heading (just thinking of x and y) south east (or down and right)...
Example 3
Ballmovement x+10, y+10, z+0
BallRot x+10, y+10, z+0 (Of course the ball travels longer now, than in the first two examples, but... just an example)
When I do this my ball is not rotating correctly (in SE direction), it is swearving. I don't know... Am I using the wrong technic or do I have some other faults in the rest of the programming code? I'm trying this in OpenGL.
Hoping you all understood my question.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement