static void Main(string[] args) { ManagedManager manager = new ManagedManager(); ManagedScene scene = new ManagedScene(manager, "test"); if (manager.ImportScene(ref scene, "E:\\u3dmodel\\ttj.FBX\0")) { Console.WriteLine(scene.GetName()); ManagedSceneNode root = scene.GetRootNode(); loopTheNodes(root); } Console.ReadLine(); }
static void loopTheNodes(ManagedSceneNode node) { ManagedMesh lMesh = node.GetMesh(); Console.WriteLine(node.GetName() + ":"); if (lMesh.IsValid) { Console.WriteLine("mesh:" + lMesh.GetName() + " control points count: " + lMesh.GetControlPointCount()); Console.WriteLine("polygon count: " + lMesh.GetPolygonCount()); for (int i = 0; i < lMesh.GetControlPointCount(); i++) { double[] vector4 = lMesh.GetControlPointAt(i); } } int count = node.GetChildCount(); for (int i = 0; i < count; i++) { ManagedSceneNode current = node.GetChild(i); loopTheNodes(current); } }
public ManagedMesh(ManagedSceneNode pNode, string pName) { m_nativeObject = Mesh_Create(pNode.NativeObject, pName); }