You could use perhaps the setScale method with objTransform

 Diwakar R Puthalapat <[EMAIL PROTECTED]> wrote:

I am defining x,y,z coordinates (multiples of 2) using Point3f class and
drawing the lines using LineArray class. As you see below, values are
widely spread. Does anyone know how to scale the coordinates to the size of
the control panel before plotting them (500,500).

Point3f[] myCoords = {
new Point3f(0.0f, 200.0f, -300.0f),
new Point3f(0.06f, 206.89f, -251.64f),
new Point3f(1.82f, 183.81f, 65.15f),
new Point3f(7.37f, 194.57f, 356.24f),
new Point3f(-17.29f, 51.01f, 665.12f),
new Point3f(-25.08f, -36.97f, 1019.9f),
new Point3f(-16.03f, -85.58f, 1357.81f),
new Point3f(-16.03f, -85.58f, 1357.81f)};

objTransform = new Transform3D();
objTransformGroup = new TransformGroup(objTransform);

objTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
sceneTransformGroup.addChild(objTransformGroup);

Material m = new Materi al(LColor, eColor, LColor, sColor, 100.0f);
Appearance myAppear = new Appearance();
m.setLightingEnable(true);
myAppear.setMaterial(m);

LineArray myLines = new LineArray(myCoords.length,
GeometryArray.COORDINATES);
myLines.setCoordinates(0, myCoords);
Shape3D myShape = new Shape3D(myLines, myAppear);
myShape.setAppearance(myAppear);
objTransformGroup.addChild(myShape);

Thanks in advance.

Diwakar

===========================================================================
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".



Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

Reply via email to