### Post by phil on May 9, 2020 13:18:57 GMT

Hi,

I have a question about the way multiple overlapping objects are "resolved" to determine the current material. The test (#2) "Finding n1 and n2 at various intersections" and the corresponding code additions for prepare_computations appears to depend on the distance along the ray to determine which object (and the corresponding material) is "active".

So, in the diagram above the test, intersection #1 represents the transition from A to B. Likewise, intersection #2 represents the transition from B to C. But, intersection #3 is in effect ignored since the ray is "in" C already. Intersection #4 is the transition back from C to A, and #5 is A to air.

But, what happens if the ray is going in the opposite direction, perhaps as the result of a reflection from some other surface (for example, a plane D with mirror like material properties)? Then the "reflection" ray would traverse the objects A, B and C in the opposite direction and intersection #3 (assume exactly opposite ray and same intersection numbering) would now represent a boundary from C to B. So, the "definition" of the composite object A, B, C would be different. Is that right?

Note, this situation could seemingly occur during an animation with the composite object A, B, C rotating. At some point the "definition" of the object, i.e. the "internal" material property boundaries would change. Is that correct?

Is this ambiguity in the definition of such composite objects resolved later in the book with CSG? Are explicit subtractions included to only allow a single object to occupy a single point in space?

Any thoughts or insights on this would be appreciated.

I have a question about the way multiple overlapping objects are "resolved" to determine the current material. The test (#2) "Finding n1 and n2 at various intersections" and the corresponding code additions for prepare_computations appears to depend on the distance along the ray to determine which object (and the corresponding material) is "active".

So, in the diagram above the test, intersection #1 represents the transition from A to B. Likewise, intersection #2 represents the transition from B to C. But, intersection #3 is in effect ignored since the ray is "in" C already. Intersection #4 is the transition back from C to A, and #5 is A to air.

But, what happens if the ray is going in the opposite direction, perhaps as the result of a reflection from some other surface (for example, a plane D with mirror like material properties)? Then the "reflection" ray would traverse the objects A, B and C in the opposite direction and intersection #3 (assume exactly opposite ray and same intersection numbering) would now represent a boundary from C to B. So, the "definition" of the composite object A, B, C would be different. Is that right?

Note, this situation could seemingly occur during an animation with the composite object A, B, C rotating. At some point the "definition" of the object, i.e. the "internal" material property boundaries would change. Is that correct?

Is this ambiguity in the definition of such composite objects resolved later in the book with CSG? Are explicit subtractions included to only allow a single object to occupy a single point in space?

Any thoughts or insights on this would be appreciated.