I have tried something but not with using a seperate class but I still can’t get anything to work. I’m getting the following error when running the program.
Exception occurred during Behavior execution:
java.lang.NullPointerException
at javax.media.j3d.TransformInterpolator.processStimulus(TransformInterp
olator.java:156)
at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:172)
at javax.media.j3d.J3dThread.run(J3dThread.java:250)
This is my code that I am using for the camera.
public RotPosPathInterpolator mCameraPath;
public TransformGroup tgCamera;
public TransformGroup vpTrans;
//setup a camera transform group
Transform3D tCameraTransform = new Transform3D( );
tCameraTransform.set(new Vector3d(0.0f,0.0f,0.0f));
tgCamera = new TransformGroup(tCameraTransform);
tgCamera.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );
…
…
mCameraPath = new RotPosPathInterpolator (
alpha1,
vpTrans ,
axisOfRotPos1,
knots1,
quats1,
positions1) ;
BoundingSphere bounds1 = new BoundingSphere( new Point3d( 0.0 , 0.0 , 0.0 ) , 1000.0 ) ;
mCameraPath.setSchedulingBounds( bounds );
tgCamera.addChild( mCameraPath );
sceneRoot.addChild( tgCamera );
Does anyone have an idea why I am getting that message or what I am doing wrong?
Thanks