Jump to content
  • Advertisement
Sign in to follow this  
hellovn

Scale with moving the camera

This topic is 3537 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 All, I am new with the OpenGL. For example: I have an object. Now I want to make it smaller by moving the camera far away. How can I do that? I try the glLookAt function, but the object just disappear :( Thank you very much. Anh

Share this post


Link to post
Share on other sites
Advertisement
Please post some of your code. It's difficult to say what you are doing wrong.
Understanding OpenGL can be complex at the beginning.

Try to use
glScaled(0.5,0.5,0.5); // scale object to half its size
before you draw the object
instead of gluLookAt to make it smaller.

Share this post


Link to post
Share on other sites
Do you have a projection matrix setup? or are you in ortho mode? if you are in orthographic mode the object will stay the same size, then disapear. You need to setup a proper projection to get the size with distance stuff to work. Look up glPerspective()

Share this post


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