Hi Edgar,
I use the following code in my current app to project the XY plane
orthogonally onto the viewport.
void setupOrthoView(Canvas3D canvas) {
// ortho-view parameters
Point2d shift=new Point(0.,0.); // viewport shift along the X and Y
axis
Dimension size=new Dimension(500,300); // viewport width and height
// (=viewport scaling
along the X and Y axis)
// calculate view transformation
Transform3D proj=new Transform3D();
proj.ortho(shift.x,shift.x+size.width,shift.y+size.height,shift.y,-200.,200.
);
// ( because top and bottom are swapped, coordinates
// will start in the top left corner [y-down] in this view )
// set view transformation
View view=canvas.getView();
view.setCompatibilityModeEnable(true); // seems necessary for setting
projection matrices
view.setLeftProjection(proj);
view.setRightProjection(proj);
}
in this example,
- all points (0.,0., ?) will be projected into the top left pixel of the
viewport.
- all points (499.,299., ?) will be projected into the bottom right pixel of
the viewport.
(as long as they are in the visible Z-range -200 to +200)
Good luck,
-- Julian
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Edgar Delgado Barbosa
Sent: Tuesday, February 08, 2000 1:13 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Ortho example?
I need some ortho view example.
I'm trying to code something with ortho method, but with no success.
Also found some kind of bug: an inconsistent transform matrix.
Thanks
Edgar
===========================================================================
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".
===========================================================================
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".