-----Original Message-----
From: Guillaume ALLEON <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, September 07, 2000 12:05 PM
Subject: [JAVA3D] Picking and other stuff for scientific viz


>...
>- Is there a way to have the Menu coming on top of the canvas3D (there is
>a discussion on that topic on j3d.org but only for Popup menu.


JMenus have an associated popup menu; you tell the popup menu to be heavyweight
to ensure it appears above the heavyweight Canvas3D. For example:

    mMyJMenu.getPopupMenu().setLightWeightPopupEnabled(false);

While you're at it, tell tooltips to be heavyweight as well:

    ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);

>- Is there a way to assign colors onto triangles rather than on their
>vertices
>without duplicating nodes


You could make each triangle a separate Shape3D with a separate Appearance --
not recommended for millions of triangles. A better solution would be to use an
indexed geometry, specify a triangle's color only once, and link each of it's
node's color indices to the one color.

>- At the moment we have a Color bar making the correspondance between
>the real physical value and the color. We have put it in a AWT Pane. I have
>the feeling that it would be better to have it in the scene. How to do it
>without
>having tons of shapes that speed down rendering ?

Why would it be better to be in the scene? I'm curious, since I'm going to have
to do this soon as well. I thought it would be better off _out_ of the scene,
where it wouldn't be affected by rotation or magnification, and wouldn't
increase rendering costs as the scene is manipulated.

>- The more interesting question is dealing with Picking there are a lot of
>Picking functions but these are all oriented for mouvement (translation,
>rotation, zoom).
>I would like to Pick (single click) my scene and get back  the indice of my
>triangle
>in my triangle array so that I can modify locally my triangle or I can
>display the local
>physical value on that picked point.


For Java3D 1.1.3, If each triangle were a Shape3D, you could create a
com.sun.j3d.utils.behaviors.picking.PickObject, call pickClosest() with the
MouseEvent's point to get a SceneGraphPath, call SceneGraphPath.getObject() to
get the Shape3D that was picked. Note that Node's have a user-specifiable
pointer to arbitrary user-data, so you could store a triangle index with each
Shape3D, at the cost of doubling the number of objects.

Later versions might provide more frugal alternatives.

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