Arnaud Forgues wrote:

I am new to Java3D and I want to develop a chess game in 3D. In order to
select a piece, I use the picking behaviour, changing the color of the
shape3D retrieved thanks to pickResult. However I don’t figure out how
to retrieve the object that I create from which the Shape3D belongs to.
I tried using the pickResult.getLocalToVworld method but it works only
if I don’t rotate the scene.

I'm not quite sure if I understand the problem. I assume that you have localized java3d Shape3D object thanks to picking, but you have problem with relating it to you game logic structure.

Best way to solve this is to use setUserData/getUserData. During
creation, set user data of each chess piece to some kind of marker
identifying what it is exactly - this should be enough to create a
bridge (pun intended ;) between java3d scenegraph object and your game
logic.


Artur


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