|
![](/i/fill.gif) |
> no, a spherical camera won't work (at least, I don't think it will :), you
> will have to make 6 perspective-views.
> I did it once, maybe it's still available online, let me check :)
> It *might* be this: http://sad.studentenweb.org/cg/stad.zip
> But I don't know if it is just the source, or if it is compiled, or whatever
> :-/
I found it in your zip file:
void setSkyBox(GLuint texture,GLfloat helderheid){
glDisable(GL_LIGHTING);
glDisable(GL_CULL_FACE);
glBindTexture(GL_TEXTURE_2D,texture);
gluLookAt
(0.0,0.0,0.0,_lookat.getX()-_locatie.getX(),_lookat.getY()-_locatie.getY(),_lookat.getZ()-_locatie.getZ(),_up.getX(),_up.getY(),_up.getZ());
glColor4f(helderheid*2,helderheid*1.5,helderheid,1.0);
glBegin(GL_QUADS);
// Top
glTexCoord2f(1.0/4.0,1.0/3.0); glVertex3f(-1.0,1.0,-1.0);
glTexCoord2f(0.0/4.0,1.0/3.0); glVertex3f(1.0,1.0,-1.0);
glTexCoord2f(0.0/4.0,2.0/3.0); glVertex3f(1.0,1.0,1.0);
glTexCoord2f(1.0/4.0,2.0/3.0); glVertex3f(-1.0,1.0,1.0);
//Left
glTexCoord2f(1.0/4.0,1.0/3.0); glVertex3f(-1.0,1.0,-1.0);
glTexCoord2f(1.0/4.0,2.0/3.0); glVertex3f(-1.0,1.0,1.0);
glTexCoord2f(2.0/4.0,2.0/3.0); glVertex3f(-1.0,-1.0,1.0);
glTexCoord2f(2.0/4.0,1.0/3.0); glVertex3f(-1.0,-1.0,-1.0);
//Right
glTexCoord2f(4.0/4.0,2.0/3.0); glVertex3f(1.0,1.0,1.0);
glTexCoord2f(4.0/4.0,1.0/3.0); glVertex3f(1.0,1.0,-1.0);
glTexCoord2f(3.0/4.0,1.0/3.0); glVertex3f(1.0,-1.0,-1.0);
glTexCoord2f(3.0/4.0,2.0/3.0); glVertex3f(1.0,-1.0,1.0);
// Far
glTexCoord2f(2.0/4.0,2.0/3.0); glVertex3f(-1.0,-1.0,1.0);
glTexCoord2f(2.0/4.0,3.0/3.0); glVertex3f(-1.0,1.0,1.0);
glTexCoord2f(3.0/4.0,3.0/3.0); glVertex3f(1.0,1.0,1.0);
glTexCoord2f(3.0/4.0,2.0/3.0); glVertex3f(1.0,-1.0,1.0);
// Near
glTexCoord2f(2.0/4.0,1.0/3.0); glVertex3f(-1.0,-1.0,-1.0);
glTexCoord2f(2.0/4.0,0.0/3.0); glVertex3f(-1.0,1.0,-1.0);
glTexCoord2f(3.0/4.0,0.0/3.0); glVertex3f(1.0,1.0,-1.0);
glTexCoord2f(3.0/4.0,1.0/3.0); glVertex3f(1.0,-1.0,-1.0);
//Bottom
glTexCoord2f(2.0/4.0,1.0/3.0); glVertex3f(-1.0,-1.0,-1.0);
glTexCoord2f(3.0/4.0,1.0/3.0); glVertex3f(1.0,-1.0,-1.0);
glTexCoord2f(3.0/4.0,2.0/3.0); glVertex3f(1.0,-1.0,1.0);
glTexCoord2f(2.0/4.0,2.0/3.0); glVertex3f(-1.0,-1.0,1.0);
glEnd();
glColor4f(1.0,1.0,1.0,1.0);
glEnable(GL_LIGHTING);
glEnable(GL_CULL_FACE);
glLoadIdentity();
}
But I don't really understand what texture you used... Did you paste
the six images toghether in one?
Thanks,
Xilo
--
Dedicated to audio/visual and interactive artwork.
http://www.geocities.com/simonlemieux/
Post a reply to this message
|
![](/i/fill.gif) |