www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Birdron on May 08, 2014, 12:25:09 am

Title: Inverted Model!!!
Post by: Birdron on May 08, 2014, 12:25:09 am
Hi,
I am having a very strange problem. I am using blender to create my level and exporting the model as obj, as I normaly do. When I load the model in jpct, it loads upside down. I am also loading a md2 model, which is also upside down. And most interesting thing is, the camera seems like totaly inverted. I am 100 percent sure my obj is correct, cos I tested it in irrlicht. So, what I am missing here?

Edit: do I hv to setup my scene inverted. I mean '+' will be '-'?

Thanks.
Title: Re: Inverted Model!!!
Post by: AGP on May 08, 2014, 11:00:33 am
It's not a matter of being "correct." Each engine or 3d software has its own coordinate system. Jpct's system has NEGATIVE y going up and positive (I think) z going into the screen. What do you mean by "the camera seems inverted?" You can't import cameras from OBJ. By the way, if you're already using Blender, have you tried the Blender scene loader that's posted in the projects board? I'll bet that this solves your problem.
Title: Re: Inverted Model!!!
Post by: EgonOlsen on May 08, 2014, 12:16:03 pm
Or, to "correct" the orientation do something like this right after loading the model:

Code: [Select]
obj.rotateX((float)Math.PI);
obj.rotateMesh();
obj.clearRotation();
Title: Re: Inverted Model!!!
Post by: Birdron on May 08, 2014, 01:36:03 pm
I did not know about blender exporter, I most probably missed it. I will try that. I hv
 setup my scene on negative coordinate. I cant try the blender exporter now cos I dnt have net on my pc.

Inverted camera mean, if I place the on y axis(positive), it rotates the camera 180 on z axis.

ank you.
Title: Re: Inverted Model!!!
Post by: EgonOlsen on May 08, 2014, 04:24:55 pm
Whatever you do, keep the coordinate system in mind: http://www.jpct.net/wiki/index.php/Coordinate_system (http://www.jpct.net/wiki/index.php/Coordinate_system)
Title: Re: Inverted Model!!!
Post by: Birdron on May 08, 2014, 07:28:38 pm
Yeah thanks, somehow I missed it.

Thank you