Topic: How to get a texture from a large tile map

i use mesh and want to use only a small part of a big image

how to do this

i can make this with  texture = driver.getTexture("big pix.bmp")

P5E Q6600@2,6Ghz, 4go corsair, 2*150go velociraptor, Radeon3850, 24" samsung LCD.
BMAX 1.30 + Irrlicht wrapper 1.4.2

Re: How to get a texture from a large tile map

greetings smile  i will try to work out the sequence for you tonight, but if you want to try it on your own you will need to:

- load the image into an IImage
- then create a new IImage from a part of that image
- then addTexture using the part image.

all the functionality you need is on the IVideoDriver object.

3 (edited by Kali 2008-10-06 02:48:45)

Re: How to get a texture from a large tile map

Yes, good idea

have you an exeple for copiing IIMAGE to another ?

I don't know the IImage   can you explain this fucnction?

big thanks...


and big thanks for the BMAX wrapper, is very useful and powerful !

P5E Q6600@2,6Ghz, 4go corsair, 2*150go velociraptor, Radeon3850, 24" samsung LCD.
BMAX 1.30 + Irrlicht wrapper 1.4.2

Re: How to get a texture from a large tile map

this is untested but should get you where you want to go:

' example of pulling first 120x120 from a larger image
Local big_image:IImage = driver.createImageFromFile("big pix.bmp")
Local small_image:IImage = driver.createImageFromImagePart(big_image, _POSITION2DI(0,0), _DIMENSION2DI(120,120))

Local texture:ITexture = driver.addTextureFromImage("small_image_name", small_image)

Re: How to get a texture from a large tile map

Compile Error
Identifier 'createImageFromImagePart' not found

P5E Q6600@2,6Ghz, 4go corsair, 2*150go velociraptor, Radeon3850, 24" samsung LCD.
BMAX 1.30 + Irrlicht wrapper 1.4.2

Re: How to get a texture from a large tile map

which version of the mod are you using?

7 (edited by Kali 2008-10-07 08:43:30)

Re: How to get a texture from a large tile map

latest : Irrlicht Mod for Irrlicht v1.4.2 + BMAX v1.30



this work now (?) probaly i used an old version...

ok


but the new answer is  :

driver.addTextureFromImage("small_image_name", small_image)

i don't understand why  "small_image_name" is redéfined, it was initialized before too.

?

P5E Q6600@2,6Ghz, 4go corsair, 2*150go velociraptor, Radeon3850, 24" samsung LCD.
BMAX 1.30 + Irrlicht wrapper 1.4.2

Re: How to get a texture from a large tile map

that is creating an ITexture from an IImage that you can then use wherever you need the texture.  "small_image_name" is just a text name for the texture and should be replaced by whatever you would like to call it.