Hi, In the case of geometry by-reference, Java 3D uses the array that you provide, which can be double or float. In the case of geometry by-copy, Java 3D internally stores the data for GeometryArray objects as (single-precision) float. Double-precision coordinate positions are accepted for convenience, but are not stored as doubles. The reason for this is that all known OpenGL pipelines (and all known graphics HW devices) use single-precision floating point arithmetic in their transformation pipeline. So even if we send double-precision coordinate positions to OpenGL--which we do in the case of geometry by-reference--the graphics pipeline truncates them to single-precision. Java 3D does keep all matrices as double-precision and send them to OpenGL as an array of doubles. This should allow you to translate the coordinate system of the nodes you are rendering so that the data is closer to the origin (in local coordinates), and should help avoid the loss of precision.
-- Kevin Rushforth Java 3D Team Sun Microsystems [EMAIL PROTECTED] >Date: Tue, 4 Dec 2001 11:41:06 +0200 >From: CCC Java Team <[EMAIL PROTECTED]> >Subject: [JAVA3D] Loss Of Precision in Geometric Data >To: [EMAIL PROTECTED] > >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>> > > > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".