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.
- cpp 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!




