Asked a million times.

Blitz3D Forums/Blitz3D Programming/Asked a million times.

Baystep Productions(Posted 2005) [#1]
Bullet hole decals? How is it down based on a camerapick.


BlackD(Posted 2005) [#2]
Don't use Camerapick. Use Linepick to do a line from the front of the player, to infinity (well, a long way, anyway). If the first entity it hits is a enemy, you've got to deal the damage. IF however, it hits the map first (ie, a wall), then use the
PickedTri() command to detect which triangle it picked on which surface, etc.

Then use AlignToVector to put the bullet hole sprite flat up against (but just out.. say, 0.0001) from the wall. It'll be a little more complicated than that. You'll have to find out which way the triangle is facing (based on which way the verts connecting it are connected, relative to the player) to figure out which side to put the decal on - but it's relatively straight forward.

Make sure your map mesh has EntityPickMode enabled on it, otherwise the linepick (or camerapick, etc) won't pick it. >_<

Hope this helps.

+BlackD


Baystep Productions(Posted 2005) [#3]
It does. Thanks.


jfk EO-11110(Posted 2005) [#4]
I think an other solution would be to use the pickedNX etc. commands to determine the required decal rotation. then move t slightly away from the wall, using moveentity decal,0,0,0.001


Qube(Posted 2005) [#5]
Didn't the castle demo included with Blitz3D have this?


Baystep Productions(Posted 2005) [#6]
I looked under the online manual for that command and found a very awesome example.


Ice9(Posted 2005) [#7]
Sorry it hit me the right way.
Sounds like the start of a song

...asked a million times
how to make bullet hole decals Rhyme.
its kind of sublime
but I asked a million times.

put a timer on the sprite to make it go away


KuRiX(Posted 2005) [#8]
Why go away at a time? In real life, Bullet Holes on walls dissapear at a time? Hehe, it is better to move them out when there is too much sprites on the screen and you need more...

:)


Baystep Productions(Posted 2005) [#9]
Yup, my functions deletes the first after the 200th is made.