Hi Javier,
The  method transformChanged(int type, TransformGroup t) could return a null in the t
paremeter.
The transformGroup is the object taht PickRotateBehavior modifies, the type is:
NO_PICK (in this case the transformGroup t  is null !!!!!!!!!!!!)
ROTATE   (the PickRotateBehavior modifies the transformgroup)
TRANSLATE (the PickTranslateBehavior )
ZOOM (The PickZoomBehavior)

Your code should check the type,

            if (type == PickingCallback.NO_PICK) {
                System.out.println("NO pick");
            else {
326:          t.getTransform(t3);
327:          t3.get(v3f);
327:          System.out.println("Picking <"+v3f.x+","+v3f.y+","+v3f.z+">");
            }

Regards,

Dani.


> my code is
>
> 321:   public class MyCallbackClass extends Object implements
> PickingCallback{
> 322:      Transform3D t3=new Transform3D();
> 323:      Vector3f v3f=new Vector3f();
>
> 325:    public void transformChanged(int type, TransformGroup t) {
> 326:          t.getTransform(t3);
> 327:          t3.get(v3f);
> 327:          System.out.println("Picking <"+v3f.x+","+v3f.y+","+v3f.z+">");
>       }
>     }
>
> but sometimes, when I'm moving in the world, it gives me the next error:
>
> Exception ocurred during Behavior execution:
> java.lang.NullPointerException
>         at MyProgram$MyCallbackClass.transformChanged(MyProgram.java:326)
>         ...
>
> First of all: The TransformGroup in the transformChanged method... which
> TransformGroup is it??
>                   I mean, if I have some of them in the same ScenePath, the 
>TransformGroup
> is the                    parent, or the first starting in the Locale??
> Second: Why that error appear? I have the KeyNavBehavior and when I 'walk'
> over the object I want            to rotate, sometimes nothing happend and another
> times the previous error appear!!
>
> Thank you and Sorry for my English
>
> Javi
>
> ===========================================================================
> 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".

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