xyd.add(newDisp);
/** * Utility method to translate a given mesh using a given translation. * @param input the mesh to translate. Not modified. * @param offsetX translation along the x-axis to apply to the mesh. * @param offsetY translation along the y-axis to apply to the mesh. * @param offsetZ translation along the z-axis to apply to the mesh. * @return the translated mesh. */ public static MeshDataHolder translate(MeshDataHolder input, float offsetX, float offsetY, float offsetZ) { Point3f[] inputVertices = input.getVertices(); TexCoord2f[] texturePoints = input.getTexturePoints(); int[] triangleIndices = input.getTriangleIndices(); Vector3f[] normals = input.getVertexNormals(); Point3f[] outputVertices = new Point3f[inputVertices.length]; for (int i = 0; i < inputVertices.length; i++) { outputVertices[i] = new Point3f(offsetX, offsetY, offsetZ); outputVertices[i].add(inputVertices[i]); } return new MeshDataHolder(outputVertices, texturePoints, triangleIndices, normals); }