kojot_beginner

12-28-2010, 08:44 AM

I have a code in OpenGL which display's an arrow. I compiled this code into a display list and run it using glCallList() function.

The problem is I need to rotate this arrow, but can't deal with rotation angles calculations.

I have two points coordinates:

P1(x1, y1, z1) - base of arrow

P2(x1, y2, z2) - arrowhead

How to calculate right rotation angles and what is the sequence of rotations that I should use?

I know that sequence will be something like this:

glTranslatef( center of arrow );

//rotations ...

glCallList();

Please help me with this problem.

The problem is I need to rotate this arrow, but can't deal with rotation angles calculations.

I have two points coordinates:

P1(x1, y1, z1) - base of arrow

P2(x1, y2, z2) - arrowhead

How to calculate right rotation angles and what is the sequence of rotations that I should use?

I know that sequence will be something like this:

glTranslatef( center of arrow );

//rotations ...

glCallList();

Please help me with this problem.