Inaccurate rendering of Points far from origin

When I render a set of data points that are known to lie along a straight line, the resulting redering does not always appear as expected.

The points are distorted as the coordinates are located further from the origin.

Any ideas, in order to render a consistent straight line, no matter where the data exists?

Data Set 1 (renders points along a straight line):

14.9,0,83.7

15.9,0,83.5

16.9,0,83.2

17.8,0,83.0

18.8,0,82.8

19.8,0,82.5

...

Data Set 2 (renders a jagged, apparently quantized, inconsistent "line"):

889714.9,0,4882183.7

889715.9,0,4882183.5

889716.9,0,4882183.2

889717.8,0,4882183.0

889718.8,0,4882182.8

889719.8,0,4882182.5

...

BranchGroup objRoot = new BranchGroup();

TransformGroup contentTransform = new TransformGroup();

contentTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

contentTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);

objRoot.addChild(contentTransform);

[...]

Vector3f translate = new Vector3f();

Transform3D sphereTrans = new Transform3D();

TransformGroup sphereTG = null;

SharedGroup share = new SharedGroup();

share.addChild(new Sphere(.01f, Sphere.GENERATE_NORMALS, appearance));

Point3d[] points = data.getPoints();

for (int i=0; i<points.length; i++)

{

translate.set(points[ i]);

sphereTrans.setTranslation(translate);

sphereTG = new TransformGroup(sphereTrans);

sphereTG.addChild(new Link(share));

contentTransform.addChild(sphereTG);

}

Thanks!>

[1659 byte] By [nick67890a] at [2007-10-2 21:31:43]
# 1
IIrc, this is due to the restrictions of openGL's depth buffer- as you get further from the front pane co-ordinates get less precise. I don't remember the exact details but you should be able to find out more knowing that.
_Breakfast_a at 2007-7-14 0:45:07 > top of Java-index,Security,Cryptography...
# 2
HiSee http://www.starfireresearch.com/services/java3d/supplementalDocumentation.html#zbufferfor the reason for this.HTHEndolf
endolfa at 2007-7-14 0:45:07 > top of Java-index,Security,Cryptography...