使用FBX SDK创建一个点或顶点

4

我正在尝试在父节点的给定坐标处创建一个单独的顶点点。

# create a manager, scene and node
manager = fbx.FbxManager.Create()
scene = fbx.FbxScene.Create(manager, "")
node = fbx.FbxNode.Create(manager, "")

# create a mesh
mesh = fbx.FbxMesh.Create(scene, "")

# How to add a single vertex to the mesh?

# add the mesh attribute to the node
node.AddNodeAttribute(mesh)

# add node to the node tree
root_node = scene.GetRootNode()
root_node.AddChild(node)

# Translate the node to (0, 0, 10)
node.LclTranslation.Set(fbx.FbxDouble3(0, 0, 10))

这不需要是一个特定的Python答案。感谢您的帮助。

1个回答

1
一个顶点或点是由以下坐标指定的:
v = fbx.FbxVector4(x, y, z)

一个顶点本身是不可见的,除非它被作为网格的控制点。
my_mesh = fbx.FbxMesh.Create(my_scene, '')
my_mesh.SetControlPointAt(v, 0)

当存在一组顶点时,0代表该顶点在该组中的“顺序”或“索引”。然后可以绘制一个多边形,它可能代表网格的一侧:

my_mesh.BeginPolygon()
my_mesh.AddPolygon(0)
my_mesh.AddPolygon(n)
...
my_mesh.EndPolygon()

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接