I've created 6 planes as a room in JOGL, now I want to texture them each with different images, so how can I do this on each plane? And also how is there any recommended texture image resource that I can use it to decorate the room?
Thank you.
public void render(GL2 gl) {
gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
camera.view(glu); // Orientate the camera
doLight(gl); // Place the light
doLight2(gl);
if (axes.getSwitchedOn())
axes.display(gl, glut);
if (objectsOn) { // Render the objects
gl.glPushMatrix();
//Making the room.
double planeParam = animationScene.getParam(animationScene.PLANE_PARAM);
//red x, blue z, green y.
gl.glTranslated(planeParam,0,0);
//Base
plane.renderDisplayList(gl);
//Back wall
gl.glTranslated(0,25,-25);
gl.glRotated(90, 1, 0, 0);
plane.renderDisplayList(gl);
//Right wall
gl.glTranslated(25,25,0);
gl.glRotated(90, 0, 0, 1);
plane.renderDisplayList(gl);
//Front wall
gl.glTranslated(25,25,0);
gl.glRotated(90, 0, 0, 1);
plane.renderDisplayList(gl);
//Roof
gl.glTranslated(0,25,-25);
gl.glRotated(90, 1, 0, 0);
plane.renderDisplayList(gl);
//Left wall
gl.glTranslated(25,25,0);
gl.glRotated(90, 0, 0, 1);
plane.renderDisplayList(gl);
gl.glPopMatrix();
}