New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flip faces (cw/ccw) and/or normals from material #4910
Conversation
…ping faces, normals , both, or none as default
There appears to be 3 x 4 = 12 possible ways to set these two property values. Are there really 12 cases? Does this PR have an impact on the raycasting logic? Does |
|
Sorry, I tried, I really tried, but this PR and your answers do not make any sense to me. Maybe I am missing something and @mrdoob can clarify. I think this PR would lead to total user confusion. BTW, you also have to accommodate the other renderers -- |
@Nimanf Maybe instead of the four enum values: NoFlip, FlipFaces, FlipNormals and FlipFacesNormals, we just have two boolean flags: FlipFaces, FlipNormals. Two flags is a bit easier to manage that four enums. |
@Nimanf FlipFaces controls CW/CCW + inverting the normals (so we are backwards compatible), while FlipNormals just inverts the normal vector. You can set both and in that case it flips the faces and leaves the normals alone / double inverts the normals (because FlipFaces inverts the normals and FlipNormal also inverts the normals.) I think this is a more straightforward approach and more "orthogonal' to the existing code. |
Yeah, that sounds better. |
As discussed in #4904, the following flags determines our desired flip method (flipSide parameter in Material):
By default, THREE.NoFlip, considers material.side === THREE.BackSide, which is the original behavior of three.js. So it won't change the core and only allows developers to flip faces and/or normals in real-time efficiently, regardless of the culling face mode (double/front/back)
one example scene is also included.