XNA Model Orientation

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

XNA Model Orientation // Game Development

1  |  

Post by sutphinwb // Jan 17, 2009, 12:00pm

sutphinwb
Total Posts: 4
Hi - I new to trueSpace. I tried drawing a floor using the workspace and the plane tool. It worked fine, added a texture, etc, etc. I exported the floor, to directx format and tried displaying it in an example handed to my by the XNA Framework. The floor appeared ahead of my camera view (verse under), which had been set up to a first person configation to walk along the floor (in Z and X), floating slightly above it (Y). When I would expect to be walking along the floor, I am actually raising and lowering the view (Y up and down) looking down on it. I have hence noticed / learned that the Z for trueSpace is up and down and for XNA it is in and out (of the screen). Does this make sense?


Being an amature at this, I'm not sure the best way to address it. Any suggestions would be appreciated.


TIA

Post by rjeff // Jan 17, 2009, 3:43pm

rjeff
Total Posts: 1260
pic
Tom this one is yours!

Post by TomG // Jan 19, 2009, 4:04am

TomG
Total Posts: 3397
Yes, the co-ords are different in XNA and tS. You may have to rotate your object in tS before exporting to X. There is no universal standard for co-ordinate systems, and different apps and engines have either Z as up (tS for instance) or Z as forward (XNA for instance).


HTH!

Tom

Post by Ospreyluvr // Jan 20, 2009, 8:29am

Ospreyluvr
Total Posts: 112
pic
SutphinWb, how did you make a first person configuration for the camera in XNA? I have been trying to set up a FPS camera for a month now, and can't figure out how to do that with a character, or how to make the camera move.

Post by sutphinwb // Jan 25, 2009, 2:45am

sutphinwb
Total Posts: 4
I used the "Fuelcell" demo technique. Its in the documentation for XNA Game Studio 3.0, under Extended Tutorials. Like I said, I'm just getting started with it.

Post by sutphinwb // Jan 25, 2009, 6:37am

sutphinwb
Total Posts: 4
>Yes, the co-ords are different in XNA and tS. You may have to rotate your object in tS before exporting to X. There is no universal standard for co-ordinate systems, and different apps and engines have either Z as up (tS for instance) or Z as forward (XNA for instance).


BTW, I'd be interested to know how to do this in tS. I can rotate the plane using the properties box or the rotator tool, but when its exported, it alway shows up in the same place. I tried using the axis tool to rotate it - the axis will rotate and the properties will change (for the rotator object I'm guessing since the plane doesn't move), but once exported, nothing changes.


So, I'm going to have a look at the .x file, which I hoped to avoid.


TIA

Post by sutphinwb // Jan 25, 2009, 6:58am

sutphinwb
Total Posts: 4
BTW, BTW, I've messed with FrameTransformMatrix (see below), as mentioned in


http://msdn.microsoft.com/en-us/library/bb204853(VS.85).aspx


to no avail. What I think is really needed is a "step" in


floor.Model = Content.Load<Model>("Models/Plane");


that futzs with the model to do whatever needs to be done. I know the model will be tS, I can apply "corrections" for XNA.



Frame DXCC_ROOT {

FrameTransformMatrix {

1.000000,0.000000,0.000000,0.000000,

0.000000,0.000000,1.000000,0.000000,

0.000000,1.000000,0.000000,0.000000,

0.000000,0.000000,0.000000,1.000000;;

}


Frame Plane {

FrameTransformMatrix {

1.000000,0.000000,0.000000,0.000000,

0.000000,1.0000,0.000000,0.000000,

0.000000,0.000000,-1.000000,0.000000,

0.00000,0.00000,0.000000,1.000000;;

}

Post by Michael Billard // Jan 28, 2009, 8:02am

Michael Billard
Total Posts: 125
Have you tried rotating the model and then resetting the axis? That's what I did when I encountered the same problem.

Post by Michael Billard // Jan 28, 2009, 8:15am

Michael Billard
Total Posts: 125
I found the posts I was looking for. I ran into your problem a couple of years ago. Here is the thread: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=1213969&SiteID=1


Specifically from that thread:


Now that I know how the .X importer works, I can see how to orient the model in trueSpace. My experiments show me when normalizing the axes, in [trueSpace's] object space, +X points at the ship's tail, +Z points at the ship's top, and +Y points at the ship's right wing. If I do that and export using left-handed coordinates, the ship points with its nose in the [XNA] world's +X direction, the ship's top points in the world's +Y direction, and its right wing points in the world's +Z direction.


Hope that helps!


-mike
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2020. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn