0
問題是我傳遞給vtkProperty的RGB值不會生成預期的顏色。例如RGB(146,110,218)標識的slateblue顯示爲白色。爲什麼顯示的顏色不是VTK中的預期顏色?
下面是相關代碼:
vtk.vtkLineSource line = new vtkLineSource();
line.SetPoint1(0.0, 0.0, 0.0);
line.SetPoint2(50, 50, 0.0);
vtkPolyDataMapper mapper = new vtkPolyDataMapper();
mapper.SetInput(line.GetOutput());
vtkActor lineActor = new vtkActor();
lineActor.SetMapper(mapper);
double r = 146.0;
double g = 110.0;
double b = 218.0;
vtkProperty property = new vtkProperty();
property.SetColor(r, g, b);
lineActor.SetProperty(property);
'property.SetColor(146.0,110.0,218.0)來劃分的值;'應該是'property.SetColor(R,G,B );' – Rabbid76