谁能帮我解释一下 FBX 格式吗?
我使用记事本++查看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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
具有负值的顶点确实代表最后一个顶点。
要找出女巫顶点,您必须对其取负并从该值中减去 1。
例如,
-4
表示3 ((-4)*(-1) - 1)
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
represents3 ((-4)*(-1) - 1)
即使不了解 FBX 格式,您至少也可以做出一些非常合理的猜测:
Vertices
下的 24 个值是立方体的 8 个顶点(其中 3 个值代表一个顶点)。< /p>PolygonVertexIndex
下的 36 个值是构成立方体 6 个面的 12 个三角形的顶点索引(引用Vertices
中的值)。Edges
下的 24 个值是立方体 12 条边的顶点索引。Normals
下的 108 个值是 12 个三角形的每个三角形角的 36 个法线(其中 3 个值代表一个法线向量)。UV
下的24个值是12个纹理坐标(其中2个值代表一对纹理坐标)。UVIndex
下的 36 个值是立方体 36 个三角形角的纹理坐标索引(引用UV
中的值)。我认为这些假设是相当合理的,尽管我不确定为什么 PolygonVertexIndex 数组包含负值(似乎每个三角形的每个第三个索引都是负值)。也许是为了指示多边形的最后一个索引,因此您可以拥有不一定是三角形的多边形。
Even with no knowledge of the FBX format you can at least make some very reasonable guesses:
The 24 values under
Vertices
are the 8 vertices of the cube (with 3 values representing one vertex).The 36 values under
PolygonVertexIndex
are the vertex indices (referencing the values fromVertices
) for the 12 triangles making up the 6 faces of the cube.The 24 values under
Edges
are the vertex indices of the 12 edges of the cube.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).The 24 values under
UV
are 12 texture coordinates (with 2 values representing one texture coordinate pair).The 36 values under
UVIndex
are the texture coordinate indices (referencing the values fromUV
) 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.负顶点索引表示多边形的末端。您可以对负索引进行按位求反,以获得正索引。
在c中这将是
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