View Full Version : How to control size of unit?

11-30-2000, 09:08 AM

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)

11-30-2000, 10:53 AM
numpixels = boundingSphereRadius / zDistance;
numpixels *= numpixels;
numpixels *= (screenHeight * screenWidth);

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

12-01-2000, 10:32 AM
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 ?