I followed this tutorial (http://www.gamefromscratch.com/post/2014/01/19/3D-models-and-animation-from-Blender-to-LibGDX.aspx) and I got to this point:
public class Game {
public static Game instance;
private SpriteBatch batch;
public static float time = 0;
private Level level;
private PerspectiveCamera camera;
private ModelBatch modelBatch;
private Model model;
private ModelInstance modelInstance;
private Environment environment;
private AnimationController controller;
public Game() {
batch = new SpriteBatch();
level = new Level(50, 50);
camera = new PerspectiveCamera(70, 640, 480);
vec2 pos = Rotation.point(new vec2(0,0), new vec2(0, -10), 45);
System.out.println(pos.x+" "+pos.y);
// camera.position.set(pos.x, pos.x, -pos.y + pos.y);
camera.position.set(pos.x, pos.x, -pos.y);
camera.lookAt(0, 0, 0);
camera.near = 0.1f;
camera.far = 1000f;
modelBatch = new ModelBatch();
UBJsonReader jsonReader = new UBJsonReader();
G3dModelLoader modelLoader = new G3dModelLoader(jsonReader);
model = modelLoader.loadModel(Gdx.files.internal("3d/cube.g3db"));
modelInstance = new ModelInstance(model);
// modelInstance.transform.rotate(1, 0, 0, 90);
environment = new Environment();
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.8f, 0.8f, 0.8f, 1.0f));
controller = new AnimationController(modelInstance);
// onAnimationFinnished();
}
private void onAnimationFinnished() {
controller.queue("Move", 100, 1f, new AnimationListener() {
public void onLoop(AnimationDesc animation) {
}
public void onEnd(AnimationDesc animation) {
onAnimationFinnished();
}
}, 10f);
}
public void tick() {
}
public void render() {
// modelInstance.transform.rotate(1,0,0,1);
controller.update(Gdx.graphics.getDeltaTime());
time++;
level.tick();
level.render(batch);
Gdx.gl20.glClear(GL20.GL_DEPTH_BUFFER_BIT);
camera.update();
modelBatch.begin(camera);
modelBatch.render(modelInstance, environment);
modelBatch.end();
}
}
Everything works fine, but I want to replace perspective camera with isometric camera. Any ideas how I would go about doing that?