private static Point3f[] makePoint3fArrayFromPoint3dArray(Point3d[] pPoints) { Point3f[] points3f = new Point3f[pPoints.length]; int i = 0; for (Point3d point3d : pPoints) { points3f[i++] = new Point3f(point3d); } return points3f; } }
/** * Constructor. * @param x the x coordinate * @param y the y coordinate * @param z the z coordinate */ public Node(float x, float y, float z, Color3f c) { this.index = 0; this.location = new Point3f(x,y,z); this.color = c; }
public Point3f[] getPoints3f() { Point3f[] points = new Point3f[flatPoints.length / 3]; for (int i = 0; i < points.length; i++) { points[i] = new Point3f(flatPoints[3 * i], flatPoints[3 * i + 1], flatPoints[3 * i + 2]); } return points; }
/** * Constructor. * @param index the node index * @param x the x coordinate * @param y the y coordinate * @param z the z coordinate */ public Node(int index, float x, float y, float z) { this.index = index; this.location = new Point3f(x,y,z); }
private static Point3f[] makePoint3fArrayFromPoint3dArray(Point3d[] pPoints) { Point3f[] points3f = new Point3f[pPoints.length]; int i = 0; for (Point3d point3d : pPoints) { points3f[i++] = new Point3f(point3d); } return points3f; }
/** * Constructor. * @param x the x coordinate * @param y the y coordinate * @param z the z coordinate */ public Node(float x, float y, float z) { this.index = 0; this.location = new Point3f(x,y,z); }
/** * Constructor. * @param index the node index * @param x the x coordinate * @param y the y coordinate * @param z the z coordinate */ public Node(int index, float x, float y, float z, Color3f c) { this.index = index; this.location = new Point3f(x,y,z); this.color = c; }
Point3f pos = new Point3f( Float.intBitsToFloat( newData[i * stride + posIdx] ) - 0.5f, Float .intBitsToFloat( newData[i * stride + posIdx + 1] ) - 0.5f, Float.intBitsToFloat( newData[i * stride + posIdx + 2] ) - 0.5f );
public static MeshDataHolder createFromVerticesAndStripCounts(Point3d[] vertices, int[] polygonStripCounts) { Point3f[] verticesWithFloats = new Point3f[vertices.length]; for (int i = 0; i < vertices.length; i++) { verticesWithFloats[i] = new Point3f(vertices[i]); } return createFromVerticesAndStripCounts(verticesWithFloats, polygonStripCounts); }
public Point3f getScanPoint3f(int index) { Point3f scanPoint = new Point3f(); getScanPoint(index, scanPoint); return scanPoint; }
public static MeshDataHolder Polygon(ArrayList<Point3d> polygonPoints, int numberOfVertices) { Point3f[] points = new Point3f[numberOfVertices]; for (int i = 0; i < numberOfVertices; i++) { points[i] = new Point3f(polygonPoints.get(i)); } return Polygon(points); }
/** * Constructs a Point3f array from the given coordinate arrays. */ private static Point3f[] constructPoint3f (double[] x, double[] y, double[] z) { int size = x.length; Point3f[] coords = new Point3f[size]; for (int i = 0; i < size; i++) coords[i] = new Point3f(createVector3f(x[i], y[i], z[i])); return coords; }
public VMDMotion() { location = new Point3f(); rotation = new Quat4f(); } public VMDMotion(VMDFile vmdFile, DataInputStreamLittleEndian is) throws IOException {
public static MeshDataHolder createFromVerticesAndStripCounts(Point3d[] vertices, int[] polygonStripCounts) { Point3f[] verticesWithFloats = new Point3f[vertices.length]; for (int i=0; i<vertices.length; i++) { verticesWithFloats[i] = new Point3f(vertices[i]); } return createFromVerticesAndStripCounts(verticesWithFloats, polygonStripCounts); }
/** * Constructs a Point3f array from the given coordinate arrays. */ private static Point3f[] constructPoint3f (double[] x, double[] y, double[] z) { int size = x.length; Point3f[] coords = new Point3f[size]; for (int i = 0; i < size; i++) coords[i] = new Point3f(createVector3f(x[i], y[i], z[i])); return coords; }
private Point3f build3DPoint( Point2f p ) { float z = getHeight( p.x, p.y ); if ( z < minZ ) { minZ = z; } if ( z > maxZ ) { maxZ = z; } return new Point3f( p.x, p.y, z ); }
public Point3f getTranslation() { Matrix4d matrix = this.matrixStack.peek(); Point3f translation = new Point3f(); matrix.transform(translation); return translation; }
protected Point3f getPoint3f(int index, float range) { Point3f p = new Point3f(range, 0.0f, 0.0f); RigidBodyTransform transform = new RigidBodyTransform(); getInterpolatedTransform(index, transform); transform.multiply(getSweepTransform(index)); transform.transform(p); return p; }
public static MeshDataHolder Polygon(ConvexPolygon2d convexPolygon) { Point3f[] points = new Point3f[convexPolygon.getNumberOfVertices()]; for (int i = 0; i < convexPolygon.getNumberOfVertices(); i++) { Point2d vertex = convexPolygon.getVertex(i); points[i] = new Point3f((float) vertex.getX(), (float) vertex.getY(), 0.0f); } return Polygon(points); }
public static Point3f generateRandomPoint3f(Random random, Point3f min, Point3f max) { float x = generateRandomFloatInRange(random, min.getX(), max.getX()); float y = generateRandomFloatInRange(random, min.getY(), max.getY()); float z = generateRandomFloatInRange(random, min.getZ(), max.getZ()); return new Point3f(x, y, z); }