谁能帮我解释一下 FBX 格式吗?

发布于 2024-12-09 06:37:54 字数 809 浏览 1 评论 0原文

我使用记事本++查看FBX模型的数据结构,但我在理解它时遇到一些问题。这是位于 (0,0,0) 的立方体(边= 10)的一些信息,谁能告诉我这些成员是什么意思?谢谢!

Vertices: *24 {
a: -5,-5,0,5,-5,0,-5,5,0,5,5,0,-5,-5,10,5,-5,10,-5,5,10,5,5,10
} 
PolygonVertexIndex: *36 {
a: 0,2,-4,3,1,-1,4,5,-8,7,6,-5,0,1,-6,5,4,-1,1,3,-8,7,5,-2,3,2,-7,6,7,-4,2,0,-5,4,6,-3
} 
Edges: *18 {
a: 0,1,2,3,4,6,7,8,9,10,13,14,16,19,20,25,26,32
} 
Normals: *108 {
a: 0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,-        1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-   1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
} 

UV: *24 {
a: 0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1
} 
UVIndex: *36 {
a: 9,11,10,10,8,9,8,9,11,11,10,8,4,5,7,7,6,4,0,1,3,3,2,0,4,5,7,7,6,4,0,1,3,3,2,0
} 

i use notepad++ to see the data structure of FBX model but i have some problems understanding it. Here is some info of a cube(side = 10) located in (0,0,0), can anyone tell me what do these members mean? THANKS!

Vertices: *24 {
a: -5,-5,0,5,-5,0,-5,5,0,5,5,0,-5,-5,10,5,-5,10,-5,5,10,5,5,10
} 
PolygonVertexIndex: *36 {
a: 0,2,-4,3,1,-1,4,5,-8,7,6,-5,0,1,-6,5,4,-1,1,3,-8,7,5,-2,3,2,-7,6,7,-4,2,0,-5,4,6,-3
} 
Edges: *18 {
a: 0,1,2,3,4,6,7,8,9,10,13,14,16,19,20,25,26,32
} 
Normals: *108 {
a: 0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,-        1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-   1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
} 

UV: *24 {
a: 0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1
} 
UVIndex: *36 {
a: 9,11,10,10,8,9,8,9,11,11,10,8,4,5,7,7,6,4,0,1,3,3,2,0,4,5,7,7,6,4,0,1,3,3,2,0
} 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

念﹏祤嫣 2024-12-16 06:37:54

我认为这些假设是相当合理的,尽管我不确定
为什么 PolygonVertexIndex 数组包含负值(看起来
每个三角形的每三个索引都是负数)。也许是为了表明
多边形的最后一个索引,因此您可以拥有不需要的多边形
三角形。

具有负值的顶点确实代表最后一个顶点。

要找出女巫顶点,您必须对其取负并从该值中减去 1。

例如,-4 表示 3 ((-4)*(-1) - 1)

I think these assumptions are quite reasonable, though I'm not sure
why the PolygonVertexIndex array contains negative values (it seems
every third index of each triangle is negative). Maybe to indicate the
last index of a polygon, so you can have polygons which need not be
triangles.

The one with the negative value represents the last vertex indeed.

To find out witch vertex this is, you have to negate it and subtract 1 from that value.

For example, -4 represents 3 ((-4)*(-1) - 1)

情魔剑神 2024-12-16 06:37:54

即使不了解 FBX 格式,您至少也可以做出一些非常合理的猜测:

  1. Vertices 下的 24 个值是立方体的 8 个顶点(其中 3 个值代表一个顶点)。< /p>

  2. PolygonVertexIndex 下的 36 个值是构成立方体 6 个面的 12 个三角形的顶点索引(引用 Vertices 中的值)。

  3. Edges 下的 24 个值是立方体 12 条边的顶点索引。

  4. Normals 下的 108 个值是 12 个三角形的每个三角形角的 36 个法线(其中 3 个值代表一个法线向量)。

  5. UV下的24个值是12个纹理坐标(其中2个值代表一对纹理坐标)。

  6. UVIndex 下的 36 个值是立方体 36 个三角形角的纹理坐标索引(引用 UV 中的值)。

我认为这些假设是相当合理的,尽管我不确定为什么 PolygonVertexIndex 数组包含负值(似乎每个三角形的每个第三个索引都是负值)。也许是为了指示多边形的最后一个索引,因此您可以拥有不一定是三角形的多边形。

Even with no knowledge of the FBX format you can at least make some very reasonable guesses:

  1. The 24 values under Vertices are the 8 vertices of the cube (with 3 values representing one vertex).

  2. The 36 values under PolygonVertexIndex are the vertex indices (referencing the values from Vertices) for the 12 triangles making up the 6 faces of the cube.

  3. The 24 values under Edges are the vertex indices of the 12 edges of the cube.

  4. The 108 values under Normals are the 36 normals for each of the triangle corners of the 12 triangles (with 3 values representing one normal vector).

  5. The 24 values under UV are 12 texture coordinates (with 2 values representing one texture coordinate pair).

  6. The 36 values under UVIndex are the texture coordinate indices (referencing the values from UV) for the 36 triangle corners of the cube.

I think these assumptions are quite reasonable, though I'm not sure why the PolygonVertexIndex array contains negative values (it seems every third index of each triangle is negative). Maybe to indicate the last index of a polygon, so you can have polygons which need not be triangles.

帅冕 2024-12-16 06:37:54

负顶点索引表示多边形的末端。您可以对负索引进行按位求反,以获得正索引。

在c中这将是

posIndex = ~negIndex;

The negative vertex index indicates the end of the polygon. You can bitwise negate the negative index, to get the positive one.

In c this would be

posIndex = ~negIndex;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文