Michael,
I'll try to give a more detailed description of the problem.
The Barco Baron is basically a large display screen (1.36m wide by 1.1m
high) (see www.barco-usa.com). The user stands in front of the
display. A pair of cameras tracks his/her hand and produces it's
physical world 3D location. I want to display virtual objects at the
same location. I think I have worked out the transform into virtual
world coordinates (the resulting values seem logical) but the view seems
to be set up wrong so that the volume of space where I can see objects
is too small. I have played around with various different setups for
the view model.
Below is an example of my code.
private SimpleUniverse universe = null;
private Bounds bounds = new BoundingSphere(new Point3d(),
Double.MAX_VALUE);
private final double BARCO_HEIGHT = 1.1; // 1.281;
private final double BARCO_WIDTH = 1.36; // 1.58;
private void initView() {
// ViewPlatform settings
universe.getViewingPlatform().getViewPlatform().
setViewAttachPolicy(View.NOMINAL_SCREEN);
// View settings
universe.getViewer().getView().setTrackingEnable(false);
universe.getViewer().getView().setUserHeadToVworldEnable(true);
universe.getViewer().getView().setViewPolicy(View.SCREEN_VIEW);
universe.getViewer().getView().
setProjectionPolicy(View.PERSPECTIVE_PROJECTION);
universe.getViewer().getView().
setScreenScalePolicy(View.SCALE_EXPLICIT);
universe.getViewer().getView().
setWindowResizePolicy(View.VIRTUAL_WORLD);
universe.getViewer().getView().
setWindowMovementPolicy(View.VIRTUAL_WORLD);
universe.getViewer().getView().
setWindowEyepointPolicy(View.RELATIVE_TO_SCREEN);
universe.getViewer().getView().setCoexistenceCenteringEnable(true);
// PhysicalEnvironment settings
universe.getViewer().getPhysicalEnvironment().
setCoexistenceCenterInPworldPolicy(View.NOMINAL_SCREEN);
universe.getViewer().getPhysicalBody().setNominalEyeOffsetFromNominalScreen(2.0);
universe.getCanvas().setStereoEnable(true);
universe.getCanvas().setLeftManualEyeInImagePlate(new Point3d(0.647,
0.55, 2.0));
universe.getCanvas().setRightManualEyeInImagePlate(new Point3d(0.713,
0.55, 2.0));
// Screen3D settings
universe.getCanvas().getScreen3D().
setPhysicalScreenHeight(BARCO_HEIGHT);
universe.getCanvas().getScreen3D().
setPhysicalScreenWidth(BARCO_WIDTH);
}
Then create a sphere & transform it to the location of the hand
double[] points = socket_listener.getPoints();
if (points.length % 3 == 0 && points.length >= 3) {
Point3d p = new Point3d(points[0], points[1], points[2]);
System.err.println("Camera coords : " + p);
p.scale(0.001);
Transform3D imageToVworld = new Transform3D();
canvas.getImagePlateToVworld(imageToVworld);
Point3d p1 = new Point3d(p);
cameraToImagePlate.transform(p1);
System.err.println("camera coords in image plate coord system");
System.err.println(p1);
imageToVworld.transform(p1);
System.err.println("camera coords in virtual world coord system");
System.err.println(p1);
t3d.setTranslation(new Vector3d(p1));
System.err.println("Sphere transform : " + t3d);
transformGroup.setTransform(t3d);
}
===========================================================================
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".