Getting CameraNode to work

Hi, I’m trying to attach the default camera to a CameraNode, so that it can be controlled via a node. I have done the following but it does not seem to work:



CameraNode cameraNode = new CameraNode(“Camera Node”, cam);

cam.setLocation(Vector3f.ZERO); //Not sure if this is needed

cameraNode.setControlDir(ControlDirection.SpatialToCamera);

earthPivot.attachChild(cameraNode);

cameraNode.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);

cameraNode.setLocalTranslation(0, 0, 15);



rootNode.attachChild(earthPivot);



(earthPivot is instantiated)



Whenever I ask the program to print the location of “cam”, it always prints [0, 0, 10] (the default). Surely this should be [0, 0, 15] if it is in the cameraNode?



If anyone could help that would be great!

disable the flyCam

I have done that already, sorry for forgetting to mention it ^^

ok do you have similar issues with TestCameraNode ?

http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/input/TestCameraNode.java