# Scaling world - projection, view or separate matrix?

I am currently writing a simple 3D space visualisation program. Things get loaded into it from a simple XML file, which contains positions and sizes of objects in space, so you can put basically any numbers into the XML and it will show you what the things look like in 3D.

My problem is that when I try view for example a solar system, using real numbers as they really are in space (e. g. earth-moon distance = 3.844e8 m), my objects loose their form and textures get detached from faces due to limited floating position precision. I simply can't make users to scale the scene themselves, because with 10 planets or so it's too much work, and sometimes calculations little bit more complex.

Because of this, I decided to add an option that would make it possible for one to scale whole scene automatically.

My question is rather simple: If I want to scale world/scene, which matrix should I use? Projection matrix, view matrix, or a completely new matrix (please, not this one, I'm running out of uniforms)?

Thank you.

• Scaling (as well as other transformation operations) is usually done with the world matrix. If you're using separate uniforms for position, rotation, and scale, you can combine them all into a single world matrix. – fastinvsqrt Jan 6 '15 at 22:20