Dynamically Added PlaneVisual3D Material Disappears
#1
Hello!

When I run following code in my application constructor i got my plane material right, I got Label with white text and black background. While my application runs I add dynamically plane by calling same method again and I get only white text, but background on it is transparent? Could someone tell me what im doing wrong?

Code:
PlaneVisual3D myPlane = new PlaneVisual3D();

Label label = new Label();
label.FontSize = 14;

label.Content = "LocalizedText";
label.Foreground = Brushes.White;
label.Background = Brushes.Black;
                    
VisualBrush brush = new VisualBrush();
brush.Visual = label;        
brush.Stretch = Stretch.Uniform;
      
DiffuseMaterial material = new DiffuseMaterial(brush);
                          
myPlane.Material = material;
myPlane.BackMaterial = material;

myPlane.CenterPosition = new Point3D(0.0, 0.0, 0.0);

myPlane.HeightDirection = new Vector3D(0, 1, 0);
myPlane.Normal = new Vector3D(1, 0, 0);

viewport.Children.Add(myPlane);

Hope you get idea!

Best regards
  


Messages In This Thread
Dynamically Added PlaneVisual3D Material Disappears - by curimus - 09-09-2015, 01:26 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)