I have a big problem, to make a Skybox. I can only see one Side of the Skybox, and I can't see the ground. I'm developing under Linux, and I can test my Homebrews under Linux, because I using GLUT.
This is the result of GLUT:
and here, on the PSP:
you can download the Homebrew here (for FW1.5):
http://rapidshare.com/files/35944807/Test2.rar.html
And the source code of the Skybox:
Code: Select all
void DrawSkybox(GLenum mode, float y, float z, float x, float repeatground) {
glDisable(GL_LIGHTING);
glScalef(y,z,x);
glTranslatef(0.0f, 0.95f, 0.0f);
glBindTexture(GL_TEXTURE_2D, texture[0]); // choose the texture to use.
glBegin(mode);
// Himmel
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, 1.0f,-1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D, texture[6]); // choose the texture to use.
glBegin(mode);
// Boden
glTexCoord2f(repeatground, repeatground); glVertex3f( 1.0f,-1.0f, 1.0f);
glTexCoord2f(repeatground, 0.0f); glVertex3f(-1.0f,-1.0f, 1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-1.0f);
glTexCoord2f(0.0f, repeatground); glVertex3f( 1.0f,-1.0f,-1.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D, texture[5]); // choose the texture to use.
// Hinten
glBegin(mode);
glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 1.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D, texture[3]); // choose the texture to use.
// Vorne
glBegin(mode);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,-1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-1.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D, texture[2]); // choose the texture to use.
// Links
glBegin(mode);
glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,-1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 1.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D, texture[4]); // choose the texture to use.
// Rechts
glBegin(mode);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-1.0f);
glEnd();
glScalef(-(y),-(z),-(x));
glTranslatef(0.0f, -1.0f, 0.0f);
glEnable(GL_LIGHTING);
}
Here is the complete sourcecode:
http://rapidshare.com/files/35946120/Test2.rar.html
Please help me :'(
Sorry for my bad english...
Ercan