[英]Creating a Point or Vertex in FBX SDK
我正在尝试在父节点的给定坐标处创建单个顶点。
# 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答案。 我感谢您的帮助。
顶点或点是由以下内容指定的坐标:
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()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.