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.

Decal mesh generator

Postby Sudi » 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.

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!
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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Re: Decal mesh generator

Postby smso » Wed Jan 11, 2012 5:46 pm

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
smso
 
Posts: 214
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Decal mesh generator

Postby serengeor » Wed Jan 11, 2012 6:12 pm

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).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Decal mesh generator

Postby smso » Wed Jan 11, 2012 6:57 pm

File downloaded at third trial. Thanks for sharing.

Regards,
smso
smso
 
Posts: 214
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Decal mesh generator

Postby Sudi » Wed Jan 11, 2012 7:25 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Re: Decal mesh generator

Postby ACE247 » Wed Jan 11, 2012 7:46 pm

That fileupload site is allways a problem with slower internet connections. speed <= 512kbps.
H8L6L5M4G3H5M7N8S7N9O1R8J1P5M7N9O4P2Q5R6T7U4M3N8X6S5T8W (If you want the secret, why not 'TRY' decrypting it? )
This Door's lock doesn't need a key, the Lock is the key to open the Lock and you don't know how to turn the key...
Link: My Blog :)
User avatar
ACE247
 
Posts: 695
Joined: Tue Mar 16, 2010 12:31 am
Location: Namibia

Re: Decal mesh generator

Postby smso » Wed Jan 11, 2012 8:01 pm

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
smso
 
Posts: 214
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Decal mesh generator

Postby HAWK0987654321 » Mon May 07, 2012 6:01 pm

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

Re: Decal mesh generator

Postby serengeor » Mon May 07, 2012 7:30 pm

Maybe those aren't decals, but rather another texture layer? (Just a guess)
Working on game: Marrbles (Currently stopped).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Decal mesh generator

Postby HAWK0987654321 » Mon May 07, 2012 9:02 pm

I started a thread for my question here: viewtopic.php?f=1&t=46286
HAWK0987654321
 
Posts: 6
Joined: Tue Apr 17, 2012 10:29 pm

Re: Decal mesh generator

Postby belfegor » Sat Apr 13, 2013 12:10 pm

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.
User avatar
belfegor
 
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia


Return to Code Snippets

Who is online

Users browsing this forum: roxaz and 1 guest