Quote from: EgonOlsen on July 25, 2011, 11:48:54 PM
The coordinate system is as much upside down as any other. It's just uncommon...but apart from that, you must be doing something strange. Are you sure that you are looking at your scene from the right angle?
Thanks for replying
Well, here is a demo I simplified the program to be one Java file, so you can test it if you want to.
Code Select
import java.awt.Color;
import javax.swing.JFrame;
import com.threed.jpct.*;
public class Game {
private JFrame frame;
private FrameBuffer buffer;
private World world;
public static void main(String[] args) {
new Game().loop();
}
public Game() {
frame = new JFrame("Game");
frame.setSize(800, 600);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
world = new World();
// create cubes
Object3D cube = null;
for(int i=0; i<5; i++) {
cube = Primitives.getCube(10f);
cube.translate(i*30, 0, 0);
cube.build();
world.addObject(cube);
}
// camera angle 1
//world.getCamera().setPosition(50, 0, -150); // you can uncomment this and comment the next to lines for an other anlge
// camera angle 2
world.getCamera().setPosition(50, -150, 50);
world.getCamera().rotateCameraX(90f);
}
private void loop() {
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
while(frame.isShowing()) {
buffer.clear(Color.BLUE);
world.renderScene(buffer);
world.draw(buffer);
buffer.update();
buffer.display(frame.getGraphics());
try {
Thread.sleep(10);
} catch (InterruptedException e) {}
}
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.dispose();
frame.dispose();
System.exit(0);
}
}
Do I have the right angle?
I didn't rotate the cubes, did I rotate them somehow in my code?