Code archives/3D Graphics - Misc/Level decals

This code has been declared by its author to be Public Domain code.

Download source code

Level decals by poopla2002
Will take a sprite, and the projectile that is leaving the decal... doesnt have to be a projectile per say but thats the general idea ;).


Untested but its pretty much what I use.
function decal( sprite, entity)

  x = CountCollisions ( entity )
      For c = 1 To x

     
        PositionEntity sprite, CollisionX#(entity,c), CollisionY#(entity,c), CollisionZ#(entity,c) 
        
        AlignToVector sprite, CollisionNX#(entity,c), CollisionNY#(entity,c), CollisionNZ#(entity,c),3
        
        TurnEntity sprite,180,0,0
        
        MoveEntity sprite,0,0,-.01

       return sprite 
      Next

end function

Comments

RemiD2016
i never understood the point to consider all collisions... If we assume (i don't know for sure) that the collisions are ordered by distance, just consider the first... In your procedure, only the last will be considered anyway...


RustyKristi2016
Any example of this? Maybe this can do blob shadows?


RemiD2016
@RustyKristi>>the code above can be simplified, (you can remove the Turnentity()) if the quad is created with its default orientation (where it is looking at) is the +Z axis (what the default of any mesh should be imo, to keep things constant)


Code Archives Forum