Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - mustafa1991

#1
Support / Re: Strange coordinate system
July 26, 2011, 01:04:54 AM
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.  8)

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?  ???
#2
Support / Strange coordinate system
July 25, 2011, 11:45:50 PM
First the coordinate system is upside-down  ???
This is not the main problem, I can deal with that.

The problem is that I want to create a row of cubes
like this: (+ = cube)

+++++

for(int i=0; i<5; i++) {
Object3D cube = Primitives.getCube(10f);
cube.translate(i*30, 0, 0);
cube.build();

world.addObject(cube);
}


I get a strange row of cubes, I get something like this:

+
    +
       +
          +
             +

:o
Why does this happen I translated them on the X axis, I tried the other axis same thing but in other directions  :'(
I didn't rotate anything!
#3
Support / Difference between jPCT and jPCT-AE.
July 25, 2011, 07:10:07 PM
Hi, I'm new to jPCT.  :)
I read that there is a small difference between jPCT and jPCT-AE.

How much different are they? What part is different?
How much time/effort will it take to port from one to another?

Testing on android is very slow ... I would rather develop the game for the desktop and test it and then port it to the Android platform and do Android specific testing.

Do you think I will be faster at developing if I do so?

Thanks.