1
[Max] I need help! / Re: Corona Sky Material orientation
« on: 2017-09-16, 03:18:56 »
So my current work around is to do a little matrix math.
For my camera matrix, I fix it by multiplying my camera matrix by a -PI/2 x axis rotation ([1 0 0 0] [0 0 1 0] [0 -1 0 0] [0 0 0 1]):
fixedCameraMatrix = cameraMatrix * MakeRotation(-PI/2, 1, 0, 0); // write to <camera></camera>
And then for all my world transformation for each geometryGroup I premultiply a +PI/2 x axis rotation ([1 0 0 0] [0 0 -1 0] [0 1 0 0] [0 0 0 1]).
fixedWorldMatrix = MakeRotation(PI/2, 1, 0, 0) * worldMatrix; // write to <geometryGroup><instance><transform></transform></instance></geometryGroup>
And finally for my sun vector, I used (X, -Z, Y) to place it in the right position.
For my camera matrix, I fix it by multiplying my camera matrix by a -PI/2 x axis rotation ([1 0 0 0] [0 0 1 0] [0 -1 0 0] [0 0 0 1]):
fixedCameraMatrix = cameraMatrix * MakeRotation(-PI/2, 1, 0, 0); // write to <camera></camera>
And then for all my world transformation for each geometryGroup I premultiply a +PI/2 x axis rotation ([1 0 0 0] [0 0 -1 0] [0 1 0 0] [0 0 0 1]).
fixedWorldMatrix = MakeRotation(PI/2, 1, 0, 0) * worldMatrix; // write to <geometryGroup><instance><transform></transform></instance></geometryGroup>
And finally for my sun vector, I used (X, -Z, Y) to place it in the right position.