【问题标题】:Creating a Point or Vertex in FBX SDK在 FBX SDK 中创建点或顶点
【发布时间】:2016-05-30 21:57:00
【问题描述】:

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

# 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 答案。感谢您的帮助。

【问题讨论】:

    标签: python fbx autodesk


    【解决方案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()
    

    【讨论】:

      猜你喜欢
      • 2020-03-20
      • 2022-11-23
      • 2011-03-08
      • 1970-01-01
      • 2019-08-08
      • 2012-03-12
      • 1970-01-01
      • 2013-04-25
      • 2013-04-21
      相关资源
      最近更新 更多