Can I Increase Vector Precision in THREE.js? -


In THREE.js, sometimes I congratulate myself for better control over vector precision, especially when large Working with floats, like in a solar system, is there any way to do this?

In the linked example, I am creating a simple solar system in which the planets are realistic numbers for the size and distance. To emulate the orbit, the whole system rotates on the axis located on the planet's position. When the camera is brought closer to the horizon of the planet, the transit is appearing along the terrifying side.

Can I increase the accuracy of the rotation applied to the axis and its child objects, so this jittery win 't be clear? Or do I just need to work with small numbers?

When a small number is used for the following numbers, the jar becomes less.

  sun.position.set (50000000, 0, 0); Planet. Position.set (-50000000, 0, 0); After a lot of research, the short answer to this question is "Can I increase vector precision?"  

three. J. "Yes, but this is an advanced topic.

The long answer is: Increasing vector precision basically means that the javascript number is accurate because X, Y, Z and Y values ​​inside vector Regular Javascript numbers.

Increasing the number precision requires accounting for "Epsilon" which is a measure of possible errors in the calculation: See an explanation and possible solution for Epsilon Zavascript exists in mathematics because 64 bits have a storage limit for numbers.

Regarding the accuracy given to 3D objects at different distances, you can use the logarithmic depth buffer as the object Depth (or Z index) is handled. It is not linear as it can be expected that it is a great way to handle the scenes where you have both distance between both distance and distance

If you decide to implement this solution, then there are two good places to start it. See:

< / P>

I originally asked this question because I was looking at "Shake" or "Jitter" in the position of "objects" while using the range of numbers you would find in a solar system due to joining work I did not want to reduce my numbers, so I got it Investigated as a solution. The end result of my efforts is that in the THREE.js for the purposes of my solar system, there is a limit for the distance that I can use between the objects. Due to my geometry, I can not use more than 6 significant points, which means that the normal range radius of Mercury is 57.9 million km. Distance of 57.9 thousand kilometers , Which means that the Sun too many is close and large, and requires scaling itself, and so on. Actually, to get a reliable position, my solar system can be only 999, 999 km in diameter.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -