Sign in to follow this  

Rotating billiard ball

This topic is 4110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sorry for this thread...

I see what a newbie mistake I made...

I was first turning the x-axis +10 then the y +10, and so on, when I needed to turn them all in the same function... Sorry. Everything clear for me now... Well not everything, but...

Share this post


Link to post
Share on other sites

This topic is 4110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this