Poly Count
#1
How can i get a count of TriangleIndices for a selected model, i can get all details with Ab3d.Utilities.Dumper.GetObjectHierarchyString(shownModel) but i want to get the poly count on its own is this possible ?
#2
Please check the "Basic WPF 3D objects tutorial" - the first sample in the samples in the Ab3d.PowerToys WPF samples project. There the main WPF 3D objects are quickly described.

Quickly describing this here:
To get positions and triangle indices, you need to check the Positions and TriangleIndices of the MeshGeometry3D object. This object is assigned to GeometryModel3D object to the Geometry property. GeometryModel3D objects can be grouped by using Model3DGroup objects (they both derived from Model3D object). Model3D object (GeometryModel3D or Model3DGroup) can be assigned to Content property of the ModelVisual3D object (or ContentVisual3D object). ModelVisual3D objects (and other objects that are derived from Visual3D object) can be grouped by other ModelVisual3D objects in the Children collection.

So when you get your selected object, you need to check what kind of object you have - is it Visual3D or Model3D objects an the go in an opposite direction as described above until you come to MeshGeometry3D.
Andrej Benedik
#3
Thank you that works fine :)
#4
I spoke too soon lol it works fine if the model as no groups but if it as more than 1 group it crashes :(
#5
You will need to check for groups and how many children each group has before accessing the Children collection.
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)