JME co-ordinate

I am not very sure which co-ordinate system JME uses, but I am assuming it uses the right hand co-ordinate system. I am trying to set-up my terrain. Is this correct to assume thet the 0,0 location for the x,z is at the top right hand corner of the monitor



________0,0

/…/

/…/

/_______/



tomcat

I’m not positive and maybe mojo or someone can confirm for sure but I think it depends on how you set your camera up??



I say that because of a problem I had a while back in this thread

http://www.jmonkeyengine.com/jmeforum/viewtopic.php?t=1287&postdays=0&postorder=asc&start=15



Mojo Said:
you are close, but by making up (0, 0, 1) you just put your camera in a left handed coordinate system. This will look right when things are not moving, but once you start moving things are going to get a little odd. You'll either want to make left (1, 0, 0) or up (0, 0, -1).


Anyway ... at least in my game world the picture you showed is correct.

This is very confusing. I thought I knew the JME coordinate but I dont think I do. What do I need to do to make my coordinate either this



________0,0

/…/

/…/

/_______/



or this



___

/…/

/…/

0,0
/

when I am looking at the monitor

tomcat

Are you talking about world or screen coordinates? I’m getting confused now too haha. (Not your fault) Hopefully someone a little more in the know will come along soon.

OK, I am talking about world coordinate. I am keeping y constnat and moving along x,z coordinate so if you are sitting in front of the monitor, how does the x,z cordinate look like. Does this make sense?

tomcat

ahhh … okay

well for my game world I’m using the following camera code



    Vector3f pos = new Vector3f(0.0f, 40.0f, 0.0f);
    Vector3f left = new Vector3f( -1.0f, 0.0f, 0.0f);
    Vector3f up = new Vector3f(0.0f, 0.0f, -1.0f);
    Vector3f dir = new Vector3f(0.0f, -1.0f, 0.0f);
      /** Move our camera to a correct place and orientation. */
    cam.setFrame(pos, left, up, dir);



This creates a camera looking down the y axis at the xz plane.

My world coordinates look like this when I'm looking at the screen.

-x
0,0
........................./
........................./
........................./
........................./
.........................+z

Where the 0,0 (x,z) is in the middle of the screen.

Ok, thats good. I’ll try it and see what happens.

tomcat

world coordinates are completely based on how you setup your camera. Most of our demos have the default camera setup to initially face in such a direction as to have X increase to the right, Y increase as you go up and I believe Z increase as you go back into the screen.

Thx




Vector3f pos = new Vector3f(0.0f, 40.0f, 0.0f);
Vector3f left = new Vector3f( -1.0f, 0.0f, 0.0f);
Vector3f up = new Vector3f(0.0f, 0.0f, -1.0f);
Vector3f dir = new Vector3f(0.0f, -1.0f, 0.0f);
/** Move our camera to a correct place and orientation. */
cam.setFrame(pos, left, up, dir);


Is this the same as shochu has posted.
tomcat

Nope … I changed the default camera for my game. I needed a camera that looked down on the xz plane. The default is different. If you want the default setup just copy paste it out of one of the demos :slight_smile:

OK, we’ll do.