Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jason2Jason

Camera in ogl

This topic is 6110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Rotate and then Translate.

imo gluLookAt is evil.

-----------------------
0wn 0wn 0wn your goat
gently down the pw33n

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!