I don't want my texture cut!
Posted: Fri Jun 05, 2009 6:16 pm
Hi,
I want to load the texture completely in the terrain, without cutting or repeating it. Since each texture is a country, what I do is:
1) cut a world altitude map for the country region (this creates a small bmp, which is loaded with smgr->addTerrainSceneNode);
1.1) this map has to be scaled to meet the aspect ratio of the country. The scale parameter of addTerrainSceneNode then is:
core::vector3df(ScaleH*dimPais.Width/dimPais.Height, ScaleV, ScaleH),
where dimPais contains the width and height of the altitude map for that country.
2) load the vegetation map for the country (an existing png file for each country);
Some examples:
Honduras (altitude map: 93x51 pixels; vegetation map: 696x386)
Germany (altitude map: 137x116 pixels; vegetation map 1027x872)
I had to use
terr->scaleTexture(1.15f,1.f); // for Honduras
and
terr->scaleTexture(1.062f,1.f); // for Germany
for the textures display correctly (without cutting).
Irrlicht 1.5 still has the 2^n+1 necessary size of the texture (or heightmap)?
Can anyone tell me what is going on, please?
I want to load the texture completely in the terrain, without cutting or repeating it. Since each texture is a country, what I do is:
1) cut a world altitude map for the country region (this creates a small bmp, which is loaded with smgr->addTerrainSceneNode);
1.1) this map has to be scaled to meet the aspect ratio of the country. The scale parameter of addTerrainSceneNode then is:
core::vector3df(ScaleH*dimPais.Width/dimPais.Height, ScaleV, ScaleH),
where dimPais contains the width and height of the altitude map for that country.
2) load the vegetation map for the country (an existing png file for each country);
Some examples:
Honduras (altitude map: 93x51 pixels; vegetation map: 696x386)
Germany (altitude map: 137x116 pixels; vegetation map 1027x872)
I had to use
terr->scaleTexture(1.15f,1.f); // for Honduras
and
terr->scaleTexture(1.062f,1.f); // for Germany
for the textures display correctly (without cutting).
Irrlicht 1.5 still has the 2^n+1 necessary size of the texture (or heightmap)?
Can anyone tell me what is going on, please?