Question

In: Computer Science

Explain why it is important during raytracing to know if the viewing ray hits the surface’s...

Explain why it is important during raytracing to know if the viewing ray hits the surface’s front back or back face.

Solutions

Expert Solution

Explain why it is important during raytracing to know if the viewing ray hits the surface’s front back or back face.

At present, the normal found will always be in the direction of the center to the intersection point (the normal points out). If the ray intersects the sphere from the outside, the normal points against the ray. If the ray intersects the sphere from the inside, the normal (which always points out) points with the ray. Alternatively, we can have the normal always point against the ray. If the ray is outside the sphere, the normal will point outward, but if the ray is inside the sphere, the normal will point inward.

In this figure there is possible directions for sphere surface-normal geometry.

We need to choose one of these possibilities because we will eventually want to determine which side of the surface that the ray is coming from. This is important for objects that are rendered differently on each side, like the text on a two-sided sheet of paper, or for objects that have an inside and an outside, like glass balls. If we decide to have the normals always point out, then we will need to determine which side the ray is on when we color it. We can figure this out by comparing the ray with the normal. If the ray and the normal face in the same direction, the ray is inside the object, if the ray and the normal face in the opposite direction, then the ray is outside the object. This can be determined by taking the dot product of the two vectors, where if their dot is positive, the ray is inside the sphere.


Related Solutions

briefly explain why is it important to know the chemical compounds that will bind to a...
briefly explain why is it important to know the chemical compounds that will bind to a particular dye molecule as well as the shape and size of the entire stained structure
briefly explain why is it important to know the chemical compounds that will bind to a...
briefly explain why is it important to know the chemical compounds that will bind to a particular dye molecule as well as the shape and size of the entire stained structure
Why is it important to know PCAOB law? Please explain in detail
Why is it important to know PCAOB law? Please explain in detail
Gamma Ray Absorption A gamma ray with energy E, hits a stationary nucleus of mass M...
Gamma Ray Absorption A gamma ray with energy E, hits a stationary nucleus of mass M and is completely absorbed. In terms of E, and M, find expressions for the following quantities. a. The momentum of the nucleus after absorbing the gamma b. The total relativistic energy of the nucleus after absorbing the gamma c. The rest mass energy of the nucleus after absorbing the gamma d. The kinetic energy of the nucleus after absorbing the gamma
Why is it important to know how to calculate a firm's cost of money? Explain.
Why is it important to know how to calculate a firm's cost of money? Explain.
why is it important to know the rate of a reaction
why is it important to know the rate of a reaction
In your own words, explain why is it important to know the difference between hearing and...
In your own words, explain why is it important to know the difference between hearing and listening someone during a conversation? Explain your answers in 200 words.
IMPORTANT: I know the answer is "C". However, I don't know why. Could you please explain...
IMPORTANT: I know the answer is "C". However, I don't know why. Could you please explain why? Thank you A linear total cost curve that passes through the origin implies that a.         average cost is constant and marginal cost is variable. b.         average cost is variable and marginal cost is constant.             c.         average and marginal costs are constant and equal.             d.         you need more information to answer question.
Micheal wants to know what are important crustaceans and why they are important?
Micheal wants to know what are important crustaceans and why they are important?
Why is it important to know the taxpayer’s filing status?
Why is it important to know the taxpayer’s filing status?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT