|
Investigating further, it seems as though that I’m getting bogus rotations for cameras and lights.
Taking a target direct light as an example. In Max 2010, I have it located at (-0.696, 104.816, 0.0) in the world with euler rotations of (-90, -180, 0.155). In maxscript, I dumped out the transform:
$Direct01.transform
(matrix3 [-0.999996,-0.00270572,0] [0,0,1] [-0.00270572,0.999996,0] [-0.696054,104.816,2.0249e-006])
So far, this seems correct. When I export to FBX (2012) with z-up, the FBX file has this entry:
Model: 791804896, “Model::Direct01”, “Light” {
Version: 232
Properties70: {
P: “PostRotation”, “Vector3D”, “Vector”, “”,-90,-0,0
P: “RotationActive”, “bool”, “”, “”,1
P: “InheritType”, “enum”, “”, “”,1
P: “ScalingMax”, “Vector3D”, “Vector”, “”,0,0,0
P: “DefaultAttributeIndex”, “int”, “Integer”, “”,0
P: “Lcl Translation”, “Lcl Translation”, “”, “A”,-0.696053683757782,104.815559387207,2.02489763978519e-006
P: “Lcl Rotation”, “Lcl Rotation”, “”, “A”,89.9999993235163,-0,-179.844973597
P: “Lcl Scaling”, “Lcl Scaling”, “”, “A”,1.00000002457802,1,1.00000002457802
P: “MaxHandle”, “int”, “Integer”, “UH”,2
}
MultiLayer: 0
MultiTake: 0
Shading: T
Culling: “CullingOff”
The first thing that I noticed is that the local rotation and post rotation are not what I expected. Even when I manually calculate LclRotation*PostRotation, I get
- 0.9999963 1.223D-16 0.0027053
1.223D-16 1. - 3.311D-19
- 0.0027053 - 2.241D-22 - 0.9999963
Finally, I opened the FBX file in the “Transformation” example that comes with the SDK. It seems to complain about the camera, too.
Direct01
Error: The two global transform results are not equal!
KFbxEvaluatorGlobalTransform Row_0: -0.999996, -0.002706, 0.000000, 0.000000
KFbxEvaluatorGlobalTransform Row_1: -0.002706, 0.999996, 0.000000, 0.000000
KFbxEvaluatorGlobalTransform Row_2: -0.000000, 0.000000, -1.000000, 0.000000
KFbxEvaluatorGlobalTransform Row_3: -0.696054, 104.815559, 0.000002, 1.000000
FromScratchGlobalTransform Row_0: -0.999996, -0.002706, 0.000000, 0.000000
FromScratchGlobalTransform Row_1: 0.002706, -0.999996, -0.000000, 0.000000
FromScratchGlobalTransform Row_2: 0.000000, -0.000000, 1.000000, 0.000000
FromScratchGlobalTransform Row_3: -0.696054, 104.815559, 0.000002, 1.000000
So far, neither the evaluator or “scratch” global transforms match what I get when I dump the transform info with maxscript.
At this point, I’m a little lost as to what’s going on. I’ve seen similar behavior when I look at a camera node. If anyone has any insight, I would certainly appreciate it!
(I also attached the FBX file that I’ve been using)
Thanks.
|