简体   繁体   English

Directx 11:重建三角形以支持四边形

[英]Directx 11: Rebuilding triangles in support of quads

A while ago I've created an obj parser to better support my Maya/Game interface. 不久前,我创建了一个obj解析器,以更好地支持我的Maya / Game界面。 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? 我在三角剖分中折衷了Maya中的每个模型,但是在注意到其他软件包中的支持之后,如何从Quad obj文件重建三角剖分的工作流程? IE: 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 (ie 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 . 您将要创建两个三角形: v1 v2 v4v4 v2 v3

Per vertex data like normals and texture coordinates will stay the same. 每个顶点的数据(如法线和纹理坐标)将保持不变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM