Hello Scott,

some time ago you gave me this advise for my picking problem.

"Decker, Scott D" schrieb:

> The problem, I would guess here, is that you want to know which object from your
> vrml file you picked?
> With that assumption, you don't have to do a whole lot
>
> When you first create your vrml scene, get the named objects
> in this case it is Box,Cone, and ViewBox(I think that 3rd one is right)
>
> then, set the user data of their transforms, or their shapes, or their branch
> groups, whichever you are going to be doing the picking on
> So, if you got the Box transform
> BoxNode.getChild(0).setUserData(new String("BOX_SHAPE"));
>
> So, now, for each of these objects you have user data assigned to them
>
> Now, in your picking code, you pick into the scene looking for the closest node
> So, let us say that when you loaded your vrml scene, and set the user datas of
> the objects, you set that user data in their transformgroups
>
> So, you do the pick, you get the closest transformgroup
> you then get the user data of that transform group
> see what it says
> if it is "BOX_SHAPE" well, you know what node it is

Well, almost everything works fine, but I can not get the closest transform group
when I do the pick.
I manage to get the closest node in the SceneGraphPath (javax.madia.j3d.Shape3D),
but I do not get back my UserData out of javax.madia.j3d.TransformGroup.

> from your vrml scene you could have generated your own hashtable with the keys
> being the user data and the transformgroups being
> the element

Would be nice if it would work that way - did not manage to get it running. But not
that important, I think I could find a workaround.

I tried to use:
sceneGroup = scene.getSceneGroup();
sceneGroup.getChild(i).setUserData...

> So, the next thing is, what happens if I pick into the scene, get a transform
> group and the user data object is null
> that means you didn't pick an object
>
> Or, if you don't want to do any of the picking your self
> Use a PickRotate, PickZoom, PickTranslate  behavior on the scene
> it will shoot into the scene, pick an object's transform and then you can
> rotate, zoom, and translate it

I already use these ...

>
> Hope that helps
> Scott
>
> Scott Decker
> Research Scientist
> Pacific Northwest National Labs
> [EMAIL PROTECTED]

So, you would make me extremely happy if you could help me with the picking thing
once more ;-))

-Juergen.

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