Scale with moving the camera

Started by
1 comment, last by KulSeran 15 years, 6 months ago
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
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.
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()

This topic is closed to new replies.

Advertisement