mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
The mapbox earcut library returns triangles in clockwise winding order, but USD expects counter-clockwise order. This was causing reversed face orientation for polygons with 5 or more vertices when using the earcut triangulation method. Changes: - src/tydra/render-data.cc: Reverse triangle winding order by swapping indices 1 and 2 when processing earcut results to convert from CW to CCW - examples/tydra_to_renderscene/to-renderscene-main.cc: Add --trifan option to enable triangle fan triangulation method for testing The triangle fan method was already producing correct CCW triangles and did not require changes. Tested with models/ngon.usdc containing pentagon, hexagon, and octagon. Both triangulation methods now correctly produce CCW triangles. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.5 KiB
Executable File
2.5 KiB
Executable File