| Matrix | Geometric action and parameters |
|---|---|
| A proper rotation about the -axis: . The angle is in radians, with the usual right-hand sense. | |
| A translation by : . | |
| Uniform scaling by : . Positive gives a uniform dilation; collapses the object to the origin; negative additionally reverses its direction through the origin. | |
| Perspective projection from the origin onto the plane , where is the focal length in the chosen coordinate units. |
The last operation produces . It requires a perspective divide: divide the first three components by the last. For ,This is why the last component of homogeneous coordinates cannot simply be discarded. Points with have no finite projected position, and a visible scene normally uses under this forward-axis convention. The first three transformations leave the last component equal to one and need no nontrivial divide. The displayed retains no depth variation after division; it describes projection onto the image plane, rather than a complete depth-buffer mapping.
Interpret the given focal point as the centre of perspective projection, . First translate it to the origin with . The direction from to the world origin is then , of length 10. Choose the rotation matrix so that this direction becomes :Indeed, the transformed component is , and the transformed component is . Thus the required mapping, followed by the perspective divide, isFor a world point , its camera coordinates and projected device coordinates areThe world origin projects to and lies at camera depth 10. A point five units along the unit viewing direction from has camera coordinates , so it lies on the central image plane as expected. Here device coordinates are image-plane coordinates centred on the optical axis; an actual pixel viewport would require its own specified scale and offset.
Only rotations about the -axis are available. Consequently the camera's horizontal axis stays parallel to the world -axis; the viewing direction lies in the world plane. The available orientation has pitch but no independent yaw or roll. Translations move the camera and the projected origin but cannot supply the missing orientation degrees of freedom.
In the solid-modelling convention used here, a rigid-body transformation is an orientation-preserving rigid transformation, represented by a proper rotation and a translation. The proposed upper-left block is orthogonal but hasIt is a reflection in the plane . It preserves distances, but reverses handedness, so it cannot describe continuous motion of a rigid solid through proper rotations and translations. Some mathematical uses of rigid transformation include this orientation-reversing case; the determinant is the distinction relevant to the warning.
In a solid modeller, triangle winding and outward normal vectors must agree. A reflection reverses the winding: for edge vectors ,Simply transforming stored normal vectors by while retaining the original vertex order therefore makes the geometric and stored normals disagree. Back-face culling, inside/outside tests and Phong reflection model calculations can then use the wrong side. Code assuming a positive oriented volume can likewise interpret the reflected solid incorrectly. A modeller can support reflections if it deliberately corrects these orientation conventions.
A suitable alternative rotates by about and then translates upward by
height. Writing ,Its rotation matrix has determinant . The source bounds , , become , , , where . A horizontal stripe becomes the vertical stripe , so even the stripe positions from the left edge are preserved. The face's normal vector is also preserved.The call constructs dimensions along the old axes. To obtain target dimensions and make an old layer become a new layer , use the cyclic permutationThe new coordinate ranges are immediately , , . Its spatial block is orthogonal with determinant , since a three-cycle is an even permutation. Hence this is a proper rotation, through about the axis in direction under the right-hand convention. No translation is required.
The multiplication order needs care. Use the standard right-hand rotation matrices, consistent with the printed and the stated positive rotation. For column vectors, direct multiplication of the two products in the order printed givesBoth permute the dimensions into , rather than the required . Therefore, with ordinary column-vector matrix multiplication, neither printed product is the permutation in part (ii). A translation can correct the position of a cuboid, but cannot correct these permuted side lengths for general . This order mismatch is present in the original printed question.[ref]
The apparent intended comparison is obtained if “chain” means apply the rotation first, then the rotation. Under that interpretation the actual column-vector products have the reverse order:Thus the negative-angle sequence is correct when read as operations performed from left to right. The positive-angle sequence givesIt occupies . Apply the world-space translationThis puts the cuboid in and still maps to . The distinction is purely the action order: ordinary products act rightmost first, while a library may describe an ordered sequence of operations in application order. Giving the coordinate maps makes either convention explicit. If one merely wanted to place the literal printed negative product in the positive octant, its translation would instead be , producing dimensions and still failing the requested general bounds.
Articles by others on the same topic
There are currently no matching articles.