Page 1 of 1

Decals on terrain

Posted: Mon Aug 29, 2005 4:45 pm
by Zoulz
Hello, I'm wondering if there is any support in Irrlicht for drawing decals on objects (terrain for instance)... blood-splats or unit markers.

For example, when you click something in World of warcraft a red marker appears.

Anyone tried this or know a some way to implement it?

Posted: Tue Aug 30, 2005 2:33 am
by bitplane
decals are not very hard to pretty tough depending on how nice you want it to look. heres some ways ive thought of doing it
easy:
use the triangle selector to get intersection like in example 7, add and rotate the right decal mesh node, then add a deletion animator to it. yuck.
harder:
make a custom node that is a cyclical vertex buffer, use the triangle selector to find the center and 4 corners of the decal. if a corner has no collision or it's too far away then clip it to the edges of the center's triangle and recalculate tcoords. still only really good for small decals on flat surfaces.
hard:
same as above, but copy all triangles inside the collision area, clip them to collision fustrum, project the tcoords on. too hard for me.

for markers, you could just add a red marker node and make it a child of the currently selected node, or have each object have a hidden marker child node that becomes visible when you select it.

Posted: Tue Aug 30, 2005 6:37 am
by Zoulz
How about projected textures? I've heard it can be used for decals, but i'm not sure how it works. Anyone whom can explain or point me in the right direction?