First person view?

I have an object moving along a surface using a rotpospathinterpolator.

How do I get it so that the viewer is moving with the ball, ie. in first person view. Is it something to do with the viewplatform?

If anyone can help, that would be great.

Thanks

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

Forgot to say, that I added this aswell.

SimpleUniverse u = new SimpleUniverse( c ) ;

vpTrans= u.getViewingPlatform().getViewPlatformTransform();

Hey
I know great book like tutorial online here is the link:

http://fivedots.coe.psu.ac.th/~ad/jg/

go to java 3d section, I blieve chapter 15 talks about first person perspective view and a gun. That might give you some clues on how to stick the object to the viewing platform and follow it.
If not see other chapters. I am curretly reading that tutorial but so far I am on chapter 10. So good luck, hope this is helpfull

Regards

Dust