I’m working in a 3D game and I want to make it look like a side scroller. Therefore I did this:
[java] public void updateCamera(Camera cam, Spatial lookAtNode) {
fixedLookAt(cam, lookAtNode);
}
public void fixedLookAt(Camera cam, Spatial lookAtNode) {
Vector3f lookAtVector = new Vector3f(lookAtNode.getLocalTranslation().getX(),1.2f,0);
float aspect = (float)cam.getWidth() / (float)cam.getHeight();
cam.setFrustumPerspective( 100f, aspect, 1.0f, cam.getFrustumFar() );
cam.setLocation(lookAtVector);
}[/java]
The camera nicely follows my character. Though now I would like to change the angle in the x plane so that the camera still sees the character, but under an angle.
An example of what I mean can be found here.