Camera in ogl
Hi, whats the easiest way of have a moving rotating ''camera'' in ogl? Would you just rotate then translate the entire scene, or is there a better way of doing this? Can you give some small e.g''s.
Thanks,
-J
I''m kinda new to OpenGL, but I think it''s better to translate first and then rotate.
Check out Tutorial 10 on NeHe''s site.
http://nehe.gamedev.net/tutorials/lesson10.asp
Check out Tutorial 10 on NeHe''s site.
http://nehe.gamedev.net/tutorials/lesson10.asp
"If all else fails, lower your standards."
In my opinion to do a real camera you need to use gluLookAt() Its a great function if you can get the points right.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Rotate and then Translate.
imo gluLookAt is evil.
-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
imo gluLookAt is evil.
-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
i think it depends on what you want to do. if you want to follow an object ("look at" it), then gluLookAt saves alota math. if you simple want to "move and point" your camera, then do rotate/translate
life is unfair, take advantage of it.UNMB2 - if the link doesn't work, try clicking it :)
December 30, 2001 01:58 PM
gluLookAt() actually works the same way as the rotate and translate functions because they both modify the GL_MODELVIEW matrix. It doesn''t really matter which one you use, so do whichever is simpler. If you are just doing a simple demo, I would recommend rotate and translate because they are easier to use IMHO. In anything bigger, use gluLookAt() when you move the camera, and the other functions for when your objects move.
Whats the problem with rotating and transalte the camera with a big project? I''ve use gluLookAt() (or what ever its called) and it didn''t work wiv 3 or 4 cubes in the scene! Evil function!! Just another question. When doing the rotate/translate camera method, would you have to glLoadIdentity() after it?
I guess that rotate/translate method + sine math is sufficient for your needs (simpliest).
More advanced method are matrix transformation controlled cameras (+glLookAt) and quaternions(which are the best solution - tomb rider uses this tehnique).
Look gamedev net tuts and gamasutra for quaternions
There is also one great tutorial by D. Palomo Van Es (correct my spelling) which can be found using google.
Happyface
Edited by - happyface on December 30, 2001 7:08:08 PM
More advanced method are matrix transformation controlled cameras (+glLookAt) and quaternions(which are the best solution - tomb rider uses this tehnique).
Look gamedev net tuts and gamasutra for quaternions
There is also one great tutorial by D. Palomo Van Es (correct my spelling) which can be found using google.
Happyface

Edited by - happyface on December 30, 2001 7:08:08 PM
December 31, 2001 02:07 AM
1. Quaterwhaters - no has to be converted to a matrix anyways
2. gluLookAt - no
3. glRotate/glTranslate -no
4. glLoadMatrix - yes, with a matrix you create with your own library.
If you dont know how to write your own matrix library and build a transformation matrix that will act as your camera, then learn how it will be worth it, becuase you will have a much better understanding of 3D graphics.
2. gluLookAt - no
3. glRotate/glTranslate -no
4. glLoadMatrix - yes, with a matrix you create with your own library.
If you dont know how to write your own matrix library and build a transformation matrix that will act as your camera, then learn how it will be worth it, becuase you will have a much better understanding of 3D graphics.
quote:
Original post by happyface
I guess that rotate/translate method + sine math is sufficient for your needs (simpliest).
Whats sine math got to do with anything?? BTW: I don't know about that sort of math yet, but i think i'm doing this year in school!
Edited by - jason2jason on December 31, 2001 2:29:22 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement