In PBRT, left-handed coordinate system is used, including the dedness transformSwapsHandedness indicates whether the coordinate system is changed in transformation.

Why do I need to change coordinates?

See my book series for more information: dezeming. Top /

I think of an interesting analogy, you can imagine, for example, we look in the mirror, we have a mole on the left side of the face, no matter how we rotate, pan and zoom, even the camera position has been rotated and shifted, but your mole is still on the left side of the face.

But for the computer model, we can make your mole show on the right face by calculating: you can perform a symmetric transformation, after the symmetric transformation, your mole will be on the right face:

A symmetric transformation is just a change in the coordinate system.

A symmetric transformation is actually a change in the coordinate system. For example, the original three points of the triangle are (1,1,1),(2,3,1),(7,2,5), and the direction of the normal vector obtained by the cross product is:

,1,1 Point3f p0 (1), p1,3,1 (2), p2,2,5 (7);

    Vector3f N = Cross((p1-p0),(p2-p0));

So N is 8, minus 4, minus 11.

Let’s make a symmetry of the normal vector along the Z-axis (equivalent to converting the left to right coordinate system) :

Point3f p0 (1, 1, 1), p (2, 3, 1), p2 (7, 2, 5);

    Vector3f N = Cross((p1-p0),(p2-p0));

I get negative 8,4, negative 11. But the problem is we’re just making a symmetry on the Z-axis, so the normal vector of this object should be 8,-4,11, so it’s going to be negative for all the coordinates.