- Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
- at java.nio.HeapIntBuffer.<init>(HeapIntBuffer.java:39)
- at java.nio.IntBuffer.allocate(IntBuffer.java:312)
- at com.sonogenics.model.ModelRenderer.<init>
- -ea -server -Djava.library.path="../deploy64" -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=True -Xmx1024m -Xms1024m -Xloggc:ClientGC.log -XX:+UseConcMarkSweepGC -XX:MaxNewSize=8M -XX:MaxDirectMemorySize=2056M -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.ssl=false
- public abstract class AbstractModelHandler
- {
- protected static final String MODEL_PATH = "assets/models/";
- private final int activePointer = 1;
- private boolean initialised;
- protected boolean loaded;
- protected AbstractModel model;
- private final String modelName;
- protected final List<ModelRenderer> renderers;
- private final HashMap<String, Integer> textureMap = new HashMap<String, Integer>();
- public AbstractModelHandler(final String modelName)
- {
- this.renderers = new ArrayList<ModelRenderer>();
- this.modelName = modelName;
- this.loaded = false;
- this.initialised = false;
- }
- public abstract void addModelInstance(final double tx, final double ty, final double tz, final double rx,
- final double ry, final double rz, final double sx, final double sy, final double sz, final Color color);
- public void augmentModel(final int index, final double tx, final double ty, final double tz, final double rx,
- final double ry, final double rz, final double sx, final double sy, final double sz)
- {
- if (getInstanceForIndex(index) != null)
- {
- if (sx != 0 || sy != 0 || sz != 0)
- {
- augmentModelScale(index, sx, sy, sz);
- }
- if (tx != 0 || ty != 0 || tz != 0)
- {
- augmentModelTranslation(index, tx, ty, tz);
- }
- if (rx != 0 || ry != 0 || rz != 0)
- {
- augmentModelRotation(index, rx, ry, rz);
- }
- }
- }
- public void augmentModelRotation(final int index, final double rx, final double ry, final double rz)
- {
- final Matrix4d augmentation = new Matrix4d();
- augmentation.setIdentity();
- createRotationMatrix(augmentation, rx, ry, rz);
- getInstanceForIndex(index).getTransform().getRotation().mul(augmentation);
- }
- public void augmentModelScale(final int index, final double sx, final double sy, final double sz)
- {
- final Matrix4d augmentation = new Matrix4d();
- augmentation.setIdentity();
- createScaleMatrix(augmentation, sx, sy, sz);
- getInstanceForIndex(index).getTransform().getScale().mul(augmentation);
- }
- public void augmentModelTranslation(final int index, final double tx, final double ty, final double tz)
- {
- final Matrix4d augmentation = new Matrix4d();
- augmentation.setIdentity();
- createTranslationMatrix(augmentation, tx, ty, tz);
- getInstanceForIndex(index).getTransform().getTranslation().mul(augmentation);
- }
- public void clear()
- {
- for (final ModelRenderer renderer : renderers)
- {
- renderer.getModelInstances().clear();
- }
- }
- protected void createRotationMatrix(final Matrix4d transform, final double rotX, final double rotY,
- final double rotZ)
- {
- transform.setIdentity();
- final Matrix4d temp = new Matrix4d();
- temp.rotX(rotX);
- transform.mul(temp);
- temp.rotY(rotY);
- transform.mul(temp);
- temp.rotZ(rotZ);
- transform.mul(temp);
- }
- protected void createScaleMatrix(final Matrix4d transform, final double scaleX, final double scaleY,
- final double scaleZ)
- {
- transform.setIdentity();
- transform.m00 = scaleX;
- transform.m11 = scaleY;
- transform.m22 = scaleZ;
- }
- protected void createTranslationMatrix(final Matrix4d transform, final double tx, final double ty, final double tz)
- {
- transform.setIdentity();
- transform.m03 = tx;
- transform.m13 = ty;
- transform.m23 = tz;
- }
- public AbstractModelInstance getInstance(final int index)
- {
- return getInstanceForIndex(index);
- }
- public AbstractModelInstance getInstanceForIndex(final int index)
- {
- if (!renderers.isEmpty())
- {
- final int numRenderers = renderers.size();
- if (numRenderers > 1)
- {
- return renderers.get(index).getModelInstances().get(0);
- }
- else
- {
- return renderers.get(0).getModelInstances().get(index);
- }
- }
- else
- {
- return null;
- }
- }
- public AbstractModel getModel()
- {
- return this.model;
- }
- public float getModelWidth()
- {
- return this.model.getWidth();
- }
- public abstract int getNumInstances();
- public List<ModelRenderer> getRenderers()
- {
- return this.renderers;
- }
- public void init(final GL gl)
- {
- for (final ModelRenderer renderer : renderers)
- {
- renderer.init(gl);
- }
- initialised = true;
- }
- public void initTextures(final GLContext context)
- {
- if (model.usesTextures())
- {
- for (int i = 0; i < model.getMaterials().size(); ++i)
- {
- final String textureName = model.getMaterials().get(i).textureName;
- if (textureName == null)
- return;
- final FileTexture textureGenerator = new FileTexture(this.getClass().getResourceAsStream(textureName),
- true, false, context);
- final int textureId = textureGenerator.getTextureId();
- textureMap.put(model.getMaterials().get(i).matName, textureId);
- System.out.println("Generating texture from: '" + textureName + "' ["
- + model.getMaterials().get(i).matName + "(" + textureId + ")]");
- context.getGL().glActiveTexture(GL.GL_TEXTURE0 + i);
- context.getGL().glBindTexture(GL.GL_TEXTURE_2D, textureId);
- context.getGL().glClientActiveTexture(GL.GL_TEXTURE0 + activePointer);
- }
- }
- }
- public boolean isEmpty()
- {
- boolean isEmpty = true;
- for (final ModelRenderer renderer : renderers)
- {
- isEmpty = renderer.isEmpty();
- }
- return isEmpty;
- }
- public boolean isEnabled(final int index)
- {
- if (getNumInstances() < index || getNumInstances() == 0)
- return false;
- else
- return getInstanceForIndex(index).isEnabled();
- }
- public boolean isInitialised()
- {
- return this.initialised;
- }
- public abstract boolean isMutable();
- public void render(final GL gl, final SimpleProjection projection, final float disparityTop,
- final float disparityBottom, final float disparityBlend, final Field field)
- {
- for (int i = 0; i < renderers.size(); ++i)
- {
- final ModelRenderer renderer = renderers.get(i);
- if (renderer != null && isInitialised() && projection != null && isEnabled(i))
- {
- renderer.display(gl, projection, disparityTop, disparityBottom, disparityBlend, field);
- }
- }
- }
- public void setEnabled(final int index, final boolean enabled)
- {
- if (isEnabled(index) != enabled)
- {
- getInstanceForIndex(index).setEnabled(enabled);
- }
- }
- public void setModelRotation(final int index, final double rx, final double ry, final double rz)
- {
- createRotationMatrix(getInstanceForIndex(index).getTransform().getRotation(), rx, ry, rz);
- }
- public void setModelScale(final int index, final double scale)
- {
- createScaleMatrix(getInstanceForIndex(index).getTransform().getScale(), scale, scale, scale);
- }
- public void setModelScale(final int index, final double sx, final double sy, final double sz)
- {
- createScaleMatrix(getInstanceForIndex(index).getTransform().getScale(), sx, sy, sz);
- }
- public void setModelTranslation(final int index, final double tx, final double ty, final double tz)
- {
- createTranslationMatrix(getInstanceForIndex(index).getTransform().getTranslation(), tx, ty, tz);
- }
- public void updateVertices(final int index)
- {
- renderers.get(renderers.size() > 1 ? index : 0).updateVertices();
- }
- }
- public class ModelRenderer implements ModelRendererInterface
- {
- private boolean requiresRedraw = true;
- private final int currentGlComparison = GL.GL_LESS;
- private final FloatBuffer vertices;
- private final FloatBuffer normals;
- private final FloatBuffer colors;
- private final FloatBuffer texCoords;
- private final IntBuffer indices;
- private final int[] bufferObjects;
- private boolean packed;
- private final ModelData modelData;
- private final ArrayList<AbstractModelInstance> modelInstances;
- private boolean initialisedRenderer;
- private PlayoutShaderProgram layerTextureShader;
- public ModelRenderer(final ModelData modelData)
- {
- this.modelData = modelData;
- this.modelInstances = new ArrayList<AbstractModelInstance>();
- this.initialisedRenderer = false;
- final int maxVertices = 1000000;
- vertices = FloatBuffer.allocate(maxVertices * 3);
- normals = FloatBuffer.allocate(maxVertices * 3);
- texCoords = FloatBuffer.allocate(maxVertices * 2);
- colors = FloatBuffer.allocate(maxVertices * 4);
- indices = IntBuffer.allocate(maxVertices * 6);
- bufferObjects = new int[5];
- populateBuffers();
- }
- public List<AbstractModelInstance> getModelInstances()
- {
- return this.modelInstances;
- }
- private void addTriangle(final int vertex1, final int vertex2, final int vertex3)
- {
- indices.put(vertex1);
- indices.put(vertex2);
- indices.put(vertex3);
- }
- public void addModelInstance(final AbstractModelInstance modelInstance)
- {
- this.modelInstances.add(modelInstance);
- }
- private int addVertex(final float x, final float y, final float z, final float tx, final float ty, final float nx,
- final float ny, final float nz, final Color color)
- {
- if (texCoords.position() < texCoords.limit())
- {
- vertices.put(x);
- vertices.put(y);
- vertices.put(z);
- colors.put(color.getRed() / 255.0f);
- colors.put(color.getGreen() / 255.0f);
- colors.put(color.getBlue() / 255.0f);
- colors.put(color.getAlpha() / 255.0f);
- texCoords.put(tx);
- texCoords.put(ty);
- normals.put(nx);
- normals.put(ny);
- normals.put(nz);
- return (texCoords.position() >> 1) - 1;
- }
- else
- {
- throw new FMEERuntimeException("Too many vertices");
- }
- }
- private void clear()
- {
- vertices.clear();
- normals.clear();
- colors.clear();
- indices.clear();
- texCoords.clear();
- packed = false;
- }
- private void display(final GL gl)
- {
- gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getVertexBufferObject());
- gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
- gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getNormalsBufferObject());
- gl.glNormalPointer(GL.GL_FLOAT, 0, 0);
- gl.glEnableClientState(GL.GL_COLOR_ARRAY);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getColorBufferObject());
- gl.glColorPointer(4, GL.GL_FLOAT, 0, 0);
- gl.glClientActiveTexture(GL.GL_TEXTURE0);
- gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getTexCoordBufferObject());
- gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);
- gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, getIndicesBufferObject());
- final int count = getNoOfIndices();
- gl.glDrawElements(GL.GL_TRIANGLES, count, GL.GL_UNSIGNED_INT, 0);
- gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
- gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
- gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
- gl.glDisableClientState(GL.GL_COLOR_ARRAY);
- gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
- }
- @Override
- public void display(final GL gl, final SimpleProjection projection, final float disparityTop,
- final float disparityBottom, final float disparityBlend, final Field field)
- {
- if (!this.initialisedRenderer)
- {
- init(gl);
- }
- if (this.initialisedRenderer)
- {
- if (requiresRedraw)
- {
- clear();
- populateBuffers();
- pack();
- requiresRedraw = false;
- final int usage = GL.GL_STATIC_DRAW;
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getVertexBufferObject());
- gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 3 * 4, getVertices(), usage);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getNormalsBufferObject());
- gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfNormals() * 3 * 4, getNormals(), usage);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getTexCoordBufferObject());
- gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 2 * 4, getTexCoords(), usage);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, getIndicesBufferObject());
- gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, getNoOfIndices() * 4, getIndices(), usage);
- gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, getColorBufferObject());
- gl.glBufferData(GL.GL_ARRAY_BUFFER, getNoOfVertices() * 4 * 4, getColors(), usage);
- gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
- }
- gl.glDepthFunc(currentGlComparison);
- gl.glEnable(GL.GL_TEXTURE_2D);
- gl.glActiveTexture(GL.GL_TEXTURE0);
- for (int i = 0; i < modelInstances.size(); ++i)
- {
- if (modelInstances.get(i).isEnabled())
- {
- layerTextureShader.updateShader(gl, projection, disparityTop, disparityBottom, disparityBlend,
- field, modelInstances.get(i).getTransform().getRotation(),
- modelInstances.get(i).getTransform().getScale(),
- modelInstances.get(i).getTransform().getTranslation(), modelInstances.get(i).getKeyColor());
- layerTextureShader.use(gl);
- display(gl);
- layerTextureShader.release(gl);
- }
- }
- gl.glDisable(GL.GL_TEXTURE_2D);
- }
- }
- private int getColorBufferObject()
- {
- return bufferObjects[1];
- }
- private FloatBuffer getColors()
- {
- pack();
- return colors;
- }
- private IntBuffer getIndices()
- {
- pack();
- return indices;
- }
- private int getIndicesBufferObject()
- {
- return bufferObjects[2];
- }
- private int getNoOfIndices()
- {
- pack();
- return indices.limit();
- }
- private int getNoOfNormals()
- {
- pack();
- return normals.limit();
- }
- private int getNoOfVertices()
- {
- pack();
- return vertices.limit() / 3;
- }
- private FloatBuffer getNormals()
- {
- pack();
- return normals;
- }
- private int getNormalsBufferObject()
- {
- return bufferObjects[4];
- }
- private int getTexCoordBufferObject()
- {
- return bufferObjects[3];
- }
- private FloatBuffer getTexCoords()
- {
- pack();
- return texCoords;
- }
- private int getVertexBufferObject()
- {
- return bufferObjects[0];
- }
- private FloatBuffer getVertices()
- {
- pack();
- return vertices;
- }
- public void init(final GL gl)
- {
- gl.glGenBuffers(5, bufferObjects, 0);
- try
- {
- layerTextureShader = new PlayoutShaderProgram(gl, getClass().getResourceAsStream("modelVertex.glsl"),
- getClass().getResourceAsStream("modelFrag.glsl"));
- }
- catch (final IOException e)
- {
- ErrorReporter.error(this, "Failed to create shader", e.getMessage(), e, ErrorHandler.CONTINUE_APPLICATION);
- }
- this.initialisedRenderer = true;
- }
- public boolean isEmpty()
- {
- pack();
- return vertices.limit() == 0;
- }
- private void pack()
- {
- if (!packed)
- {
- indices.flip();
- vertices.flip();
- colors.flip();
- texCoords.flip();
- normals.flip();
- packed = true;
- }
- }
- @SuppressWarnings("unused")
- public void populateBuffers()
- {
- final List<float[]> vertices = modelData.getVertices();
- final List<int[]> faceAnchors = modelData.getFaces();
- final List<float[]> colors = modelData.getColors();
- final List<float[]> vertexTextures = modelData.getVertexTextures();
- final List<int[]> faceTextures = modelData.getFacesTextures();
- final List<String> textures = modelData.getFaceMaterial();
- final List<float[]> normals = modelData.getVertexNormals();
- final List<int[]> faceNormalAnchors = modelData.getFacesNormals();
- for (int i = 0; i < faceAnchors.size(); ++i)
- {
- if (faceAnchors.get(i).length >= 4)
- {
- final int index1 = faceAnchors.get(i)[0] - 1;
- final int index2 = faceAnchors.get(i)[1] - 1;
- final int index3 = faceAnchors.get(i)[2] - 1;
- final int index4 = faceAnchors.get(i)[3] - 1;
- final Tuple3f v1 = new Vector3f(vertices.get(index1)[0], vertices.get(index1)[1],
- vertices.get(index1)[2]);
- final Tuple3f v2 = new Vector3f(vertices.get(index2)[0], vertices.get(index2)[1],
- vertices.get(index2)[2]);
- final Tuple3f v3 = new Vector3f(vertices.get(index3)[0], vertices.get(index3)[1],
- vertices.get(index3)[2]);
- final Tuple3f v4 = new Vector3f(vertices.get(index4)[0], vertices.get(index4)[1],
- vertices.get(index4)[2]);
- final Tuple3f n1;
- final Tuple3f n2;
- final Tuple3f n3;
- final Tuple3f n4;
- if (!normals.isEmpty() && normals != null && normals.get(index1) != null && normals.get(index2) != null
- && normals.get(index3) != null && normals.get(index4) != null)
- {
- final int nIndex1;
- final int nIndex2;
- final int nIndex3;
- final int nIndex4;
- if (faceNormalAnchors.isEmpty() || faceNormalAnchors.get(i)[0] == -1)
- {
- nIndex1 = faceNormalAnchors.get(i)[0] - 1;
- nIndex2 = faceNormalAnchors.get(i)[1] - 1;
- nIndex3 = faceNormalAnchors.get(i)[2] - 1;
- nIndex4 = faceNormalAnchors.get(i)[3] - 1;
- }
- else
- {
- nIndex1 = index1;
- nIndex2 = index2;
- nIndex3 = index3;
- nIndex4 = index4;
- }
- n1 = new Vector3f(normals.get(nIndex1)[0], normals.get(nIndex1)[1], normals.get(nIndex1)[2]);
- n2 = new Vector3f(normals.get(nIndex2)[0], normals.get(nIndex2)[1], normals.get(nIndex2)[2]);
- n3 = new Vector3f(normals.get(nIndex3)[0], normals.get(nIndex3)[1], normals.get(nIndex3)[2]);
- n4 = new Vector3f(normals.get(nIndex4)[0], normals.get(nIndex4)[1], normals.get(nIndex4)[2]);
- }
- else
- {
- System.err.println("Something has gone seriously wrong, no normals have been found");
- n1 = new Vector3f(0, 0, 0);
- n2 = new Vector3f(0, 0, 0);
- n3 = new Vector3f(0, 0, 0);
- n4 = new Vector3f(0, 0, 0);
- }
- // if (model.usesTextures())
- // {
- // final int texIndex1 = faceTextures.get(i)[0] - 1;
- // final int texIndex2 = faceTextures.get(i)[1] - 1;
- // final int texIndex3 = faceTextures.get(i)[2] - 1;
- // final int texIndex4 = faceTextures.get(i)[3] - 1;
- //
- // final float texCoord1x = vertexTextures.get(texIndex1)[0];
- // final float texCoord1y = vertexTextures.get(texIndex1)[1];
- // final float texCoord2x = vertexTextures.get(texIndex2)[0];
- // final float texCoord2y = vertexTextures.get(texIndex2)[1];
- // final float texCoord3x = vertexTextures.get(texIndex3)[0];
- // final float texCoord3y = vertexTextures.get(texIndex3)[1];
- // final float texCoord4x = vertexTextures.get(texIndex4)[0];
- // final float texCoord4y = vertexTextures.get(texIndex4)[1];
- // projectQuad(v1, v2, v3, v4, texCoord1x, texCoord1y, texCoord2x, texCoord2y, texCoord3x,
- // texCoord3y, texCoord4x, texCoord4y, n1, n2, n3, n4, new Color(colors.get(i)[0],
- // colors.get(i)[1], colors.get(i)[2], colors.get(i)[3]));
- // }
- // else
- // {
- projectQuad(v1, v2, v3, v4, n1, n2, n3, n4, new Color(colors.get(i)[0], colors.get(i)[1],
- colors.get(i)[2], colors.get(i)[3]));
- // }
- }
- else if (faceAnchors.get(i).length == 3)
- {
- final int index1 = faceAnchors.get(i)[0] - 1;
- final int index2 = faceAnchors.get(i)[1] - 1;
- final int index3 = faceAnchors.get(i)[2] - 1;
- final Tuple3f v1 = new Vector3f(vertices.get(index1)[0], vertices.get(index1)[1],
- vertices.get(index1)[2]);
- final Tuple3f v2 = new Vector3f(vertices.get(index2)[0], vertices.get(index2)[1],
- vertices.get(index2)[2]);
- final Tuple3f v3 = new Vector3f(vertices.get(index3)[0], vertices.get(index3)[1],
- vertices.get(index3)[2]);
- final Tuple3f n1 = new Vector3f(normals.get(index1)[0], normals.get(index1)[1], normals.get(index1)[2]);
- final Tuple3f n2 = new Vector3f(normals.get(index2)[0], normals.get(index2)[1], normals.get(index2)[2]);
- final Tuple3f n3 = new Vector3f(normals.get(index3)[0], normals.get(index3)[1], normals.get(index3)[2]);
- projectTriangle(v1, v2, v3, n1, n2, n3, new Color(colors.get(i)[0], colors.get(i)[1], colors.get(i)[2],
- colors.get(i)[3]));
- }
- else
- {
- System.out.println("Number of faces: " + faceAnchors.get(i).length);
- }
- }
- }
- private synchronized void projectQuad(final Tuple3f point1, final Tuple3f point2, final Tuple3f point3,
- final Tuple3f point4, final Tuple3f nPoint1, final Tuple3f nPoint2, final Tuple3f nPoint3,
- final Tuple3f nPoint4, final Color color)
- {
- final int vertex1 = addVertex(point1.getX(), point1.getY(), point1.getZ(), 0f, 0f, nPoint1.getX(),
- nPoint1.getY(), nPoint1.getZ(), color);
- final int vertex2 = addVertex(point2.getX(), point2.getY(), point2.getZ(), 0f, 1f, nPoint2.getX(),
- nPoint2.getY(), nPoint2.getZ(), color);
- final int vertex3 = addVertex(point3.getX(), point3.getY(), point3.getZ(), 1f, 1f, nPoint3.getX(),
- nPoint3.getY(), nPoint3.getZ(), color);
- final int vertex4 = addVertex(point4.getX(), point4.getY(), point4.getZ(), 1f, 0f, nPoint4.getX(),
- nPoint4.getY(), nPoint4.getZ(), color);
- addTriangle(vertex1, vertex2, vertex4);
- addTriangle(vertex2, vertex3, vertex4);
- }
- private synchronized void projectTriangle(final Tuple3f point1, final Tuple3f point2, final Tuple3f point3,
- final Tuple3f nPoint1, final Tuple3f nPoint2, final Tuple3f nPoint3, final Color color)
- {
- final int vertex1 = addVertex(point1.getX(), point1.getY(), point1.getZ(), 0f, 0f, nPoint1.getX(),
- nPoint1.getY(), nPoint1.getZ(), color);
- final int vertex2 = addVertex(point2.getX(), point2.getY(), point2.getZ(), 0f, 1f, nPoint2.getX(),
- nPoint2.getY(), nPoint2.getZ(), color);
- final int vertex3 = addVertex(point3.getX(), point3.getY(), point3.getZ(), 1f, 1f, nPoint3.getX(),
- nPoint3.getY(), nPoint3.getZ(), color);
- addTriangle(vertex1, vertex2, vertex3);
- }
- @Override
- public void updateVertices()
- {
- requiresRedraw = true;
- }
- }