Advertisement

01.05.2006 at 11:31PM PST, ID: 21686239
[x]
Attachment Details

Rotation around arbitrary axis

Asked by rejus in OpenGL Graphics & Game Programming

Tags: rotation, axis, around, arbitrary

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 everyoneStart Free Trial
[+][-]01.05.2006 at 11:36PM PST, ID: 15626784

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: OpenGL Graphics & Game Programming
Tags: rotation, axis, around, arbitrary
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.05.2006 at 11:40PM PST, ID: 15626801

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.05.2006 at 11:43PM PST, ID: 15626814

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.05.2006 at 11:47PM PST, ID: 15626831

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.06.2006 at 03:57AM PST, ID: 15627802

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.06.2006 at 07:48AM PST, ID: 15629739

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.06.2006 at 07:51AM PST, ID: 15629769

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.06.2006 at 12:22PM PST, ID: 15886422

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.10.2006 at 04:02AM PST, ID: 15921639

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32