GeometryArray ge=(GeometryArray)shape.getGeometry(); double[] cc1=new double[3]; ge.getCoordinate(0, cc1); System.out.println(cc1[0]+" "+cc1[1]+" "+cc1[2]); ge.getCoordinate(1, cc1); System.out.println(cc1[0]+" "+cc1[1]+" "+cc1[2]);
primitiveCoordinates[i] = new Point3d(); geom.getCoordinate(indices[i], primitiveCoordinates[i]);
public void loadSurfaceColorsFromImage(ImagePlus imp) { final GeometryArray ga = (GeometryArray) getGeometry(); if (ga == null) return; if (imp.getType() != ImagePlus.COLOR_RGB) { imp = new Duplicator().run(imp); new StackConverter(imp).convertToRGB(); } final InterpolatedImage ii = new InterpolatedImage(imp); final int N = ga.getValidVertexCount(); final Color3f[] colors = new Color3f[N]; final Calibration cal = imp.getCalibration(); final double pw = cal.pixelWidth; final double ph = cal.pixelHeight; final double pd = cal.pixelDepth; final Point3f coord = new Point3f(); for (int i = 0; i < N; i++) { ga.getCoordinate(i, coord); final int v = (int) Math.round(ii.interpol.get(coord.x / pw, coord.y / ph, coord.z / pd)); colors[i] = new Color3f(((v & 0xff0000) >> 16) / 255f, ((v & 0xff00) >> 8) / 255f, (v & 0xff) / 255f); } ga.setColors(0, colors); changed = true; }
if ((vformat & GeometryArray.BY_REFERENCE) == 0) { closestVertexCoordinates = new Point3d(); geom.getCoordinate(indices[vertexIndex], closestVertexCoordinates);
if ((vformat & GeometryArray.BY_REFERENCE) == 0) { closestVertexCoordinates = new Point3d(); geom.getCoordinate(indices[vertexIndex], closestVertexCoordinates);
primitiveCoordinates[i] = new Point3d(); geom.getCoordinate(indices[i], primitiveCoordinates[i]);
ga.getCoordinate(i, p1); ga.getNormal(i, n1); ga.getCoordinate(i+1, p2); ga.getCoordinate(i+2, p3);