I have a simple tube and when I want to rotate the camera around the model , the model start to loss the precision.
as can be seen in the following clip:
I’m no expert on this but my understanding is what you’re seeing is a hardware floating point precision limit. The range of floats you’re using there is huge.
Often if I receive georeferenced CAD or BIM files from a client I’ll see numbers like this and my first step is to scale everything to my target platform’s units, reposition to world origin and then apply/reset all transforms before exporting. This usually resolves any floating point issues.
I don’t think there is another solution. It’s a hardware limit. Use smaller numbers, relative to world origin. Everything is relative to the observer (camera) - you don’t need absolute coordinates so it’s easy to avoid such floating point precision issues.
Everything is relative to the camera. Say you’re wanting to represent our huge solar system. If you use absolute coordinates for everything there’s no consumer hardware that can handle that. If you scale everything down to manageable units and have a floating origin that tracks the camera, you can visualise the entire solar system.
I’m not sure I explained that very well.
Everything has limits - even the universe has floating point precision limits in the Planck length
There’s probably a few ways to achieve it but say you’re developing something like Google Earth, you wouldn’t just have a single huge range of absolute coordinates. You’d break the world down into level of detail tiles and display a particular level of detail tile depending on the camera position and distance. But each tile is still using a sane and manageable range of relative floating point coordinates.
Yes, scale and recenter everything to the origin (0, 0, 0) then, depending on your software, make sure you reset/apply those transformations (in 3ds max it is/was “Reset Xform” and in Blender it’s “Apply > All Transforms”).
But it depends on your use case. If you need the user to get really close, like walking around on the surface, then you will need some kind of level of detail, terrain tiling system.
Actually, if you use the centering properly, everything can be done in full scale. I did a full scale Solar system wide demo using my techniques, all single precision, not one double floating point variable!
See: my trip to Pluto