changing color on an object with clickbehavior

Hi,
any idea of finding a peace of code for changing color on an object with
clickbehavior ?

For changing texture also.

Thanks

You have to break the problem down into at least 3 steps:

(1) FInd the click position on the screen.

(2) Throw a pick ray from the eyepoint through the click position in order to find the first intersected object.

(3) Get the Appearance from the Shape3D inertsected and chnage ist color.

Im pretty sure there is an example of 1 and 2 in the Java3D examples. Look for something with “pick” orr “pick ray” in the name.