# Reverse normal in ray-plane intersection

This topic is 1457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I am trying to do ray-plane intersection based on this siggraph material: http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm and there the tutorial says that if the dot product between the ray direction and the plane normal is greater than zero then it usually should be reversed.

Why? Since I don't know yet the reason, I also don't know if I can reverse it soon after the first intersection test for the first pixel and then forget about it, or if I can reverse it once only for the intersection rays (I am using orthographic projection, so the ray's direction is always 0,0,1) and then for reflection/refraction rays should I do the dot product test everytime?

Someone could do the favor of clarify that out for me?

##### Share on other sites

If the dot product between the ray direction and the plane normal is greater than zero then it indicates that if you're going to collide with the plane at all, you'll be hitting the back of it.

Exactly what behaviour you want to take when a ray hits a back face is up to you. By reversing it, you're essentially making your plane double sided, which might be desirable, it probably depends on your usage case. You might want to be able to see through the back faces, or to ignore them because you have another plane at the same location but pointing the other way with different material properties.

Taking steps like precaclulating dot product results because your ray's direction is always 0,0,1 sounds like it might be a premature optimization at this stage. I would get stuff working before you put in special optimizations that take advantage of your ortho projection.

Edited by C0lumbo

##### Share on other sites

You might want to be able to see through the back faces, or to ignore them because you have another plane at the same location but pointing the other way with different material properties.

Well, in my case I am just concerned about using planes to represent things like ground or sky, at least for the time being. So in this case I can ignore this reverse procedure, right ?

##### Share on other sites

Yes, you should be able to ignore the reverse procedure if you don't want back faces to be visible.

Just remember whenever you're investigating why something isn't visible, that one of the many possible explanations is because you're looking through the back of the surface.

1. 1
Rutin
70
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633430
• Total Posts
3011825
• ### Who's Online (See full list)

There are no registered users currently online

×