Are rotation angles clockwise or counterclockwise in PBRT?

177 views
Skip to first unread message

Oguz Akyuz

unread,
Feb 24, 2016, 10:39:58 AM2/24/16
to pbrt
Dear All,

Recently I started to implement the PBRT by reading the first edition of the book. I came to realize that PBRT uses a left-handed coordinate system but still defines positive rotations in a counter-clockwise fashion (see Figure 2.10 on page 72). To be more specific, positive angles are associated with counter-clockwise rotations when viewing the system along the negative direction of the axis of rotation.

In this case, the rotation around the x-axis equation given in page 71 and its implementation on page 72 seem incorrect to me. These equations look like this:

1      0      0      0
0      ct    -st     0
0      st     ct     0
0      0      0      1

where ct = cos(theta) and st = sin(theta).

To explain the problem, let's use the example in Figure 2.10 (page 72). Here, if we rotate a vector along the positive-z axis 90 degrees counter-clockwise around the positive x-axis, it should align with the positive y-axis. In other words [0 0 1 0]^T should map to [0 1 0 0]^T (please correct me if I am missing something here). Now, if we plug in cos(90) and sin(90) to the above matrix, it will give us:

1      0      0      0
0      0      -1     0
0      1      0      0
0      0      0      1

If we multiply this matrix with [0 0 1 0]^T it will give us [0 -1 0 0]^T. This could only be correct if the rotation was performed clockwise.

So if the above logic is not wrong, I believe that are two possibilities:

1) Either the PBRT defines positive rotations clockwise, in which case Figure 2.10 is erroneous (Figure 2.11 would also be erroneous in this case)
2) The rotation matrices are defined incorrectly (which seem almost impossible to me given how widely PBRT is used)

I would very much appreciate your comments on this issue. It is quite possible that my understanding of the topic is flawed as well but please show me the error in my arguments if this is the case.

(I've checked the bug reports but could not find anything specific about this so I decided to post here).

Ahmet Oguz Akyuz

Oguz Akyuz

unread,
Mar 30, 2016, 4:07:26 AM3/30/16
to pbrt
I would greatly appreciate any response on this question. It is still an issue that is bugging me.

Thanks,
Ahmet Oguz Akyuz 

Neil You

unread,
Apr 5, 2017, 10:01:28 AM4/5/17
to pbrt
As you can see from here https://www.evl.uic.edu/ralph/508S98/coordinates.html.

In left-handed system, positive rotation is clockwise about the axis of rotation. So the explanation and the figure shown in PBRT book is confusing to me too. I read the 2nd edition of the book. From my point of view, the rotation angle should be well-defined and consistent in all three axises, while it is somehow ambiguous in PBRT book (I don't know how the positive rotation angle is defined in PBRT).

Matt Pharr

unread,
Dec 30, 2018, 10:57:06 AM12/30/18
to pbrt
Sorry (as usual) for not responding sooner...

You're right: that stuff was inconsistently described, up through the third edition.

I think that the right specifications are that:
- in pbrt, rotations are clockwise around the axis
- (and it's a left-handed coordinate system)
- as such, the code and the equations are correct
- but those figures were wrong
- and figure 2.10 was extra wrong, since it depicts a right-handed coordinate system

I've tried to fix all of that in the online edition (www.pbr-book.org/3ed-2018/Geometry_and_Transformations/Transformations.html) and would happily appreciate feedback about whether it is all consistent now.

Thanks!
Matt


--
You received this message because you are subscribed to the Google Groups "pbrt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pbrt+uns...@googlegroups.com.
To post to this group, send email to pb...@googlegroups.com.
Visit this group at https://groups.google.com/group/pbrt.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages