# Meshing strategies

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

## Recommended Posts

Hi, I'm creating a circular mesh centred at the origin by generating the mesh for only one quadrant, as the other three quadrants are derived from the first (-x; -x,-z; -z.) I'm now having trouble with the triangles because two of the quadrants are getting culled from being back-facing. Turning off back-face culling is not an option, which leaves me with no alternative but to generate the triangles in a different way. In your opinion what would be the best way to overcome the following problem, ie: 1) In the first quadrant I generate the triangle {(0,0,0),(10,0,5),(10,0,0)} 2) Inverting the triangle horizontally gives {(0,0,0),(-10,0,5),(-10,0,0)} which is back-facing. Is there a mathematical, simple way to overcome this issue so that all triangles are front-facing or have I no choice but to write a specialized createTriangle function that does conditional checks on the 3pt coordinates passed in and correctly creates a front-facing triangle?

##### Share on other sites
Would it be possible to create the three extra quadrants by rotating the original, or do you have constraints on symmetry? Rotation within a plane is guaranteed to be direct, and so the resulting triangles will have the correct winding.

If this isn't an option, then the extra work for flipping the bad triangles isn't much. First, understand that there is no need to perform any calculations to determine the triangles' orientations - they can be easily deduced from the transformation used to create them:

A reflection is an indirect transformation. A consequence of this is that it will always flip the winding order. So, assuming that the first quadrant has all its triangles winding correctly, you need to flip exactly those triangles who have undergone an odd number of reflections. If you are doing things the easy way, this will mean that the two adjacent quadrants will need inversion, while the opposing quadrant will have taken care of itself (the two reflections will have 'cancelled out').

If you don't already know, you can switch the winding order of a triangle by simply swapping any pair of its vertices.

##### Share on other sites
Quote:
 Original post by TheAdmiralWould it be possible to create the three extra quadrants by rotating the original, or do you have constraints on symmetry? Rotation within a plane is guaranteed to be direct, and so the resulting triangles will have the correct winding.

There aren't constraints on symmetry but the texture coords have to be recalc'ed.
Quote:
 So, assuming that the first quadrant has all its triangles winding correctly, you need to flip exactly those triangles who have undergone an odd number of reflections. If you are doing things the easy way, this will mean that the two adjacent quadrants will need inversion, while the opposing quadrant will have taken care of itself (the two reflections will have 'cancelled out').

Exactly the results I'm getting!
Quote:
 If you don't already know, you can switch the winding order of a triangle by simply swapping any pair of its vertices.

Alright, that's what I'll do. I started this thread believing there was some other 'better' way of doing this but now I see how pointless that was... :-)

1. 1
2. 2
3. 3
Rutin
23
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 10
• ### Forum Statistics

• Total Topics
633653
• Total Posts
3013152
×