/** * Creates an Dodecahedron (think of 12-sided dice) with center at the origin. The length of the sides will be as * specified in sideLength. * * @param name * The name of the octahedron. * @param sideLength * The length of each side of the octahedron. */ public Dodecahedron(final String name, final double sideLength) { super(name); _sideLength = sideLength; // allocate vertices _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(NUM_POINTS)); _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(NUM_POINTS)); _meshData.setTextureBuffer(BufferUtils.createVector2Buffer(NUM_POINTS), 0); _meshData.setIndices(BufferUtils.createIndexBufferData(3 * NUM_TRIS, NUM_POINTS - 1)); setVertexData(); setNormalData(); setTextureData(); setIndexData(); }
/** * Creates an Dodecahedron (think of 12-sided dice) with center at the origin. The length of the sides will be as * specified in sideLength. * * @param name * The name of the octahedron. * @param sideLength * The length of each side of the octahedron. */ public Dodecahedron(final String name, final double sideLength) { super(name); _sideLength = sideLength; // allocate vertices _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(NUM_POINTS)); _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(NUM_POINTS)); _meshData.setTextureBuffer(BufferUtils.createVector2Buffer(NUM_POINTS), 0); _meshData.setIndices(BufferUtils.createIndexBufferData(3 * NUM_TRIS, NUM_POINTS - 1)); setVertexData(); setNormalData(); setTextureData(); setIndexData(); }