Sign in to follow this  
hellovn

Scale with moving the camera

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this