skydome scenenode
skydome scenenode
can anyone tell me how to correct implement the skydome from 1.1?
I'm not sure what values it's asking me for.
and there is nothing in the api or tutorials.
I'm not sure what values it's asking me for.
and there is nothing in the api or tutorials.
Skydome sceneNode is similar the SkyBox but You just manage 1 texture instead of 6 texures as skyBox.
Use it very simple
1) Get the texure in the net here :http://vterrain.org/Atmosphere/Domes/philo_sky1_2k.jpg
2) Then use the code:
smgr->addSkyDomeSceneNode(driver->getTexture("Your skydome texure path",16,16,1.0f,1.0f);//because the texure is half of Sky and so the SkyDome I make is a half sphere. Good luck!
Use it very simple
1) Get the texure in the net here :http://vterrain.org/Atmosphere/Domes/philo_sky1_2k.jpg
2) Then use the code:
smgr->addSkyDomeSceneNode(driver->getTexture("Your skydome texure path",16,16,1.0f,1.0f);//because the texure is half of Sky and so the SkyDome I make is a half sphere. Good luck!
There's something is fantastic, there's nothing is absolute.
Since I'm the original author of the sky dome function, allow me to elaborate the previous answer:
The four values 16, 16, 1.0f and 1.0f means
1) The entire sky dome (which is a sphere made of of rectangles) is made from 16 rows of rectangles from top to bottom. The rows 8 and 9 are closest to the equator of the sphere, and thus contains the largest of the rectangles consistuting the sphere.
2) Each row consists of 16 rectangles.
Imagine a disco ball (you know, the ones covered with flat rectangular mirrors) seen from inside. Same thing
Here's an example of a sphere consisting of 12 rows with each 20 rectangles. The top is missing here, but in skydome the top it is actually made of of triangles to avoid a hole at the very top of the sky ...
(Actually, the two arguments are reverse compared to my explanation here, but I found it a bit easier this way).
If you want a more smooth sphere increase these numbers. However, you will most likely be satisfied with these.
3) This number (here 1.0f) is how much of the sphere is covered with the texture. This number ranges from 0 to 2. When you choose 1.0, exactly the upper half of the sphere is covered. If you choose, say, 1.2 the texture will go a little below the equator of the sphere. If you choose 2 the texture will cover the entire sphere from top to bottom. Ideally, this should be 1, but sometimes you'd like the horizon to be shown even when you are elevated over the ground plane, and then it is useful to set this number slightly higher. Experiment, and you'll see the difference.
4) This number (here also 1.0f) is how large percentage of the texture is actually used. Sometimes sky textures include some text or other graphics at the bottom, and this number here allows you to skip this without changing the graphics file. Setting this number to, say, 0.9 make the skydome use the upper 90% of the texture, thus skipping the lowermost 10%. Note that this number is independent of the third argument, so you can change this without changing how much of the sphere is covered with texture.
I hope this helps understand the four arguments.
The four values 16, 16, 1.0f and 1.0f means
1) The entire sky dome (which is a sphere made of of rectangles) is made from 16 rows of rectangles from top to bottom. The rows 8 and 9 are closest to the equator of the sphere, and thus contains the largest of the rectangles consistuting the sphere.
2) Each row consists of 16 rectangles.
Imagine a disco ball (you know, the ones covered with flat rectangular mirrors) seen from inside. Same thing
Here's an example of a sphere consisting of 12 rows with each 20 rectangles. The top is missing here, but in skydome the top it is actually made of of triangles to avoid a hole at the very top of the sky ...
(Actually, the two arguments are reverse compared to my explanation here, but I found it a bit easier this way).
If you want a more smooth sphere increase these numbers. However, you will most likely be satisfied with these.
3) This number (here 1.0f) is how much of the sphere is covered with the texture. This number ranges from 0 to 2. When you choose 1.0, exactly the upper half of the sphere is covered. If you choose, say, 1.2 the texture will go a little below the equator of the sphere. If you choose 2 the texture will cover the entire sphere from top to bottom. Ideally, this should be 1, but sometimes you'd like the horizon to be shown even when you are elevated over the ground plane, and then it is useful to set this number slightly higher. Experiment, and you'll see the difference.
4) This number (here also 1.0f) is how large percentage of the texture is actually used. Sometimes sky textures include some text or other graphics at the bottom, and this number here allows you to skip this without changing the graphics file. Setting this number to, say, 0.9 make the skydome use the upper 90% of the texture, thus skipping the lowermost 10%. Note that this number is independent of the third argument, so you can change this without changing how much of the sphere is covered with texture.
I hope this helps understand the four arguments.
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
trivtn,
you forgot a ")" in your code.
alc,
nice skydome implementation.
you forgot a ")" in your code.
Code: Select all
smgr->addSkyDomeSceneNode(driver->getTexture("Your skydome texure path"),16,16,1.0f,1.0f);
alc,
nice skydome implementation.
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
I'll hijack this thread to ask if it's possible to delete the SkyDomeSceneNode.
I have the following code :
Any suggestion? The problem is that when I press Enter, a new sky is added above the previous sky, and this lowers the FPS very much!
I want the previous sky to be deleted and then replaced with a new one.
I have the following code :
Code: Select all
case KEY_RETURN: //change sky
{
if (show_sky== 0)
{
show_sky= 1;
//delete previous sky here , but how ??
// add new sky smgr->addSkyDomeSceneNode(driver->getTexture("data/sky/day/sphere.jpg"),16,16,1.0f,1.0f);
} else {
show_sky= 0;
//delete previous sky here , but how ??
// add new sky smgr->addSkyDomeSceneNode(driver->getTexture("data/sky/day/sphere2.jpg"),16,16,1.0f,1.0f);
}
}
I want the previous sky to be deleted and then replaced with a new one.
Well, if you have only two domes, maybe you just want to hide it (and thus it is not rendered). Otherwise, I believe, you have use the ->remove() function.
In any case, you need to assign the pointer returned by smgr->addSky ... to a variable, say 'sky', like
and then use either
or
In any case, you need to assign the pointer returned by smgr->addSky ... to a variable, say 'sky', like
Code: Select all
ISceneNode *sky = smgr->addSkyDome ...
Code: Select all
sky->remove();
Code: Select all
sky->setVisible(false);
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
This method works in the real world, should also work in a 3D modeling package, but probably isn't the best way because some information is lost during conversion.
- Get a mirrored ball, place it on the ground.
- Take a picture from above
- Open the picture in Gimp, center the image and use the "filters->distorts->polar coordinates" tool to convert from polar coordinates.
- Tidy the image and save
You should end up with something like this
- Get a mirrored ball, place it on the ground.
- Take a picture from above
- Open the picture in Gimp, center the image and use the "filters->distorts->polar coordinates" tool to convert from polar coordinates.
- Tidy the image and save
You should end up with something like this
<saves those tips> the problem is that im trying to recreate a space skydome with the entire sphere being space. found a good starmap that molded around to the sphere nicely at the sites listed above, now to just paint it in, once its done ill post a copy here for anyone else looking for space skydomes