lighttransport / nanort

NanoRT, single header only modern ray tracing kernel.
MIT License
1.07k stars 89 forks source link

What is faces : The array of triangle face indices (3 * numFaces) #71

Closed kilasuelika closed 3 years ago

kilasuelika commented 3 years ago

I'm confusing about

nanort::TriangleMesh<float> triangle_mesh(vertices, faces, /* stride */sizeof(float) * 3);

Does faces store vertices indices of each triangle? For example, (1,2,3) will mean 3 vertices indices of the first face are 1,2 and 3.

syoyo commented 3 years ago

Its actually vertex indices.

PR of better naming and fixing documents are welcome.

kilasuelika commented 3 years ago

Its actually vertex indices.

PR of better naming and fixing documents are welcome.

Thank you. I will make some PRs on documentation.

syoyo commented 3 years ago

@kilasuelika Rename faces to faceVertexIndices would be a good candidate. Such a terminology is used in USD https://graphics.pixar.com/usd/docs/api/class_usd_geom_mesh.html