SeriesPointCompactColored3D single point color changed
Posted: Wed May 24, 2023 10:19 am
in View3D PointLineSeries3D,I want change the color of one SeriesPointCompactColored3D in PointLineSeries3D.PointsCompactColored when i click it,I add test code in the demo,but the color not changed unless I resize the window after i click,is it a bug? the code is blow
int the image,the red ball is changed color after i click it and resize the window
Code: Select all
//Add 3D point series
//Spheres
PointLineSeries3D sphereSeries = new PointLineSeries3D(_chart.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary);
sphereSeries.PointStyle.Shape3D = PointShape3D.Sphere;
sphereSeries.PointStyle.Size3D.SetValues(20, 20, 20);
//sphereSeries.Material.DiffuseColor = Colors.Teal;
//sphereSeries.Material.SpecularColor = Colors.Gray;
//sphereSeries.Material.SpecularPower = 20;
//sphereSeries.PointStyle.DetailLevel = 100;
sphereSeries.IndividualPointColors = true;
sphereSeries.AllowUserInteraction = true;
sphereSeries.PointsType = PointsType3D.CompactPointsColor;
sphereSeries.LineVisible = false;
int defaultColor = -2987746;
sphereSeries.PointsCompactColored = new SeriesPointCompactColored3D[] {
new SeriesPointCompactColored3D(50, 50, 50,defaultColor),
new SeriesPointCompactColored3D(30, 50, 20,defaultColor),
new SeriesPointCompactColored3D(80, 50, 80, defaultColor)
};
sphereSeries.MouseClick += SphereSeries_MouseClick;
_chart.View3D.PointLineSeries3D.Add(sphereSeries);
Code: Select all
private void SphereSeries_MouseClick(object sender, System.Windows.Input.MouseEventArgs e)
{
if (sender is PointLineSeries3D compactSeries)
{
int selectColor = -65536;
int hitIndex = compactSeries.LastHitTestIndex;
compactSeries.PointsCompactColored[hitIndex].Color = selectColor;
}
}