f



Viewing transformation sample for pilot view and polar view

Hello,

I am trying to implement some kind of flight simulator in OpenGL and
have some problems with the camera control. I know the basics but I am
looking for real sample code of the "pilot view" and "polar view" pseudo
code from the red book in the viewing section:

void pilotView{GLdouble planex, GLdouble planey,
               GLdouble planez, GLdouble roll,
               GLdouble pitch, GLdouble heading)
{
      glRotated(roll, 0.0, 0.0, 1.0);
      glRotated(pitch, 0.0, 1.0, 0.0);
      glRotated(heading, 1.0, 0.0, 0.0);
      glTranslated(-planex, -planey, -planez);
}

void polarView{GLdouble distance, GLdouble twist,
                 GLdouble elevation, GLdouble azimuth)
{
      glTranslated(0.0, 0.0, -distance);
      glRotated(-twist, 0.0, 0.0, 1.0);
      glRotated(-elevation, 1.0, 0.0, 0.0);
      glRotated(azimuth, 0.0, 0.0, 1.0);
}

I found some old entries in this group, but the links are not valid
anymore and the posts are confusing.

So if anybody can post or send me a link to some real sample code for
the two camera modes.

Kind regards,
Christian
0
Christian
1/13/2010 7:48:18 PM
comp.graphics.api.opengl 7074 articles. 1 followers. Post Follow

1 Replies
1549 Views

Similar Articles

[PageSpeed] 54

On Jan 13, 8:48=A0pm, Christian Ernst <cner...@yahoo.de> wrote:
>
> =A0 =A0 =A0 glRotated(roll, 0.0, 0.0, 1.0);
> =A0 =A0 =A0 glRotated(pitch, 0.0, 1.0, 0.0);
> =A0 =A0 =A0 glRotated(heading, 1.0, 0.0, 0.0);
>

This can never ever work. Google for "gimbal lock"

--
<\___/>
/ O O \
\_____/  FTB.
0
fungus
1/14/2010 7:55:48 PM
Reply: