clear viewport in wpf -


I am creating a model and adding it to my viewport and it works properly without any problems is.

this.mainViewport.Children.Add (model);

Whenever I use the following code, the cube becomes black instead of its original color.

this .mainViewport.Children.Clear (); This.mainViewport.Children.Children.Add (model);

I need to clean the viewport because I am adding the cube to second place in the next. Any suggestion to solve that problem would be highly appreciated.

I will do something like this instead: start the cube in the first place:

  ModelVace 3D model = new modelWas 3D (); Model Content = cube;   

Then I will change the new location in the timer:

  Model. Transaction = New Translation Transform 3D (X, Y, Z);   

Other available transorms are:

  1. ScaleTransform3D

  2. Rotate Transform 3D

  3. Matrix Transform 3D

  4. Transform 3D Group

Comments