Page 1 of 1

Decal mesh generator

Posted: Wed Jan 11, 2012 3:55 pm
by sudi
I created a decal create some time ago and i wanted to finish and polish it.....never did that though.
but i don't want it to go to waste so here it is. It still has some problems in corner cases but is actually pretty easy to use.

Code: Select all

 
//first you create the decalgenerator
CDecal* Decal = new CDecal(driver);
 
//then you update the transform to the point where the decal should be created
//position(irr::core::vector3df): is the position in 3d space where the decal should be placed
//upvector(irr::core::vector3df): is the "normal" of the decal, since a decal might not always be plane this should be an approximation
//size(float): the extends of the decal(always square sry)
Decal->updateTransform(position, upvector, size);
 
//the create the decal mesh
//triangles(irr::core::triangle3df[]): an array of triangles the decal should be shown on
//count(int): the size of the triangle array
irr::scene::IMeshBuffer* decalMeshBuffer = Decal->createBuffer(triangles, count);
 
//now you can do whatever you want with this decalMeshBuffer
 
Video1
Video2
Download

Have fun!

Re: Decal mesh generator

Posted: Wed Jan 11, 2012 5:46 pm
by smso
Download stops when the file size is 2.2Mb. I've tried twice but no luck! Better strip all media files in the archive.

Regards from smso

Re: Decal mesh generator

Posted: Wed Jan 11, 2012 6:12 pm
by serengeor
smso wrote:Download stops when the file size is 2.2Mb. I've tried twice but no luck! Better strip all media files in the archive.

Regards from smso
Works fine for me.

Re: Decal mesh generator

Posted: Wed Jan 11, 2012 6:57 pm
by smso
File downloaded at third trial. Thanks for sharing.

Regards,
smso

Re: Decal mesh generator

Posted: Wed Jan 11, 2012 7:25 pm
by sudi
smso wrote:File downloaded at third trial. Thanks for sharing.

Regards,
smso
So no problem with the download anymore?

Re: Decal mesh generator

Posted: Wed Jan 11, 2012 7:46 pm
by ACE247
That fileupload site is allways a problem with slower internet connections. speed <= 512kbps.

Re: Decal mesh generator

Posted: Wed Jan 11, 2012 8:01 pm
by smso
Sudi wrote:
smso wrote:File downloaded at third trial. Thanks for sharing.

Regards,
smso
So no problem with the download anymore?
It's OK now. Thank you again.

Regards from smso

Re: Decal mesh generator

Posted: Mon May 07, 2012 6:01 pm
by HAWK0987654321
Hello
Thanks for releasing this code, it's the best decal system I have seen for Irrlicht. :D

I am wondering if there is a way to use these decals with non static meshes, as with the F.E.A.R. games where blood decals are created at bullet hits.

Example image from http://www.tweakguides.com/FEAR_8.html
Image

How would I do this?

I'm relatively new to Irrlicht.

Re: Decal mesh generator

Posted: Mon May 07, 2012 7:30 pm
by serengeor
Maybe those aren't decals, but rather another texture layer? (Just a guess)

Re: Decal mesh generator

Posted: Mon May 07, 2012 9:02 pm
by HAWK0987654321
I started a thread for my question here: http://irrlicht.sourceforge.net/forum/v ... =1&t=46286

Re: Decal mesh generator

Posted: Sat Apr 13, 2013 12:10 pm
by belfegor
Source is no longer avilable. I am interested in texcoord generation, can someone please reupload this so i can take a look?