Archived

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

World size

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

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 on other sites
> 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 on other sites
Thank you very mutch ''Anonymous User''!

I''ll try to do some tests scalling the 3D world!

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 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 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.

1. 1
2. 2
Rutin
19
3. 3
4. 4
khawk
14
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×