Moving and Efficient creation of SceneNodes
#2
You can change the transformation of SceneNodes with setting the Transform property. After that change, you also need to call NotifySceneNodeChange method on the changed SceneNode.

For example:
Code:
var transformMatrix = Matrix.Scaling(1, _orangePyramidYScale, 1) *
                      Matrix.RotationY(MathUtil.DegreesToRadians(_orangePyramidYRotate)) *
                      Matrix.Translation(0, -_orangePyramidYRotate, 0);

_orangePyramidObjectNode.Transform = new Transformation(ref transformMatrix);

// When the Transform is already set, you can change the matrix by:
//_orangePyramidObjectNode.Transform.SetMatrix(transformMatrix);

_orangePyramidObjectNode.NotifySceneNodeChange(SceneNode.SceneNodeDirtyFlags.TransformChanged);

I have updated the ManuallyCreatedSceneNodes sample with sample code that shows how to change transformation.
You can check the new content of the files on the sample project on GitHub:
https://github.com/ab4d/Ab3d.DXEngine.Wp...Nodes.xaml
https://github.com/ab4d/Ab3d.DXEngine.Wp...es.xaml.cs
Andrej Benedik
  


Messages In This Thread
RE: Moving and Efficient creation of SceneNodes - by abenedik - 06-11-2021, 12:08 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)