I'm using HelixToolkit to import a model and display it.
Now I want to take one of the objects of the model and rotate it.
Unfortunately I can't find a way to edit the scene the importer gives me.
var imp = new HelixToolkit.SharpDX.Core.Assimp.Importer();
var scene = imp.Load(".\\test.obj");
foreach (var node in scene.Root.Traverse().ToList())
{
if (node.Name.Contains("gate"))
{
node.RemoveSelf(); // remove from scene to be able to add to group
var mg = new SceneNodeGroupModel3D();
mg.AddNode(node);
mg.Transform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1,0,0), 45 ));
// could not find a way to add the group back
}
}
this.ModelGroup.AddNode(scene.Root); // That's the SceneNodeGroupModel3D that is bound to the Viewport3DX for displaying
While I can remove the object and add it to the rotation group I can't add it back to the scene.
The SceneNodeGroupModel3D
s Parent property is not settable and a SceneNode
also has no way to add children to it.
So How does scene editing work with HelixToolkit"?