AligntoVector

Blitz3D Forums/Blitz3D Programming/AligntoVector

cash(Posted 2005) [#1]
I have searched the forums and code for answers but I cant find the answer.....

Camerapick is used in my FPS code along with entitydistance.

All works well. What want is the dreaded bullet hole.

So I create types, sprites and hoorah it works....

Well not quite. The bullet hole wont stay flat on the wall. It doesnt matter what spriteviewmode I use or aligntovector etc. It doesnt work.

Anyone got a simple bit of code for this ?


BlackD(Posted 2005) [#2]
Look up PickedNX() in your Blitz3D manual.


Tom(Posted 2005) [#3]
sprite view mode 2 works for me:

SpriteViewMode bulletsprite,2 ;static sprite


cash(Posted 2005) [#4]
This worked...Thanks

Type bullethole
Field hole
End Type


;###########################################

Global bullhole=LoadSprite("graphics\bullethole.bmp",4)
EntityBlend bullhole,2
SpriteViewMode bullhole,3
EntityFX bullhole,16
HideEntity bullhole


;#########################################

If cpick=level1 Then

c.bullethole = New bullethole
c\hole=CopyEntity (bullhole)
PositionEntity c\hole,PickedX(),PickedY(),PickedZ()
AlignToVector c\hole,PickedNX(),PickedNY(),PickedNZ(),3
ScaleEntity c\hole,.05,.05,.05
SpriteViewMode c\hole,2
EndIf


Baystep Productions(Posted 2005) [#5]
Nah man, go to the online 3D manual for AligntoVector. Its got the easiest code there.


Tom(Posted 2005) [#6]
cash: that looks near enough like a routine I had. You should also record the creation time of the bullethole, then in an update function which you need only call every few seconds or so, check each bullet hole type and kill it off if it's older than say 20 seconds or whatever.

Sprites are easy enough to use, but they're a bit slower than using a quad mesh/single surface system, so you don't want to have too many on screen.


Baystep Productions(Posted 2005) [#7]
Nope, fading and disapearing bullet holes, kinda looses realism, I use a Dim to hold them all and after the 200th delete the first, user wont realize it and i limits crazy amounts of sprites.