| Other BBSes » |
Atari coding BBS
|3D backface culling 3rd|
Posted by: ROGer
My question would be about 3D backface culling and in particular about the reverse transformation of the camera(location vector). As far as I've understood you have to treat your camera the opposite way as compared to your object.
If you e.g. rotate your object around the axes like that:
z 30 deg, y 40 deg, x 20 deg
then the order and angles for the rotation of the camera should look like that:
x -20 deg, y -40 deg, z -30 deg
For using an ordinary 12muls 3D rotation it's obvious how the reverse transformation can be achieved. But how would it work and look like for a 3x3 3D rotation matrix? Would it be simply to combine the separate rotation matrices around the axes in the opposite order?
For example, if you created your 3x3 3D rotation matrix for the object by combining the separate rotation matrices around the axes (M1 = z rotation matrix, M2 = y rotation matrix, M3 = x rotation matrix) like that:
M1*M2 = A
A*M3 = B -> final 3x3 3D rotation matrix for object
would the reverse transformation for the camere work like that?:
M3*M2 = A
A*M1 = B -> final 3x3 3D rotation matrix for camera
(I guess I am too naive?!)
Though, if I think about it, the creation of a separate 3x3 3D rotation matrix and its usage for rotating a single point (-> the camera) would consume more muls than an ordinary 12 muls 3D rotation.
Anyway, would be cool to know how the reverse transformation of a 3x3 3D rotation matrix can be achieved.
[All messages in this thread] [Start new thread]
What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.