1

I'm programming a 3d viewer with Helixtoolkit sharpdx (WPF). Basically, I add on the scene a stl shape. On this shape, I add some outlines made of LineGeomtryModel3D. At runtime, when I select a model from list, I apply a new Color to the outline:

    private void UpdateColorModels()
    {
        //MAJ des couleurs en fonction du status
        try
        {
        //Surcharge du MainColor si selectionné
            if (IsSelected)
            {
                MainColor = System.Windows.Media.Colors.Yellow;
                Thickness = 2;
                DepthBias = -10000000;
            }

            //Application de la couleur aux éléments visuels
            SharpDX.Color newMainColor = new Color(MainColor.R, MainColor.G, MainColor.B, MainColor.A);

            if (m_Outlines != null)//m_Outlines is List<LineGeometry3DModel>
                foreach (var item in m_Outlines)
                {
                    item.Color = newMainColor;
                    item.DepthBias = DepthBias;
                    item.Thickness = Thickness;
                }
        }
        catch (SharpDXException sdxex)
        {
            Console.WriteLine("SharpDXException:" + sdxex.Message);
        }
    }

Above, you can see the simplified method. It works sometimes and sometimes it doesn't work. I mean that the color is sometimes well refresh on the viewer but sometimes, I have to move the Camera to refresh the color... Is there a way to force a refresh without move moving the camera?

Benjamin
  • 11
  • 1

1 Answers1

0

You can try to use invalidaterenderer method. How many line model do you have?

Lance H
  • 886
  • 1
  • 9
  • 14