gl.glActiveTexture(GL.GL_TEXTURE0);
gl.glClientActiveTexture(GL.GL_TEXTURE0);
/* Texture */
try {
Texture texture = core.getTextureID(gl);
if (texture != null) {
gl.glBindTexture(GL.GL_TEXTURE_2D, texture.getTextureObject());
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// bindTexture(core);
// if (Global.RELATIVETRANSFORM) {
// /* Transform */
// gl.glPushMatrix();
// gl.glTranslatef(hcore.vertexorigin.x, hcore.vertexorigin.y, hcore.vertexorigin.z);
// gl.glScalef(hcore.vertexscale, hcore.vertexscale, hcore.vertexscale);
// }
Point3D vertexarray[] = hcore.vertexarray;
Point2D texcoordarray[] = hcore.texcoordarray;
float heightblendvalue = node.getInterpolationCounter();
Point3D vertex[] = hcore.getInterpolationVertexArray(heightblendvalue); // vertexarray;
int vertex_i = 0;
Point2D texcoord[] = texcoordarray;
int texcoord_i = 0;
/* Initialize texture units */
gl.glActiveTexture(GL.GL_TEXTURE0);
gl.glClientActiveTexture(GL.GL_TEXTURE0);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
gl.glEnable(GL.GL_COLOR_MATERIAL);
gl.glColor4f(1.f, 1.f, 1.f, 1.f);
/* Set second texture only if the user wants multitexturing */
if (Global.cacheUseMultiTexturing) {
gl.glActiveTexture(GL.GL_TEXTURE1);
gl.glClientActiveTexture(GL.GL_TEXTURE1);
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
Texture interpolationtextureID = null;
try {
interpolationtextureID = core.getInterpolationTextureID(gl);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (interpolationtextureID == null) {
blendvalue = 0;
}
else {
gl.glColor4f(blendvalue, blendvalue, blendvalue, 1.f);
gl.glEnable(GL.GL_TEXTURE_2D);
interpolationtextureID.bind();
}
}
else {
blendvalue = 0;
}