|
Post by mnemonic on Feb 5, 2019 10:47:24 GMT
I don't understand how to perform this operation (outlined on page 71). I have a 4x4 matrix (containing a linear transform and translation vector) and a ray (with origin and direction) and I don't know how to multiply out the matrix to the ray to get a new ray. What is the actual definition that you have used.
Regards.
|
|
|
Post by Jamis on Feb 5, 2019 16:19:01 GMT
Hello mnemonic ! The transform(ray, matrix) function needs to apply the matrix to the ray's origin and direction, returning a new ray with the transformed point and vector. Here's some pseudocode: function transform(ray, matrix) let new_origin ← matrix * ray.origin let new_direction ← matrix * ray.direction return new ray with new_origin and new_direction end function Does that help?
|
|
|
Post by mnemonic on Feb 6, 2019 8:55:58 GMT
Most helpful. Thank you.
|
|