سؤال

A while ago I've created an obj parser to better support my Maya/Game interface. I compromised on triangulating every model in Maya, but after noticing the support in other packages, how would you rebuild your triangulated workflow from a quad obj file? IE:

f 1//1 4//4 3//3 2//2

Of course, such that texture coordinates are compatible, or synced. (Or I may have to reconfigure)Any help is appreciated. Sometimes I'll get it talking about it.

Edit: Also, a link to resources for face splitting is useful. I can't seem to wrap my mind around it.

هل كانت مفيدة؟

المحلول

Assuming you don't want to change how your application handles meshes internally (i.e. switch from passing triangles to the pipeline to passing quads) the easiest solution is to alter your parser so that it creates two triangles in place of each quad.

For each face:

f v1 v2 v3 v4

You'll want to create two triangles: v1 v2 v4 and v4 v2 v3.

Per vertex data like normals and texture coordinates will stay the same.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top