Viewing a 3D Scene

Started by
4 comments, last by bslayerw 22 years, 6 months ago
Quick dumb questions, conceptually which would be the best way to rotation and translate a 3D scene? Would I translate all the objects based on the camera''s orientation and location or could I just translate the camera? In OpenGL I am referring to the GL_MODELVIEW and the GL_PROJECTION mode.
Advertisement
GL_MODELVIEW all the way. You don''t really need to mess with the projection matrix too much........ Ever.

------------------------------
Trent (ShiningKnight)
E-mail me
ShiningKnight Games
camera is just something which is abstracted by people,it doesn''t exist at all,and everything movement which is like a camera movement is caused by changing the matrix.

so when u see the scene viewport changing,it is just caused by translating(or rotating,scaling) the world system-coodinates,in fact.

so,what u do to chage the scene actually is changing the world system(and these functions transfer maxtrcs internal).

and,all these functions which r used to transfer r all beased on the GL_MODELVIEW.the GL_PROJECTION is just for those functions such as glOrtho to change the projection ways(perspective or ortho-disassembling).

jerry2
Programming,make a whole new world.
jerry2The God creates the world, the world creates the nature,the nature creates human. Human create...Everything.
well... you could just use gluLookAt... that''s the easiest way. It''s a pre-made function that takes simple parameters and rotates the entire world based on where you''re looking at, and where you''re looking from. That way you don''t have to worry about rotating and translating anything.

Billy
Ok great, makes a lot of sense. I realize that a "Camera" in the 3D scene is a user defined entity. I was just curious as to how others would approach this as I am new to OpenGL and thought that it would be possible to simple move your viewpoint instead of transforming everything in the scene.

What exactly goes glLookAt do? does it send a matrix to the video to do the translations? Reason I ask this is because I am using gl4java, which is a OGL binding for Java. I don't think the binding contains the gluLookAt function (only supports GLUT 1.2).

Thanks for the previous replies, it has helped a lot.

Edited by - bslayerw on November 2, 2001 11:48:41 AM
glulookat transfers the world system internally,so it presents an effect that the a camera is moving in the scene.

this function is included in the glu32.lib,u can use it in vc,and i think it should be used in java compiler.u know,opengl is a great lib for nearly every platform.



jerry2
Programming,make a whole new world.
jerry2The God creates the world, the world creates the nature,the nature creates human. Human create...Everything.

This topic is closed to new replies.

Advertisement