If you do it using the method I use, you need to look at the callback
methods of the picking behaviors. But first, you say when someone picks
object A, you want to change the color of object Qa. So is there a direct
correspondence from object A to Qa and from B to Qb and from C to Qc, and
so on and so on.
The reason I ask is that if you use the callback methods of the picking
behaviors, they return the TransformGroup of the object clicked. This
means that you have to determine which object was picked by matching the
correct TransformGroup.
For example, if you click on say object B, and assuming object A and B and
C ... all have separate TransformGroups, then you now have the
TransformGroup for object B. But you don't know it is for object B, you
just have a TransformGroup. You then need to match this TransformGroup
with the correct TransformGroup, in this case the TransformGroup of Object
B. Once you know it is object B, you can then say change the color of
object Qb provided you have a one to one correspondence with (A,B,C,....)
and (Qa,Qb,Qc,....).
There may be a pure Java3D way to do the above but the way I implemented
this is that I kept a link to all of my objects in a Vector java type. The
objects in the vector aren't directly JAva3D objects either. This Vector
kept a bunch of non-Java3D related information about the objects as well as
the Java3D object itself.
If you look at my web page closely, pay particular attention to the
PickSelection Behavior. When someone clicks on an object, the
PickSelection behavior triggers a Callback and from the Callback I get a
TransformGroup for the object I clicked on. I then enumerate through all
of my privately create objects in the vector and look at the
TransformGroup of the Java3D object, when I find a match, I know I have the
right object. I can then change the name of the object ( a non-Java3D
property of my private class object).
The reason i think this is necessary is that since you are clicking on one
thing and wanting to change the color of something else that corresponds to
that object, you will need to have a separate data structure like a lookup
table that says when I give you A give me back Qa so i can change it's color.
I have my behaviors on my web page but I am not sure that I have the
callback class that is in my main class on the web page. I can email that
to you if you want it. It is actually very straight forward and short.
I hope this helps.
At 11:31 AM 03/23/2001 +0100, you wrote:
>Hi Eric,
>
>Firstly I would like to congratulate you about you homepage and work.
>
>Really I don't know if you could help me about a java3D issue.
>
>My problem is that I have a lot of 3D object, so object A, B, C, etc;
>e.g. - I
>need to implement a code to change the color of the object Qa, when I
>picked the
>object A. Perhaps it would work with WakeupBehavior, but I can't find
>some a way
>to link the WakeupBehavior with the pick something.
>
>Some hints ? ....|:0).
>Thnx in advance. Adriano
>--
>+------------------------------------------------------+
>| Adriano Cavalcanti Silva |
>| Research Assistant |
>| |
>| Fraunhofer Institute - Computer Graphic Center |
>| Graphic Information System Group / A5 |
>| Rundeturmstr. 6 Darmstadt |
>| Germany |
>| |
>| Tel: +49-6151-155-409 Fax: +49-6151-155-444 |
>| http://www.igd.fhg.de email: [EMAIL PROTECTED] |
>+------------------------------------------------------+
***********************************************************************
Eric N. Reiss
MEMS Manager
Swanson Center for Product Innovation
Department of Mechanical Engineering
School of Engineering - University of Pittsburgh
3700 O'Hara Street
647 Benedum Hall
Pittsburgh, Pennsylvania 15261
Phone: 412-624-9696
FAX: 412-624-7701
Email: [EMAIL PROTECTED]
http://www.sigda.acm.org/Eric/
***********************************************************************
===========================================================================
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".