depth perception?

I’m attempting to make a floor for my world, and as the floor (simply a square face) gets further away, one would assume that the sides would draw closer to each other. However, the face simply flattens out. How do I get it to accurately reflect depth? Pictures included in case I’m not making myself clear…

pict1 - overhead view
pict2 - camera raised up and moved back

-Dogcow “moof!”
Visit The Underground

Use gluPerspective( view_angle, hight/width ratio, near, far )
Note near/far must be positive, near > 0.

This will project depth, example even though the object is square, closer side will be larger then far side of square…

Originally posted by Dogcow:
[b]I’m attempting to make a floor for my world, and as the floor (simply a square face) gets further away, one would assume that the sides would draw closer to each other. However, the face simply flattens out. How do I get it to accurately reflect depth? Pictures included in case I’m not making myself clear…

pict1 - overhead view
pict2 - camera raised up and moved back

-Dogcow “moof!”
Visit The Underground [/b]

So would I use that instead of glOrtho or with it somehow?

Thanks,
-Dogcow “moof!”
Visit The Underground

Yes, you can use it in place of glOrtho.

But also you can draw using both, example would be drawing bitmaps which need no depth in ortho mode, then switch to perspective to draw 3D objects.

See my examples on my website…
http://www.angelfire.lycos.com/linux/nexusone

Look at GLclock, comes with source code.

Originally posted by Dogcow:
[b]So would I use that instead of glOrtho or with it somehow?

Thanks,
-Dogcow “moof!”
Visit The Underground [/b]

I tried numerous gluPerspective settings and none of them look any different.

The first, gluPerspective(45,1,-10,10); resulted in this pict .

The second, gluPerspective(85,9,-100,100); resulted in this pict .

Why don’t these look any different?

-Dogcow “moof!”
Visit The Underground

If this helps more, here’s the dimensions of the only object in my world:

glVertex3f(-10.0f,0.0f,10.0f);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f(10.0f,0.0f,10.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(10.0f,0.0f,-10.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(-10.0f,0.0f,-10.0f);

My program starts out looking at:

gluLookAt(0.0,5.0,-5.0,0.0,0.0,0.0,0.0,0.0,1.0);

-Dogcow “moof!”
Visit The Underground

The near clip plane must not be less than or equal to zero.

Hm, I changed it to a positive number and now can’t get anything to show up… Any recommendations on some values to put to get it started?

Thanks,
-Dogcow “moof!”
Visit The Underground

The values depends on the scale of your scene. But you can always start with some absurd values, like set near to 0.0001 and far to 1000000. It will kill the depth buffer for sure, but you can change the values to fogure out what’s best for you.