Jump to content

  • Log In with Google      Sign In   
  • Create Account

Objects and Cameras in a 3D world, OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Rotti   Members   -  Reputation: 100

Like
0Likes
Like

Posted 06 September 2011 - 12:16 PM

Hi

I've been working with OpenGL and C++. I think I'm slowly but surely understanding the the modelview matrix and how changing it, changes what you see.
I've read a lot about guys talking about there is no camera and all that jazz, It starting to make sence, but its stil a trip. I've read about and looked at the glLookat function,
some guy gave the source code for it somewhere, and I understand what happens there. The parameters are all in terms of the Object frame. I'm planning on using it, so bare with me.

Now, I'm imagining a scene, a 3d world with objects(say cubes) and a camera, I realize that the modelview matrix needs to be set by the glLookat function for each object in the world, depending on where the object is in relation to the camera. Each object is designed in its own frame and has its origin at the middle of the object. So we have the object frames, which are the floating cubes, we have the scene frame(which openGL knows nothing of?), which is the frame that says where all the objects and the camera is, then we have the camera frame.

If I'm on the right track my question should be:

How do I use the info(x,y,z co-ordinates, rotations ,lookat vector) of the objects and the camera in the scene frame, to compute the parameters I need to pass to the glLookat function for each object just before you draw it?

Please point me in the right vector direction. :P

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS