Decal mesh generator
Posted: Wed Jan 11, 2012 3:55 pm
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.
Video1
Video2
Download
Have fun!
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
Video2
Download
Have fun!