Decal mesh generator

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Decal mesh generator

Post 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!
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Decal mesh generator

Post 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
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Decal mesh generator

Post 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.
Working on game: Marrbles (Currently stopped).
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Decal mesh generator

Post by smso »

File downloaded at third trial. Thanks for sharing.

Regards,
smso
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Decal mesh generator

Post by sudi »

smso wrote:File downloaded at third trial. Thanks for sharing.

Regards,
smso
So no problem with the download anymore?
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Re: Decal mesh generator

Post by ACE247 »

That fileupload site is allways a problem with slower internet connections. speed <= 512kbps.
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Decal mesh generator

Post 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
HAWK0987654321
Posts: 6
Joined: Tue Apr 17, 2012 10:29 pm

Re: Decal mesh generator

Post 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.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Decal mesh generator

Post by serengeor »

Maybe those aren't decals, but rather another texture layer? (Just a guess)
Working on game: Marrbles (Currently stopped).
HAWK0987654321
Posts: 6
Joined: Tue Apr 17, 2012 10:29 pm

Re: Decal mesh generator

Post by HAWK0987654321 »

I started a thread for my question here: http://irrlicht.sourceforge.net/forum/v ... =1&t=46286
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Re: Decal mesh generator

Post by belfegor »

Source is no longer avilable. I am interested in texcoord generation, can someone please reupload this so i can take a look?
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
Post Reply