简体   繁体   English

在FBX SDK中创建点或顶点

[英]Creating a Point or Vertex in FBX SDK

I'm trying to create a single vertex point at a given coordinate of a parent node. 我正在尝试在父节点的给定坐标处创建单个顶点。

# 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))

This doesn't have to be a specific python answer. 这不一定是特定的python答案。 I appreciate your help. 我感谢您的帮助。

A vertex or point is a coordinate specified by the following: 顶点或点是由以下内容指定的坐标:

v = fbx.FbxVector4(x, y, z)

A vertex itself isn't visible unless it is made a control point to a mesh. 除非将顶点作为网格的控制点,否则顶点本身不可见。

my_mesh = fbx.FbxMesh.Create(my_scene, '')
my_mesh.SetControlPointAt(v, 0)

Where 0 is the "order" or "index" of the vertex in a group of vertices (if there is one). 其中0是一组顶点中顶点的“顺序”或“索引”(如果有的话)。 Then a polygon which may represents a side of the mesh may be drawn: 然后可以绘制可以表示网格一侧的多边形:

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

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

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