Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

FERNANDO-BRASIL

World size

This topic is 6019 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

People, I''m a newbie and I would like to know, if there are limitations about the space 3D in OpenGL. Until where I can position my objects? Are there any function to set the size of the space 3D? Thank you very mutch guys, and sorry for my bad english.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
> People, I''m a newbie and I would like to know, if there are limitations about the space 3D in OpenGL

No, not really. The limit is the range a float can hold, but since you can rescale your world, this isn''t a real problem either. You could run into precision problems, though.

Share this post


Link to post
Share on other sites
Huuummm an other little question...

I tryied to do some scaling, and I noted that the lowest value that we can use is glScalef(0.0f, 0.0f, 0.0f)....

Now I would like to know, if there any other form to give a lower value to glScalef... Because, for me, it sound very strange, that we can only scale down 1 unit... (because the Identity matrix is glScalef(1.0f, 1.0f, 1.0f).

Share this post


Link to post
Share on other sites
To scale your world you just need to multiply every vertex with a number (don''t forget to scale your movement,and camera position to) e.g. multiply by 0.01 so everything in your world is 100 time smaller.

Share this post


Link to post
Share on other sites
Right, as Gearge said, glScalef, as it name implies, scales your object by whatever values it has. Thus glScalef(1,1,1) will scale your object 1x, that is: no change. glScalef (10,10,10) will make it 10x larger and glScalef(0.1,0.1,0.1) 10x smaller. So glScalef(0,0,0) will make your object infinitely small.

In response to your earlier question, the size limit of your univers is defined by the data type you use for x,y, and z coordinates. if you use floats that is something like 10,000,000,000,000,000,000,000,000,000,000 units, if you use doubles you can add some 300 zeros to that. More practically, though, the VISIBLE limit of your world is the distance to your far clipping plane. If you use

gluPerspective(fov,ratio,0.2f,100.0f);

Then your far clipping plane is 100 units from the user and you will not be able to see beyond that. So 100 units is effectively the visible limit of your world.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!