Click or drag to resize
AB4D logo

ModelUtils Methods

The ModelUtils type exposes the following members.

Methods
 NameDescription
Public methodStatic memberCenterAndScaleModel3D CenterAndScaleModel3D method translates and scales the model3D so that its center is at the centerPosition and that it will fit into the Size3D defined by finalSize.
Public methodStatic memberCenterModel3D CenterModel3D method translates the model3D so that its center is at the centerPosition.
Public methodStatic memberChangeBackMaterial ChangeBackMaterial method changes only BackMaterial on all child models of the specified model (Material property is preserved).
Public methodStatic memberChangeMaterial(Model3D, Material, Material) ChangeMaterial method changes Material and BackMaterial on all child models of the specified model.
Public methodStatic memberChangeMaterial(ModelVisual3D, Material, Material) ChangeMaterial method changes Material and BackMaterial on all child models of the specified model.
Public methodStatic memberCombineTransform CombineTransform combines the parent and child Transform3D and returns a new Transform3D or null if the combined transform is null or Identity. The method can accept any parent or child transform (including null).
Public methodStatic memberCopyModel CopyModel returns a new Model3D that is a copy of the originalModel. The copied model contains new Model3DGroup, GeometryModel3D and new Light objects. But the models have the same materials and MeshGeometry3D objects.
Public methodStatic memberFlipNormals Flips normals in all MeshGeometry3D that are defined under rootModel3D.
Public methodStatic memberGetBounds(IListVisual3D, Transform3D, Boolean) GetSceneBounds calculates the bounds of all 3D objects in the rootVisuals after the specified Transform3D has been applied to all positions or all mesh bounds.
Public methodStatic memberGetBounds(Model3D, Transform3D, Boolean) GetSceneBounds calculates the bounds of the rootModel3D with checking all positions (when checkOnlyBounds is false) or all mesh bounds (when checkOnlyBounds is true).
Public methodStatic memberGetBounds(ModelVisual3D, Transform3D, Boolean) GetSceneBounds calculates the bounds of all 3D objects in the rootModelVisual3D after the specified Transform3D has been applied to all positions or all mesh bounds.
Public methodStatic memberGetMaterialDiffuseColor Returns the color of the SolidColorBrush in the first DiffuseMaterial
Public methodStatic memberGetModelTranslationVector3D GetModelTranslationVector3D returns a Vector3D that defines how much the model with modelBounds needs to be translated in order to be positioned at a targetPosition that represents a targetPositionType.
Public methodStatic memberGetPositionedAndScaledModelTransform3D GetPositionedAndScaledModelTransform3D method returns a Transform3DGroup that translates and scales the model3D so that it is positioned according to position and positionType parameters and that it will fit into the Size3D defined by finalSize parameter.
Public methodStatic memberHasAnyLight(Model3D, Boolean) Returns true if the Model3D has any light defined. By default the AmbientLight is excluded.
Public methodStatic memberHasAnyLight(Viewport3D, Boolean) Returns true if the Viewport3D has any light defined. By default the AmbientLight is excluded.
Public methodStatic memberHasAnyLight(Visual3D, Boolean) Returns true if the Visual3D has any light defined. By default the AmbientLight is excluded.
Public methodStatic memberPositionAndScaleModel3D PositionAndScaleModel3D method translates and scales the model3D so that it is positioned according to position and positionType parameters and that it will fit into the Size3D defined by finalSize parameter.
Public methodStatic memberPositionModel3D PositionModel3D method translates the model3D so that it is positioned according to position and positionType parameters.
Public methodStatic memberReplaceMaterial Goes through all models and replaces the materialToFind with newMaterial. When isBackMaterial is set to true, BackMaterial is replaced instead of Material.
Public methodStatic memberScaleModel3D ScaleModel3D method scales the model3D so that it will fit into the Size3D defined by finalSize.
Public methodStatic memberSetMaterialOpacity(Material, Double, Boolean, Boolean) Sets the opacity (or alpha color) of the specified material. The material that is set as argument must not be frozen (it mush be cloned before sending to this method). Inner materials or brushes can be frozen - they will be cloned in this method when preserveFrozenMaterial is false.
Public methodStatic memberSetMaterialOpacity(Model3D, Double, Boolean, Boolean) Goes through all models in the models hierarchy and sets the opacity (or alpha color) in all materials to the specified opacity.
Top
See Also