bool RenderCubeMap(int texID, float x, float y, float z)
{
int size=128;
glViewport(0,0,size,size);
for(int i=0; i < 6;i++)
{
glClear( GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glRotatef(dirs[i].x, 1.0, 0.0, 0.0);
glRotatef(dirs[i].y, 0.0, 1.0, 0.0);
gluLookAt(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0,-1.0, 0.0);
RenderWorld();
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, texID);
glTexParameterf(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glCopyTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT + i, 0, GL_RGB, 0, 0, size,size, 0);
}
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
ReSizeGLScene(800,600);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
return true;
}
Dynamic Cube Maps
I''m trying to pull off dynamic cube mapping, however using the function below, i''m getting horrible results, infact, nothing is textured correctly. can anyone see what''s the matter?
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
==Colt "MainRoach" McAnlisGraphics Engineer - http://mainroach.blogspot.com
Nutty has a (working)dynamic cube map demo on his site so you could compare this code with his to se what''s wrong.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
I've implimented his method, although he uses his HELIOS lib so it's hard to figure out the inner workings of things.
Anyone else have an idea? i'm still getting horribly wrong results
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
[edited by - duhroach on May 4, 2003 3:50:57 PM]
Anyone else have an idea? i'm still getting horribly wrong results
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
[edited by - duhroach on May 4, 2003 3:50:57 PM]
==Colt "MainRoach" McAnlisGraphics Engineer - http://mainroach.blogspot.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement