Justin Couch wrote:

Mark McKay wrote:

The j3d.org packages include examples of overlay classes, which kind-of
allow you to fake it.  What these do is however a mere convenience:
they
just insert the relevant 2d objects in the 3d universe at a z=0
position
 for your viewpoint.

What do you mean?  Does this write raster data?  I've tried (with some
sucess) to position raster objects under a transfom that's identical to
the one for my viewing platform.  Effectively you can draw 2D objects
this way.  Unfortunately, if you have any geometry which comes close to
the eye, it pokes through your labels.


The difference is the overlay packages are full 3D textured objects
in-scene rather than raster objects. In either case, you end up with the
same effects when objects get too close. I've tried to get the overlays
positioned as close to the minimum clip distance, but you still do end
up with the intersection problems at times. Either way, there is not
much you can really do about it as both objects exist as 3D elements in
the 3D world. The only real way of doing this is using 2D draw routines
over the window. Java3D has traditionally been quite poor in performance
with this path though. A change was put into 1.3 that allowed you to
blit an image through the Graphics3D class for decent performance. The
idea was you would draw everything to the image, then blit the image in
the preSwap() method on canvas to get your 2D effects. I've never tried
it myself to see the sucess or otherwise of this tactic.

I've tried this myself. It has good performance, as far as I can tell. There is a drawback - if you attempt to drag the component performing the drawAndFlushImage() onto another monitor, J3D will throw a native exception and crash.

Mark McKay
--
http://www.kitfox.com

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

Reply via email to