attachChild(camera) doesn't work =(

Well, I did try this but it seems that the camera is looking to the other way that’s why I did change this parameter. But maybe I’m setting the camera in the wrong order. Here is my code :

[java] protected void initCamera() {

application.getFlyByCamera().setEnabled(false);

application.getCamera().setLocation(new Vector3f(0, 0.866f2.5f, 0.5f2.5f));

application.getCamera().lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));

application.getCamera().setFrustumFar(100);

CameraNode cameraNode = new CameraNode(“CameraNode”, application.getCamera());

cameraNode.setLocalTranslation(new Vector3f(0, 2f, 2f));

platform.getPlatformNode().attachChild(cameraNode);

cameraNode.setControlDir(ControlDirection.SpatialToCamera);

}[/java]



Edit : Well, problem solved actually :). I changed the code to this :



[java] application.getFlyByCamera().setEnabled(false);

application.getCamera().setFrustumFar(100);

CameraNode cameraNode = new CameraNode(“CameraNode”, application.getCamera());

cameraNode.setLocalTranslation(new Vector3f(0, 0.866f2.5f, 0.5f2.5f));

cameraNode.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));

platform.getPlatformNode().attachChild(cameraNode);

cameraNode.setControlDir(ControlDirection.SpatialToCamera);[/java]



Thx for the help !

this parameter doesn’t determine where you camera look it determines what between the camera and the spatial controls the movements of the other.

If right now your camera move with the spatial, it’s working as intended.

If your camera doesn’t look in the right direction check you lookAt attributes