Results 1 to 3 of 3

Thread: How to control size of unit?

  1. #1
    Guest

    How to control size of unit?

    Hi,

    I'm strugling from calculating exact size of
    each unit in a world coordinates.
    I have to maintain small size of unit in
    order to draw an object and large size to
    draw background image.
    Usually, small size fits to meters and large
    size to kilometers.
    And also I'd like to calculate how large
    a pixel takes.

    Please, anybody help me !!!
    (Refer to Developer's FAQ 9.010)

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: How to control size of unit?

    numpixels = boundingSphereRadius / zDistance;
    numpixels *= numpixels;
    numpixels *= (screenHeight * screenWidth);

    this'll give u an approximation
    boundingSphereRadius & zDistance refer to the object u wanna test

  3. #3
    Guest

    Re: How to control size of unit?

    Thanks, ZED !

    The information you posted helps me a lot,
    however, I want to get a piece of code that
    shows how to control size of unit.
    Would you ?

Similar Threads

  1. Opengl camera control GUI instead of mouse control
    By zhar22 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-17-2013, 09:35 AM
  2. Replies: 10
    Last Post: 01-04-2007, 12:02 AM
  3. Texture unit 0 blending with Texture unit 1 problem
    By kackurot in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-31-2006, 10:16 PM
  4. Replies: 1
    Last Post: 06-02-2006, 11:52 AM

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