Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > OpenGL 3D API > Re: Order of Tr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 4822 of 5017
Post > Topic >>

Re: Order of Transformations

by Jonathan Campbell <jg.campbell.ng@[EMAIL PROTECTED] > Jul 7, 2008 at 06:05 PM

amphetaman@[EMAIL PROTECTED]
 wrote:
> Greetings! I recently started learning OpenGL and I have run into
> quite a problem. I really have no idea how to implement a simple
> camera using OpenGL's transformation functions. What particularly
> bothers me is the order in which transformations must be applied.
> 
> Suppose the camera is located at (x, y, z) and its rotation is -45
> degrees (from the default orientation, that is, looking towards (0, 0,
> -1)).
> 
> If I translate first, by calling glTranslate(-x, -y, -z), the rotation
> will have that point as its origin. I don't need that.
> 
> If I rotate first, I will have to somehow calculate the translation
> vector (because forward, for example, won't be (0, 0, -1) anymore).
> 
> Any help is appreciated.

If you can think in terms of transformation matrices and their 
compositions, then Section 5.6 of:

http://www.jgcampbell.com/graphics1/cgogl.pdf

may shed some more light (fungus has given you a good answer).

Or, maybe better, find an online version of the Red Book --- the old 1.1 
version will do fine.

If you mooch around my course website (e.g. ch05.zip), you'll find the 
model1.c program and any function library that it uses. However I should 
add that my lecture on this topic contains vigorous arm waving and 
supplementary use of a whiteboard.

You should also have a look at gluLookAt (sp.?) and how positioning and 
orienting the camera, and glTranslate and glRotate.

Best regards,

Jon C.
 




 5 Posts in Topic:
Order of Transformations
amphetaman@[EMAIL PROTECT  2008-07-05 13:55:12 
Re: Order of Transformations
singin_dav <sone@[EMAI  2008-07-06 07:52:30 
Re: Order of Transformations
fungus <openglMYSOCKS@  2008-07-06 14:21:56 
Re: Order of Transformations
Jonathan Campbell <jg.  2008-07-07 18:05:40 
Re: Order of Transformations
Jonathan Campbell <jg.  2008-07-07 18:07:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 6:28:16 CST 2008.