PDA

View Full Version : Skydomes



glfreak
10-22-2008, 04:49 PM
I'm trying to implement a skydome by drawing a sphere and with auto texture generation enabled. I set the texture generation mode to sphere mapping. It looks working but it does not rotate with the scene, so it's static. Is this method conceptually correct? How can I make the skydome looks moving/rotating with scene?

Thanks.

_NK47
10-23-2008, 02:41 AM
the skydome is a model which you can manipulate in any ways with matrices. if instead you want to rotate the texture itself on the model you can do that with matrices as well.

// Textures:
glMatrixMode(GL_TEXTURE);
glRotatef(...);
glScalef(...);
...

// Models:
glMatrixMode(GL_MODELVIEW);
glRotatef(...);
glScalef(...);
...

glfreak
10-23-2008, 08:05 AM
Well yeah but when sphere mapping is enabled, then it's not affected by the way the model is transformed. Can only rotate the texture, but what matrix to use? the inverse of modelview rotation?

Brolingstanz
10-23-2008, 12:26 PM
what sort of effect are you trying to achieve with your skydomes?
Some folks just use cubemaps, btw... trade your hemisphere in for a hemicube.

_NK47
10-24-2008, 02:31 AM
modus: ... trade your hemisphere in for a hemicube.

yes or a pyramid. hemicubes aka skyboxes are very common and require less vertices.

Brolingstanz
10-24-2008, 06:51 AM
true, depends on how much headroom you need. For my pointy head, a pyramid is actually a good fit.

Keith Z. Leonard
10-27-2008, 10:03 AM
If you use shaders, you can implement your sphere map tex gen in the vertex program and use a texture matrix style transform to align the texture.

Probably better would be to just get a hemisphere out of a modeling package and use it. If you are using auxSolidSphere, there's no accounting for performance.

glfreak
10-27-2008, 01:00 PM
I use glu quadrics...the other half is ignored since I'm overwriting it by the ground texture.