PDA

View Full Version : Is there any specification of triangle meshes to be used with glStencilOpSeparate?



Coolys
10-28-2016, 02:25 PM
Hello,

I just started OpenGL programming with Qt and have difficulties in understanding glStencilOpSeparate. I want to use this function to get a clip edges of slice, but don't know if mesh normal is required to use the function. The function check the triangle meshes if they are front sided or back sided, so the normal vector should be included in the triangle mesh information? Or the function automatically calculates the normals using the three vectors? This would be a stupid question, but I can't find any information regarding this.

Thank you in advance.

GClements
10-28-2016, 02:39 PM
The function check the triangle meshes if they are front sided or back sided, so the normal vector should be included in the triangle mesh information? Or the function automatically calculates the normals using the three vectors?
Whether a triangle is front-facing or back-facing is determined by the winding order (clockwise or counter-clockwise) of the triangle's vertices in screen space.

Vertex normals don't have any effect upon the calculation.

Coolys
10-28-2016, 07:09 PM
Whether a triangle is front-facing or back-facing is determined by the winding order (clockwise or counter-clockwise) of the triangle's vertices in screen space.

Vertex normals don't have any effect upon the calculation.

Thank you for your explanation.