03-07-2018, 12:05 PM
When you change a transformation of a SceneNode, you need to notify all SceneNode parents and all its children about that change.
This is done with the following code:
When you use WPF 3D objects like BoxVisual3D or other Visual3D objects, those notifications are done automatically by the WpfModelVisual3DNode that represents the ModelVisual3D objects in the DXEngine's SceneNode hierarchy.
But when you use SceneNodes directly, you need to notify the "interested" SceneNodes manually. Also when you change a setting in a DXEngine's material you need to notify the SceneNodes that use that material about the material change: NotifySceneNodeChange(SceneNodeDirtyFlags.MaterialChanged)
This is done with the following code:
Code:
// Because our transformation has changed, parent SceneNodes should update their bouding boxes
NotifyAllParentSceneNodesChange(SceneNodeDirtyFlags.ChildBoundsChanged);
// Also notify all child nodes that they need to update the world matrix
NotifyAllChildSceneNodesChange(SceneNodeDirtyFlags.TransformChanged);When you use WPF 3D objects like BoxVisual3D or other Visual3D objects, those notifications are done automatically by the WpfModelVisual3DNode that represents the ModelVisual3D objects in the DXEngine's SceneNode hierarchy.
But when you use SceneNodes directly, you need to notify the "interested" SceneNodes manually. Also when you change a setting in a DXEngine's material you need to notify the SceneNodes that use that material about the material change: NotifySceneNodeChange(SceneNodeDirtyFlags.MaterialChanged)
Andrej Benedik

