Dear Isaac,

It is not very clear how or why the TriangleFanArray
is being displayed in the scene path.

As a test I used the Four by Four example in the j3d
example and changed the spheres to Cones, when
printing out the scene path it shows:

path[0]=javax.media.j3d.Locale@f297e7 :
com.sun.j3d.utils.geometry.Cone, ID@d2fc36 :
javax.media.j3d.Shape3D, ID@d2fc36
LocalToVworld Transform:
1.0, 0.0, 0.0, 10.0
0.0, 1.0, 0.0, -10.0
0.0, 0.0, 1.0, 30.0
0.0, 0.0, 0.0, 1.0

FOUND:javax.media.j3d.Shape3D@19e15c
ID:ID@d2fc36

which makes no reference to a 'tfa'?

In the Positions file i set the Cones userData with
it's corresponding ID object which is detected and is
retrievable as demo'd in the above snippet.

the code to do this was:

ID id = new ID(i);
posCone[i].setUserData(id);

The retrieval would then be:

ID posID = (ID) node.getUserData();

This is irrespective of whether, for example, your
Protein extends a Shape3D. I have found it easiest to
retrieve a reference to an object that is associated
with a geometrical j3d shape by setting a reference to
that object in the shape3D's userData.

Maybe someone can clarify this. As I too am in
development of j3d experience I have been following
your postings with interest ( there are similiar
traits to the stuff I have been working with ) thats
why it's nice to see solutions too!

Anyway hope this helps.

Greg.









--- "Brobbey,Isaac (neuron)"
<[EMAIL PROTECTED]> wrote:
> Dear all:
>
> consider the snippet below:
>
> int x = ((MouseEvent)event[i]).getX();
>                         int y =
> ((MouseEvent)event[i]).getY();
>                         System.out.println("x="+"
> "+x);
>                         PickRay pickRay =
> generatePickRay(x,y);
> SceneGraphPath []Path =
> branchGroup.pickAll(pickRay);
>                      for (int b=0;b<Path.length;b++)
>                         {
>
> System.out.println("path[b]="+Path[b]);
>                          }
>
> the following print below shows the result of  the
> path, i want to retrieve
> the object Protein which i used to make the
> cone.something like
>
> Protein tein =(Protein)Path[0].getObject();
>
> but that throws an exception, any ideas on how
> really get to this object ?
>
> path[i]=javax.media.j3d.Locale@1fe571f :
> com.sun.j3d.utils.geometry.Cone,
> Protein@109ea96 :
>
javax.media.j3d.Shape3Djavax.media.j3d.TriangleFanArray@83b1b
>
> LocalToVworld Transform:
> 0.0375749076740305, -0.005965948985267853,
> -0.012350453208999744,
> 0.285124270664246 0.0, 0.03601788328904463,
> -0.017398620975559716,
> 0.12078290366391121 0.013715911991643523,
> 0.01634378978561484,
> 0.033834216736250124, 0.6479161499920172
> 0.0, 0.0, 0.0, 1.0
>
>
> this is what i really want to process
>
> path[i]=javax.media.j3d.Locale@1fe571f :
> com.sun.j3d.utils.geometry.Cone,
> Protein@109ea96 :
>
javax.media.j3d.Shape3Djavax.media.j3d.TriangleFanArray@83b1b
>
> and get to the protein object.
>
> any Ideas ?
>
>
> thanks,
>
> Isaac
>
>
===========================================================================
> 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".


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.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