Help! What am I doing wrong?
Java code:
vtkPolyData pd = new vtkPolyData();
vtkPoints points = new vtkPoints();
points.InsertNextPoint(0, 0, 0);
points.InsertNextPoint(5, 0, 0);
points.InsertNextPoint(5, 5, 0);
points.InsertNextPoint(0, 5, 0);
points.InsertNextPoint(2.5, 2.5, 0);
vtkDoubleArray da = new vtkDoubleArray();
da.InsertNextValue(0);
da.InsertNextValue(0);
da.InsertNextValue(0);
da.InsertNextValue(0);
da.InsertNextValue(1);
pd.SetPoints(points);
pd.GetPointData().addArray(da);
for (int i = 0; i < points.GetNumberOfPoints(); i++) {
System.out.println(pd.GetScalarFieldCriticalIndex(i, 0));
}
out:
-3
-3
-3
-3
-3