/** * Hexagon Constructor instantiates a new Hexagon. This element is center on 0,0,0 with all normals pointing up. The * user must move and rotate for positioning. * * @param name * the name of the scene element. This is required for identification and comparision purposes. * @param sideLength * The length of all the sides of the triangles */ public Hexagon(final String name, final float 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(); setIndexData(); setTextureData(); setNormalData(); }
/** * Hexagon Constructor instantiates a new Hexagon. This element is center on 0,0,0 with all normals pointing up. The * user must move and rotate for positioning. * * @param name * the name of the scene element. This is required for identification and comparison purposes. * @param sideLength * The length of all the sides of the triangles */ public Hexagon(final String name, final float 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(); setIndexData(); setTextureData(); setNormalData(); }