Jump to content
  • Advertisement
Sign in to follow this  
angry

matrices...

This topic is 4732 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

If I have a camera at (0, 0, 10) that is 10 units away from the origin, how can I then create and place a cube so that it's 10 units away from the origin and not the camera? Example.
void render()
{
...
glLoadIdentity();
camera.transform.translate(0.0f, 0.0f, 10.0f); // move the camera away from the origin by 10 units..
glMultMatrixf(camera.transform);

object.transform.translate(0.0f, 0.0f, 10.0f); // how can I make this call translate the object 
                                               // 10 units from the origin and not the camera?
glMultMatrixf(object.transform);
object.render();

...
}



Any ideas? [Edited by - angry on June 10, 2005 3:05:53 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!