Hello,
For the navigation in my program I have setup a navigation reference which
is a simple raster image that is displayed in the centre of the screen just
beyond the front clipping plane. The problem is when I set the Distance
Offset the raster is also set to a specific z position and I can no longer
adjust the rasters position. When the clipping plane is small this is not a
big deal, but in some scenes the clipping plane is quite large and the
raster is no longer visible. The following is how I create the raster...
URL url =
getClass().getClassLoader().getResource(NAVIGATION_REFERENCE);
TextureLoader loader = new
TextureLoader(Toolkit.getDefaultToolkit().getImage(url), null);
ImageComponent2D image = loader.getImage();
Canvas3D canvas = Engine.getEngine().getUniverse().getCanvas();
float clipDistance = -1.001f *
(float)Engine.getEngine().getUniverse().getViewer().getView().getFrontClipDistance();
// create the navigation reference shape
Raster raster = new Raster();
raster.setType(Raster.RASTER_COLOR);
raster.setSrcOffset(0, 0);
raster.setSize(image.getWidth(), image.getHeight());
raster.setImage(image);
raster.setDstOffset((image.getWidth() / 2), (image.getHeight() /
2));
// the following command does nothing. I can not set the position
raster.setPosition(new Point3f(0, 0, clipDistance));
Shape3D shape = new Shape3D(raster, appearance);
shape = new Shape3D(raster, appearance);
// add it to a BranchGroup so we can attach/detach from view
PlatformGeometry geometry = new PlatformGeometry();
geometry.setBoundsAutoCompute(true);
geometry.setCapability(BranchGroup.ALLOW_DETACH);
geometry.addChild(shape);
Does setDstOffset some how disable the setPosition??? Or is there an
alternate way to center a raster on the screen? The screen size and
resolution are not constant.
Thanks,
Steve
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
===========================================================================
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".