Adrian Hooper

03-20-2009, 04:20 AM

I have a couple of questions.

1. I've rendered a room and one wall I want to have a window. I've created it with GL_QUADS, but how do I now add a window into this wall and make it transparent? Do I have to re-do the wall or can I add something on top?

2. The room is not a simple cube, it is oddly shaped. How can I apply a texture to the floor like this without skewing it? How do I calculate the points for it?

This is the floor:

gl.glBegin(GL.GL_POLYGON);

gl.glColor3f(1.0f*scale_Factor, 1.0f*scale_Factor, 1.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor,-50.0f*scale_Factor,0.0f*scale_Factor);

gl.glVertex3f(75.0f*scale_Factor,-50.0f*scale_Factor,0.0f*scale_Factor);

gl.glVertex3f(75.0f*scale_Factor,-50.0f*scale_Factor,200.0f*scale_Factor);

gl.glVertex3f(-30.0f*scale_Factor, -50.0f*scale_Factor, 200.0f*scale_Factor);

gl.glVertex3f(-30.0f*scale_Factor, -50.0f*scale_Factor, 250.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor, -50.0f*scale_Factor, 250.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor, -50.0f*scale_Factor, 150.0f*scale_Factor);

gl.glVertex3f(-55.0f*scale_Factor, -50.0f*scale_Factor, 150.0f*scale_Factor);

gl.glVertex3f(-55.0f*scale_Factor, -50.0f*scale_Factor, 100.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor, -50.0f*scale_Factor, 100.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor,-50.0f*scale_Factor,0.0f*scale_Factor);

gl.glEnd();

Cheers guys

1. I've rendered a room and one wall I want to have a window. I've created it with GL_QUADS, but how do I now add a window into this wall and make it transparent? Do I have to re-do the wall or can I add something on top?

2. The room is not a simple cube, it is oddly shaped. How can I apply a texture to the floor like this without skewing it? How do I calculate the points for it?

This is the floor:

gl.glBegin(GL.GL_POLYGON);

gl.glColor3f(1.0f*scale_Factor, 1.0f*scale_Factor, 1.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor,-50.0f*scale_Factor,0.0f*scale_Factor);

gl.glVertex3f(75.0f*scale_Factor,-50.0f*scale_Factor,0.0f*scale_Factor);

gl.glVertex3f(75.0f*scale_Factor,-50.0f*scale_Factor,200.0f*scale_Factor);

gl.glVertex3f(-30.0f*scale_Factor, -50.0f*scale_Factor, 200.0f*scale_Factor);

gl.glVertex3f(-30.0f*scale_Factor, -50.0f*scale_Factor, 250.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor, -50.0f*scale_Factor, 250.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor, -50.0f*scale_Factor, 150.0f*scale_Factor);

gl.glVertex3f(-55.0f*scale_Factor, -50.0f*scale_Factor, 150.0f*scale_Factor);

gl.glVertex3f(-55.0f*scale_Factor, -50.0f*scale_Factor, 100.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor, -50.0f*scale_Factor, 100.0f*scale_Factor);

gl.glVertex3f(-75.0f*scale_Factor,-50.0f*scale_Factor,0.0f*scale_Factor);

gl.glEnd();

Cheers guys