Original Post
Hi,
I must figure out some factor, so I could do the following conversion:
pixels = meters * factor
meters = pixels / factor
I need it, because I have to set near / far plane or scale models to appropriate size. For example: if I had 1x1x1m cube and the factor was 2.0, the cube's model dimmensions would be 2x2x2.
It's quite problematic to choose good factor - if too small or too big then I'll get some numerical errors and visual artifacts (e.g. z-fighting).
I also have to set up gravity force in my physics engine, so it would be something like:
gravity = 9.81f * factor
Velocity, position, distances and other things depend on the factor as well.
Again, too small or too big factor will cause problems with stability and accuracy of physics engine.
What should be the factor ? What values do you use for near / far plane ?
I must figure out some factor, so I could do the following conversion:
pixels = meters * factor
meters = pixels / factor
I need it, because I have to set near / far plane or scale models to appropriate size. For example: if I had 1x1x1m cube and the factor was 2.0, the cube's model dimmensions would be 2x2x2.
It's quite problematic to choose good factor - if too small or too big then I'll get some numerical errors and visual artifacts (e.g. z-fighting).
I also have to set up gravity force in my physics engine, so it would be something like:
gravity = 9.81f * factor
Velocity, position, distances and other things depend on the factor as well.
Again, too small or too big factor will cause problems with stability and accuracy of physics engine.
What should be the factor ? What values do you use for near / far plane ?