www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: stownshend on August 25, 2011, 12:14:23 pm

Title: Axes in JPCT and 3DS Max
Post by: stownshend on August 25, 2011, 12:14:23 pm
Hi all,

Apologies if I'm asking a question already covered in previous posts. I've looked around but not found the discussion I'm after.

I have a friend developing models in 3DS Max and I am importing them and using them in JPCT. Naturally the co-ordinate system is quite different:

(http://dl.dropbox.com/u/38462785/jpctVS3dsmax.png)

What's the best way of handling the difference in axes? When he sends me a model which is facing "forward" it is facing "down" to me and I see its feet (as per the difference in axes).

Is there a way to change the axes in JPCT? Or is it better practice to rotate each Object3D in my scene to fit the existing JPCT system?

Ideally I'd like to import models and have them show up as my colleague sees if this is possible.
Title: Re: Axes in JPCT and 3DS Max
Post by: EgonOlsen on August 25, 2011, 08:49:14 pm
I usually do a

Code: [Select]
obj.rotateX((float)-Math.PI/2f);

on 3ds files. You can also make this permanent by doing

Code: [Select]
obj.rotateX((float)-Math.PI/2f);
obj.rotateMesh();
obj.clearRotation();

While this doesn't transform the max coordinate system that you've posted to the one of jPCT, it used to work fine for me. Maybe the loader already does some conversions...i can't remember that ATM. Just give it a try.
Title: Re: Axes in JPCT and 3DS Max
Post by: Thomas. on August 25, 2011, 09:06:00 pm
for me would be better rotate axis in 3ds max, but it is probably impossible...
Title: Re: Axes in JPCT and 3DS Max
Post by: stownshend on August 25, 2011, 10:05:45 pm
Thanks Egon - that's what I was doing (minus the rotateMesh()) and its working. I was just thinking if there were an easier way to do it, as I'm going to be adding 50+ 3DS models to my scene and thought there might be an easier way to handle this without rotating each object (some kind of global world rotate).

Thomas - I will talk to my friend and do some research around changing the co-ordinate system in 3DS Max. In the end, it might be easier for me to deal with the difference using rotations because he's used max for years and habitually considers the positive z axis as "up".

Cheers for your input, it confirms my approach is at least valid.