Hello, I do not speak well English.
Much sorry .
16 images
Width 4 / Length 4
Want to sort.
16 images accomplish one map.
Want to appear on screen so.
16 image sizes are same all. [256 / 256]
Want to understand method.
Ask counsel.
Application method of addTerrainSceneNode
I m afraid i have not understand you problem ...
it seem you want make an image from 16 little images?
if yes here some point
1) Generate buffers:
1 for the 16 little images
1 fro the main image
2) Load the tile image into1 buffer ( createImageFromFile(...) )
3) copy the little tiles image into the main image buffer
something like this :
while( TileSrcheight > 0 ){
memcpy(&u4DestImage[iMosaicPos], &u4SrcImg[iPos], ( TileSrcWidth *4)); //Add an entire line of pixwels * color bytes (the image color format)
iPos += (TileSrcWidth );
iMosaicPos += (iDestwidth ) ; //Next Pixeel Row
TileSrcheight --;
}
repeat point 2),3) for every 16 tile images
4) tranform the image buffer nto an Iimage
DrwImgArr = driver->createImageFromData( format ,dimension2d<s32>(Imagewidth, Imageheigh ),u4FullImage,true );
5) generate texture from the image
TeturImgArr = driver->addTexture("ImageBuff", DrwImgArr);
6) add texture to an iGuiImage
UsrImgArr->setImage( TeturImgArr );
(
IGUIImage * UsrImgArr;
UsrImgArr = guienv->addImage(rect<s32>( 0 ,0 , Imagewidth, Imageheigh ));
IImage * DrwImgArr;
ITexture* TeturImgArr;
)
may be there i s a easier way using irrlicht favcilities
but i dont know.
Bye
it seem you want make an image from 16 little images?
if yes here some point
1) Generate buffers:
1 for the 16 little images
1 fro the main image
2) Load the tile image into1 buffer ( createImageFromFile(...) )
3) copy the little tiles image into the main image buffer
something like this :
while( TileSrcheight > 0 ){
memcpy(&u4DestImage[iMosaicPos], &u4SrcImg[iPos], ( TileSrcWidth *4)); //Add an entire line of pixwels * color bytes (the image color format)
iPos += (TileSrcWidth );
iMosaicPos += (iDestwidth ) ; //Next Pixeel Row
TileSrcheight --;
}
repeat point 2),3) for every 16 tile images
4) tranform the image buffer nto an Iimage
DrwImgArr = driver->createImageFromData( format ,dimension2d<s32>(Imagewidth, Imageheigh ),u4FullImage,true );
5) generate texture from the image
TeturImgArr = driver->addTexture("ImageBuff", DrwImgArr);
6) add texture to an iGuiImage
UsrImgArr->setImage( TeturImgArr );
(
IGUIImage * UsrImgArr;
UsrImgArr = guienv->addImage(rect<s32>( 0 ,0 , Imagewidth, Imageheigh ));
IImage * DrwImgArr;
ITexture* TeturImgArr;
)
may be there i s a easier way using irrlicht favcilities
but i dont know.
Bye
-
- Posts: 17
- Joined: Mon May 08, 2006 8:58 am
Hello
How must all 16 images do if is different?
Want to do via this method.
Help more once
Thank you .
How must all 16 images do if is different?
Want to do via this method.
Code: Select all
scene::ITerrainSceneNode* terrain = NULL;
terrain = smgr->addTerrainSceneNode("image/map/plain_00.bmp");
terrain->setScale(core::vector3df(64, 8, 64));
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
terrain->setMaterialTexture(0, driver->getTexture("image/map/terrain-texture.jpg"));
terrain->setMaterialTexture(1, driver->getTexture("image/map/detailmap3.jpg"));
terrain->setMaterialType(video::EMT_DETAIL_MAP);
terrain->scaleTexture(1.0f, 20.0f);
// create triangle selector for the terrain
scene::ITriangleSelector* selector
= smgr->createTerrainTriangleSelector(terrain, 0);
terrain->setTriangleSelector(selector);
mainTriangleSelector->addTriangleSelector(selector);
selector->drop();
Help more once
Thank you .
Hi
for what i know addTerrainSceneNode(... take as parameter only a file name
may be you colod save the new image into a file?(i never tried it)
or
i saw a thread of 1 month ago about how to load from memory data , but now i don t remember its name, the goal was to override the addTerrainSceneNode function adding code to load from memory
bye
for what i know addTerrainSceneNode(... take as parameter only a file name
may be you colod save the new image into a file?(i never tried it)
or
i saw a thread of 1 month ago about how to load from memory data , but now i don t remember its name, the goal was to override the addTerrainSceneNode function adding code to load from memory
bye