Hello, I'm a new user with Jme.
I want making a game in 2D isometric view. My idea for use a 3d Engine , it's easier for making animation with pipeline 3d than with thumbnails bitmaps 2d (Too much images and more time).
In my game, i need a camera with isometric view. My cam never move.
I try make a little application for display just a box in Isometric view. My viewport must have this dimension :800 by 400.
I try with this code :
@Override
protected void initSystem() {
try {
display = DisplaySystem.getDisplaySystem(settings.getRenderer());
display.createWindow(800,400,32,60, false);
camera = display.getRenderer().createCamera(800, 400);
} catch (JmeException e) {
e.printStackTrace();
System.exit(1);
}
display.getRenderer().setBackgroundColor(ColorRGBA.white);
// initialize the camera
camera.setParallelProjection(true);
float aspect = (float) display.getWidth() / display.getHeight();
camera.setFrustum( -100, 1000, -50 * aspect, 50 * aspect, -50, 50 );
Vector3f loc = new Vector3f(50.0f, 50.0f, 50.0f);
Vector3f left = new Vector3f(-1.0f, 0.0f, 0.0f);
Vector3f up = new Vector3f(0.0f, 1.0f, 0.0f);
Vector3f dir = new Vector3f(0.0f, 0.0f, -1.0f);
// Move our camera to a correct place and orientation.
camera.setFrame(loc, left, up, dir);
/** Signal that we've changed our camera's location/frustum. */
camera.update();
/** Get a high resolution timer for FPS updates. */
timer = Timer.getTimer();
display.getRenderer().setCamera(camera);
KeyBindingManager.getKeyBindingManager().set("exit",
KeyInput.KEY_ESCAPE);
}
@Override
protected void initGame() {
scene = new Node("baseTiledMap");
box = new Box("Box numero uno", new Vector3f(0,0,0),5,5,5);
box.setSolidColor(ColorRGBA.red);
box.setModelBound(new BoundingBox());
box.updateModelBound();
scene.attachChild(box);
AxisRods ar = new AxisRods("rods", true, 10.0f);
scene.attachChild(ar);
this.buildLighting();
// update the scene graph for rendering
scene.updateGeometricState(0.0f, true);
scene.updateRenderState();
}
But the renderer is not good :'(. I try change loc , left, up , dir for a good position of the cam but i have nothing at the screen or the renderer not look like this screenshot in attachment.
With a modeler software to view objects in isometric view , you position the camera In the top view at the left of origin. The target on the origin , you rotate the camera of 45