PDA

View Full Version : numbers range



Andrew Davey
04-14-2004, 02:35 AM
Dont know if this is gonna be to simple for this area but here goes:

When drawing my objects in 3d i have to use numbers less than 1 or -1 to get the size i would like. When i did it in 2d i could use numbers in excess of 100 and have a nice model.

How on earth can i change this? Am using gluPerspective and using the NeHe settings, 45.0 ratio set to screen width/screen height and 0.1 - 150 z range.

It would be good if someone could explain this to me.

Cheers.

Mazy
04-14-2004, 02:44 AM
This should go into the beginners forum..

But this all depends on the Projection matrix, and as you say, perspective or ortho mode.

When you set orhto mode you probablu use values in the 100 range or above to define your viewarea, thats why values of that magnitude seems fine there.

For projectionview it all depends on the distance to the camera, since everything gets smaller when its far away. if you make a model with values in the 100ragne and tranlate it all by a glTranslate(0,0,-80); before you draw it, i think you see that its fit better.

malancha
04-14-2004, 02:50 AM
That's part of how perspective projection works. You're probably trying to draw without first translating away from the near clipping plane and towards the far clipping plane. Any object drawn close the the near plane will seem very large. What you can do for starters is move your origin to halfway between the near and far planes, using glTranslatef(0.0f, 0.0f, 75.0f).