karansher / computer-graphics-ray-casting

Computer Graphics Assignment about Ray Casting
1 stars 0 forks source link

Orientation of surface normals for triangles #3

Closed mannyamorim closed 1 year ago

mannyamorim commented 2 years ago

We need to compute the surface normal for the point of intersection. For spheres this is trivial and for planes we have the surface normal given in the plane definition. For triangles we can compute using the cross product of the edges however the orientation is ambiguous (the normal could be multiplied by negative 1).

Normally the orientation is meant to be inferred based on the ordering of the triangle vertices. Is this the case for this assignment? If so what is the expected orientation based on the ordering of the vertices?

panuelosj commented 2 years ago

Yes. Given three vertices of a triangle A, B, C, assume a righthand rule normal when looping through from A to B to C.