Dear Fellows, We are currently facing some erroneous behavior with java 3D when it comes to rendering high precision geometric components.
Lets say we are trying to to draw a cube using java 3D. Rendering it as a simple QuadArray. The truncation and distortion start to happen when we try to draw a small cube at a very far location. For example take a cube with a very tiny width (edge size = 2 * 0.02), while its location is very far away on the x axis: 1000000 In this case we observed that data is being internally truncated within the Quad array, causing the cube shape to be fully distorted. for example in one vertex the x coordinate was rounded up to exactly 1000000.0 rather than having the exact value of 999999.98 and in another vertex the x coordinate was truncated to exactly 1000000.0 rather than the exact value of 1000000.02 Knowing that our coordinates are in double precision. Found attached is a small java3D example, with two static constants WIDTH and DISTANCE, you can vary their values and see that the distortion starts to happen at DISTANCE 1000000 N.B: We also tried passing geometry by reference, when we truied getting the vertices also by reference, the values were exact. However the rendering was still corrupted meaning that internally the values are still truncated or rounded. Best regards, <<DoublePrecisionTest.java>> <<DoublePrecisionTest.class>>
DoublePrecisionTest.java
Description: Binary data
DoublePrecisionTest.class
Description: Binary data