Click or drag to resize
AB4D logo

InstancedMeshGeometryVisual3D Methods

The InstancedMeshGeometryVisual3D type exposes the following members.

Methods
 NameDescription
Public methodGenerateModel3DGroup GenerateModel3DGroup converts this InstancedMeshGeometryVisual3D into a WPF's Model3DGroup object with many GeometryModel3D objects (each is created form one InstanceData).
Public methodUpdate Update method updates the data for all instances. It must be called after InstancesData are changed. When only some other instances were changed, it is highly recommended to call Update(Int32, Int32, Boolean) and pass startIndex and count as parameters.
Public methodUpdate(Boolean) Update method updates the data for all instances and provides a parameter to specify if bounding box need to be updated.
Public methodUpdate(Int32, Int32, Boolean) Update method updates instance data specified with startIndex, count parameters and updateBounds. This method can be called after some instance transformations or colors were changed. NOTE: If multiple sections of data are changed, do not call this method multiple times - it is faster to call Update only once.
Public methodUpdateMaterial UpdateMaterial updates the used specular material. It must be called after the SpecularMaterial is changed.
Public methodUseInstanceIdColor After calling UseInstanceIdColor method then the color of each instance is defined by the id (index) of each instance. The addedColor4 is added the id (usually a Color4.Black is used). The lowest 8 bits of the instance id number are written to the blue color, then to the green color, then to the red color and the highest byte (when more the 16M instances) is written to the alpha color (for example, instanceId = 1: RGB: 0x000001; instanceId 257: RGB: 0x000102). The color can be also used when rendering multiple instanced objects to distinguish between them (for example by using different alpha value). To disable using instance id color call UseInstanceObjectColor or UseSingleObjectColor(Color).
Public methodUseInstanceObjectColor UseInstanceObjectColor method can be called after calling the UseSingleObjectColor(Color). This method resets using diffuse color from instances data.
Public methodUseSingleObjectColor When UseSingleObjectColor is called, the specified objectColor is used as diffuse color for all instances. This overrides the color defined in the instances data. When color's alpha value is less than 1, then alpha blending is used. To use instance color after calling UseSingleObjectColor, call the UseInstanceObjectColor method.
Top
Extension Methods
 NameDescription
Public Extension MethodClearDXAttribute Clears the value from DXAttributeType so that IsDXAttributeSet(Visual3D, DXAttributeType) method returns false for that DXAttributeType.
(Defined by Extensions)
Public Extension MethodGetDXAttribute Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then an exception is thrown. Use GetDXAttributeOrDefaultT(Visual3D, DXAttributeType) or GetDXAttributeOrDefaultT(Visual3D, DXAttributeType, T) to prevent throwing exception when the value is not set.
(Defined by Extensions)
Public Extension MethodGetDXAttributeCollection Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object. Returns null when no DXAttributeCollection was attached to the WPF object.
(Defined by Extensions)
Public Extension MethodGetDXAttributeOrDefaultT Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then a default value for the type T is returned.
(Defined by Extensions)
Public Extension MethodGetDXAttributeOrDefaultT Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then the specified defaultValue is returned.
(Defined by Extensions)
Public Extension MethodIsDXAttributeSet Returns true if the specified attributeType was set (result is true even if the value is null).
(Defined by Extensions)
Public Extension MethodSetDXAttribute Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it. The attribute is specified with attributeType and its value. This can be used to annotate WPF's objects with DXEngine's attributes.
(Defined by Extensions)
Top
See Also