/** * Combines the given mesh with the mesh contained in this builder while specifying the color of the given mesh. * @param meshDataHolder the mesh to combine. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color)); }
/** * Rotates, translates, then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param orientation the axis-angle describing the rotation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3DReadOnly offset, AxisAngle orientation, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset, orientation); }
/** * Combines the given mesh with the mesh contained in this builder while specifying the color of the given mesh. * @param meshDataHolder the mesh to combine. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color)); }
/** * Translates then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3d offset, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset); }
/** * Translates then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3DReadOnly offset, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset); }
/** * Rotates, translates, then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param orientation the axis-angle describing the rotation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3d offset, AxisAngle4d orientation, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset, orientation); }
/** * Translates then combines the given mesh with the mesh contained in this builder. * @param meshDataHolder the mesh to translate and combine. Not Modified. * @param offset the translation to apply to the given mesh. Not modified. * @param color color of the given mesh. Color accuracy depends on the color palette in use. */ public void addMesh(MeshDataHolder meshDataHolder, Tuple3f offset, Color color) { meshBuilder.addMesh(setColor(meshDataHolder, color), offset); }
private void addCylinders(JavaFXMeshBuilder meshBuilder) { Point3d cylinderPosition = new Point3d(1.0, 0.0, 0.0); double height = 0.3; double radius = 0.1; meshBuilder.addCylinder(height, radius, cylinderPosition); // meshBuilder.addMesh(MeshDataGenerator.ArcTorus(0.0, 2.0 * Math.PI, 0.3, 0.01, 128)); meshBuilder.addMesh(MeshDataGenerator.Cylinder(radius, height, 64)); }
private void addCones(JavaFXMeshBuilder meshBuilder) { Point3d conePosition = new Point3d(0.4, 0.0, 0.0); double height = 0.3; double radius = 0.1; meshBuilder.addCone(height, radius, conePosition); // meshBuilder.addMesh(MeshDataGenerator.ArcTorus(0.0, 2.0 * Math.PI, 0.3, 0.01, 128)); meshBuilder.addMesh(MeshDataGenerator.Cone(height, radius, 64)); }
/** * Add a 3D line to this builder. * @param x0 x-coordinate of the line start. * @param y0 y-coordinate of the line start. * @param z0 z-coordinate of the line start. * @param xf x-coordinate of the line end. * @param yf y-coordinate of the line end. * @param zf z-coordinate of the line end. * @param lineWidth width of the line. * @param startColor color at the line start. Color accuracy depends on the color palette in use. * @param endColor color at the line end. Color accuracy depends on the color palette in use. */ public void addLine(float x0, float y0, float z0, float xf, float yf, float zf, float lineWidth, Color startColor, Color endColor) { MeshDataHolder lineMeshData = MeshDataGenerator.Line(x0, y0, z0, xf, yf, zf, lineWidth); float expectedDistance = 2.0f * lineWidth * lineWidth; Point3f[] vertices = lineMeshData.getVertices(); TexCoord2f[] texturePoints = lineMeshData.getTexturePoints(); Point3f start = new Point3f(x0, y0, z0); for (int i = 0; i < vertices.length; i++) { if (MathTools.epsilonEquals(vertices[i].distanceSquared(start), expectedDistance, 1.0e-5)) texturePoints[i].set(colorPalette.getTextureLocation(startColor)); else texturePoints[i].set(colorPalette.getTextureLocation(endColor)); } meshBuilder.addMesh(lineMeshData); }
/** * Add a 3D line to this builder. * @param x0 x-coordinate of the line start. * @param y0 y-coordinate of the line start. * @param z0 z-coordinate of the line start. * @param xf x-coordinate of the line end. * @param yf y-coordinate of the line end. * @param zf z-coordinate of the line end. * @param lineWidth width of the line. * @param startColor color at the line start. Color accuracy depends on the color palette in use. * @param endColor color at the line end. Color accuracy depends on the color palette in use. */ public void addLine(float x0, float y0, float z0, float xf, float yf, float zf, float lineWidth, Color startColor, Color endColor) { MeshDataHolder lineMeshData = MeshDataGenerator.Line(x0, y0, z0, xf, yf, zf, lineWidth); Point3D32[] vertices = lineMeshData.getVertices(); TexCoord2f[] texturePoints = lineMeshData.getTexturePoints(); Point3D32 start = new Point3D32(x0, y0, z0); Point3D32 end = new Point3D32(xf, yf, zf); for (int i = 0; i < vertices.length; i++) { if (vertices[i].distanceSquared(start) < vertices[i].distanceSquared(end)) texturePoints[i].set(colorPalette.getTextureLocation(startColor)); else texturePoints[i].set(colorPalette.getTextureLocation(endColor)); } meshBuilder.addMesh(lineMeshData); }