Hi there,
I'm writing a simple exporter for 3dsmax to export to a particle engine in Flash, however I'm running into issues that are a bit beyond me.
I've managed to do the first bit, which is to transform coordinates using a matrix:
mxYUp = matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0]
mxCam = cam.transform
mxCamYUp = mxCam * mxYUp
mxCamYUp.rotation as eulerangles
however, my rotations seem to have an extra -180 degrees on them.
[-180,0,0]
Can anyone explain what I should be doing here? The guy doing the Flash side reckons that the rotations should come out as [0,0,0] which seems fair to me if that's what they are in 3dsmax anyway.
Can anyone shed any light?
Thanks,
Dave
Y-Up to Z-Up
Started by davestewart, Mar 14 2008 10:34 PM
2 replies to this topic
#1
Posted 14 March 2008 - 10:34 PM
#2
Posted 17 March 2008 - 07:10 PM
hi,
i assume that cam.transform is a 3x3-matrix, mxYUp a 3x3 matrix and mxCamYUp a 3x3 matrix (dunno why you're using a fourth line for matrix3):
you're aiming for
cam.transform * mxYUp = Identity =
1 0 0
0 1 0
0 0 1
and you're actually having
cam.transform * mxYUp = mxCamYUp =
1 0 0
0 -1 0
0 0 -1
with mxYUp =
1 0 0
0 0 1
0 -1 0
(rotation by 90° around the x-axis)
Inverse Matrix of mxYUp = Transpose(mxYUp)
=> cam.transform = mxCamYUp * Transpose(mxYUp) =
1 0 0
0 0 1
0 -1 0
so your camera transformation is a rotary matrix, rotating 90° around the x-axis. therefore your product-matrix mxCamYUp is a rotation around 180°, which is what your euler angles are proving.
to get identity, you therefore have to change mxYUp to
mxYUp2 =
1 0 0
0 0 -1
0 1 0
i assume that cam.transform is a 3x3-matrix, mxYUp a 3x3 matrix and mxCamYUp a 3x3 matrix (dunno why you're using a fourth line for matrix3):
you're aiming for
cam.transform * mxYUp = Identity =
1 0 0
0 1 0
0 0 1
and you're actually having
cam.transform * mxYUp = mxCamYUp =
1 0 0
0 -1 0
0 0 -1
with mxYUp =
1 0 0
0 0 1
0 -1 0
(rotation by 90° around the x-axis)
Inverse Matrix of mxYUp = Transpose(mxYUp)
=> cam.transform = mxCamYUp * Transpose(mxYUp) =
1 0 0
0 0 1
0 -1 0
so your camera transformation is a rotary matrix, rotating 90° around the x-axis. therefore your product-matrix mxCamYUp is a rotation around 180°, which is what your euler angles are proving.
to get identity, you therefore have to change mxYUp to
mxYUp2 =
1 0 0
0 0 -1
0 1 0
#3
Posted 29 March 2008 - 12:25 AM
Hey Omni,
Thanks for the help! I managed to do it in the end, but I'll check out your solution as well.
Cheers for chipping in,
Dave
Thanks for the help! I managed to do it in the end, but I'll check out your solution as well.
Cheers for chipping in,
Dave
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











