PDA

View Full Version : Scenary simulation.



atcbrambo
07-30-2004, 01:44 PM
I build few houses with GL_TRIANGLE_STRIP. Every thing goes all right untill when i use units that are less than 1.00
When i try to setup real world like this
glFrustum(-10000,+10000,0,+10000,1,10000);

anf them i give my house a real world measures
base is 20*14 meters, height is 12 there is no way to see it, even if I drive trought the scene.

If I use
glFrustum(-1,+1,-1,+1,1,1);
and I resize the house accordingly, the problem disappear. This is not the solution, since there will be hundres objects and I want use 1 unit=1 meter.

Should I change the gl_projection? How can I tell it to OpenGl ???

What's the way to achieve this???

And more. Where can i find 3d models (like car, building,...) in glvertex format???

Thank in advance.

I use Delphi 5.0.

mikael_aronsson
07-30-2004, 09:56 PM
Hi !

It should work just fine if you setup everything correct, I am not sure how you get glFrustum(-1,+1,-1,+1,1,1); to work because you have set the near and far clipping planes to the same value so you should not see anything at all.

Make sure that you select the correct matrix (glMatrixMode) before you call glFrustum, oterwise you might get wacky results.

And make sure that you get your model withing the clipping volume (1-10000 in your example) otherwise you will not see it either.

gluLookAt is nice to play around with...

There is no "glvertex" format, but there are lots of different 3D formats out there, and there are libraries to load model into memory so you can use them with OpenGL, search this forum, the question has poppped up a few hundred times I guess, also have a look at www.wotsit.org (http://www.wotsit.org) www.sourceforge.net (http://www.sourceforge.net) www.freshmeat.net (http://www.freshmeat.net) and do a search with google.

Mikael

atcbrambo
07-31-2004, 01:40 AM
Glfrustum(-1,1,-1,1,-1,1,1,1); znear & zfar are incorect, of course.
the right is Glfrustum(-1,1,-1,1,-1,1,1,100);

I will try more setup, since you say this is the right path.

One more question.
May I, with GluLookAt(..),drive trougth the scenery and look from the z-far to the z-near.
[do u understand wat I mean???]????
or should I use other functions ????

Grazie. (thank you).