Help for GL_TEXTURE_CUBE_MAP

Hi,

Anyone has a tutorial about GL_TEXTURE_CUBE_MAP? Say if I loaded a cube map texture, and I have a box. How can I map the cube texture on the box? I mean, in TEXTURE_2D, we have:


	glBegin(GL_QUADS);
	{
		glTexCoord2d(0.0,0.0),glVertex3f(-5.0, 0.0, 5.0);
		glTexCoord2d(1.0,0.0),glVertex3f(5.0, 0.0, 5.0);
		glTexCoord2d(1.0,1.0),glVertex3f(5.0, 0.0, -5.0);
		glTexCoord2d(0.0,1.0),glVertex3f(-5.0, 0.0, -5.0);
	}

to define the texture coordinate before the vertex coordinate. So how is TEXTURE_CUBE?

you can check out nehe lesson 6 it’s about texture mapping I think It’s what you’re asking for :
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06

I don’t mean TEXTURE_2D. I am doing a cubic mapping and I want to know what GL_TEXTURE_CUBE_MAP real is.

Something like how to assign texture coordinate for cube map. Is there any tutorial?

A cube map is sampled using a direction vector, {x,y,z}, instead of traditional texture coordinates. It’s normally used for approximating ray-tracing algorithms, like reflections and shadowing. I suppose you could texture a cube with it, but it’s really not well suited to surface texturing.

More info: http://en.wikipedia.org/wiki/Reflection_mapping

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.