OpenGLModelData(ModelLoader model) {

			VAOID = glGenVertexArrays();
			glBindVertexArray(VAOID);

			glEnableClientState(GL_VERTEX_ARRAY);

			if (!model.normals.isEmpty()) {
				normals = true;
				glEnableClientState(GL_NORMAL_ARRAY);
			} else {
				glDisableClientState(GL_NORMAL_ARRAY);
			}
			if (!model.color.isEmpty()) {
				colors = true;
				glEnableClientState(GL_COLOR_ARRAY);
			} else {
				glDisableClientState(GL_COLOR_ARRAY);
			}
			if (!model.textureCoords.isEmpty() && model.texture != null) {
				textures = true;
				glEnableClientState(GL_TEXTURE_COORD_ARRAY);
			} else {
				glDisableClientState(GL_TEXTURE_COORD_ARRAY);
			}

			FloatBuffer verticesBuffer = model.vertices.toFloatBuffer();
			VBOID = glGenBuffers();
			glBindBuffer(GL_ARRAY_BUFFER, VBOID);
			glBufferData(GL_ARRAY_BUFFER, verticesBuffer, GL_STATIC_DRAW);
			glVertexPointer(3, GL_FLOAT, 0, 0);

			if (normals) {
				FloatBuffer normalsBuffer = model.normals.toFloatBuffer();
				NBOID = glGenBuffers();
				glBindBuffer(GL_ARRAY_BUFFER, NBOID);
				glBufferData(GL_ARRAY_BUFFER, normalsBuffer, GL_STATIC_DRAW);
				glNormalPointer(GL_FLOAT, 0, 0);
			}

			if (colors) {
				ByteBuffer colorBuffer = ByteBuffer.allocateDirect(model.color.size() * 4);
				IntBuffer intBuffer = colorBuffer.asIntBuffer();
				for (int i = 0; i < model.color.size(); i++)
					intBuffer.put(model.color.get(i));
				colorBuffer.rewind();
				CBOID = glGenBuffers();
				glBindBuffer(GL_ARRAY_BUFFER, CBOID);
				glBufferData(GL_ARRAY_BUFFER, colorBuffer, GL_STATIC_DRAW);
				glColorPointer(4, GL_UNSIGNED_BYTE, 0, 0);
			}

			if (textures) {
				glEnable(GL_TEXTURE_2D);
				FloatBuffer textureBuffer = model.textureCoords.toFloatBuffer();
				TBOID = glGenBuffers();
				glBindBuffer(GL_ARRAY_BUFFER, TBOID);
				glBufferData(GL_ARRAY_BUFFER, textureBuffer, GL_STATIC_DRAW);
				glTexCoordPointer(2, GL_FLOAT, 0, 0);
			}

			// Deselect (bind to 0) the VBO
			glBindBuffer(GL_ARRAY_BUFFER, 0);
			// Deselect (bind to 0) the VAO
			glBindVertexArray(0);

			IntBuffer indicesBuffer = model.indices.toIntBuffer();
			VBOIID = glGenBuffers();
			glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, VBOIID);
			glBufferData(GL_ELEMENT_ARRAY_BUFFER, indicesBuffer, GL_STATIC_DRAW);
			glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
		}