Results 1 to 8 of 8

Thread: so, how big is an OpenGL unit?

  1. #1
    Member Contributor
    Join Date
    Nov 2002
    Posts
    96

    so, how big is an OpenGL unit?

    I've been wondering what the real-life size of a single openGL unit is, and how big your worlds are.
    How do you decide the metric unit of a model of yours? Do you adjust the model or the view frustum to get a nice size.
    I'm merely asking out of curiosity

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2001
    Location
    England
    Posts
    173

    Re: so, how big is an OpenGL unit?

    OpenGL doesn't define how big a unit is (if you're talking about the units such as arguments to glTranslatef() calls). You can define the unit size based on what you want your application to look/feel like. You just have to work out what seems best for your situation and stick with that.

    -Mezz

    [This message has been edited by Mezz (edited 12-10-2002).]

  3. #3
    Member Contributor
    Join Date
    Nov 2002
    Posts
    96

    Re: so, how big is an OpenGL unit?

    OK... but what if you've put tonns of work in your app and models, and you want to adjust the scale just a tad, do you adjust the frustum or the models? If the frustum, how do you do that?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: so, how big is an OpenGL unit?

    Originally posted by Structural:
    OK... but what if you've put tonns of work in your app and models, and you want to adjust the scale just a tad, do you adjust the frustum or the models? If the frustum, how do you do that?
    I am not really sure what you mean by adjusting the frustum. But I think it is best to build your model just in your desired scale. For example 1 OGL unit = 1 meter, etc.
    If you did not do that it is perhaps the easiest to use the modeller you build them with for scaling them. Or you may use glScale.
    For changing your view frustum take a look at the specs for glFrustum or gluPerspective.

  5. #5
    Member Contributor
    Join Date
    Apr 2002
    Posts
    94

    Re: so, how big is an OpenGL unit?

    I agree that you should build your models to their real life scales. You can think of an opengl unit as whatever size you desire. If you want a unit to measure 1 meter, then the artist building the model should also set his modeling program to be 1 unit = 1 meter.

    Also, if your models are too large, you can just move the camera back farther until they are at the size you want. And just think of 1 unit = 1 mile (or whatever).
    P4 2Ghz, GEFORCE4, 512 Meg RAM, WIN2000, VStudio 6.0

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: so, how big is an OpenGL unit?

    The OpenGL unit not a defined size like meters or inchs, it is a relative unit.

    Sometimes this is a hard concept to understand, but if you look why it is important to work in relative values it will become more clearer.

    I a CAD (Computer Aided Design) we would enter the size of our object in real values.
    Since the object size is important in building a real object.

    Note if we where creating a CAD program we would have two sets of values. One set would be the real size values of the object, the other set would be the values relative to the view of the object.

    Example in order to view a 100 meter object on the screen in which we have a 10 unit openGL window, we would have to reduce the object by 10. (100 m = 10 gl units) or say we wanted to zoom in on a area, then the maybe 1m = 10 gl units.


    But in a 3D game world, we really don't care if the object is 300.3 cm. only that is it preportional to the other objects in the 3D scene.

    So in our 3D world, our object maybe 300 units or maybe only 3 units long depending on your world size.

    example:

    world_size(); // World size is 10 units

    draw_house(); // House is 1 unit in size

    draw_car();// car is 100 units in size

    We need each object to preportional to each other and the world

    glScale(2.5, 2.5, 2.5); // increase house size by 2.5
    draw_house();

    glScale(0.01, 0.01, 0.01); // Decrease car by 100
    draw_car();

    I hope this gives you an idea

    Originally posted by Structural:
    I've been wondering what the real-life size of a single openGL unit is, and how big your worlds are.
    How do you decide the metric unit of a model of yours? Do you adjust the model or the view frustum to get a nice size.
    I'm merely asking out of curiosity

  7. #7
    Guest

    Re: so, how big is an OpenGL unit?

    There is no reason to define a unit because it all depends on what you're doing. Your objects need to be sized relative to each other, and YOU define what 1.0 means in your world.

    For instance, one day you might make a scene that consists of the earth and the moon rotating around it. In this case the unit 1.0 in OpenGL might mean 500 miles. The next day, you might make a scene of a huge battle between an amoeba and some protozoans. Now you see that 1.0 in OpenGL might mean 500 micrometers. As long as your objects are correctly sized with respect to each other, it doesn't really matter what the units are.

  8. #8
    Member Contributor
    Join Date
    Nov 2002
    Posts
    96

    Re: so, how big is an OpenGL unit?

    So, it's merely trail and error to find the right size of an unit/model!

    I think I got my question answered.

Similar Threads

  1. OpenGl Texture unit problem
    By agersoor in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-08-2012, 03:56 AM
  2. Writing Unit Tests using OpenGL
    By kturkowski in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-05-2011, 12:22 AM
  3. Unit testing framework for OpenGL
    By LogicalError in forum OpenGL: General
    Replies: 9
    Last Post: 11-08-2010, 10:01 AM
  4. Unit of length in OpenGL
    By HaVyThoai in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-16-2007, 01:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean