Re: coordinate system handedness

301 views
Skip to first unread message

Matt Pharr

unread,
Jan 4, 2016, 12:02:15 PM1/4/16
to pbrt, carl....@gmail.com
These are very good questions; apologies for the three year delay in digging into them. :-). I've spent a bunch of time reviewing all this stuff and think I have some answers, but would also be interested to hear further comments about all this.

You're right about the cross product and it not being handed-ness dependent.

I believe that there are two places where the handedness matters: first, the viewing/camera coordinate system is definitely left-handed. Thus, handedness is encoded in both the LookAt() function and the Camera implementations.

Second, the rotation matrix derivations are based on a left-handed coordinate system.

I'll try to figure out how to boil this into reasonably concise errata (and fixes for the third edition) but, again, would appreciate a second pair of eyes to make sure it's really right this time.

Useful references:

Regarding that Cross() call, yes, you're right--that's incorrect. I'm not sure what to do about it, since fixing it causes most current scene files (which have presumably effectively been hacked to work around that bug) to render incorrectly. (Well, correctly, but with unexpected results at this point.) I'm open to great ideas about what to do about that as well!

Thanks,
Matt


On Sun, Dec 30, 2012 at 6:01 AM, Carl Witkin <carl....@gmail.com> wrote:
I have two questions/comments:

1. I am a little bit confused about the coordinate handedness in pbrt.
The book says that pbrt uses a left handed system.
Page 61 shows the definition of the cross-product and it says that this is valid for a left-handed system.
But the same equation applies also to a right-handed system.
When you have a left-handed system the left-hand rule applies for the cross-product but the equation is the same as for a right-handed system:
The cross-product of the x-direction with y-direction is always the z-direction in both systems, but in one the left-hand rule applies in the other the right-hand rule (see Fig. 2.2 on page 57)
So if the book would not mention the handedness, i would think pbrt supports also a right handed system.
Where in the code are computations which are valid for a left-handed system only?

2. First line on page 148: ts=Cross(ss,ns);.
Should it not be ts=Cross(ns,ss) ?  The current code flips the ss direction, but the final ss shall be  in the direction as defined in the per-vertex data.
Compare also to p. 479, tn=Cross(nn,sn), where it is correct.

--
You received this message because you are subscribed to the Google Groups "pbrt" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pbrt/-/W-wGYbPATnAJ.
To post to this group, send email to pb...@googlegroups.com.
To unsubscribe from this group, send email to pbrt+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pbrt?hl=en.

Reply all
Reply to author
Forward
0 new messages