"Impact Radar" ala shooter, HELP!

Blitz3D Forums/Blitz3D Programming/"Impact Radar" ala shooter, HELP!

Pinete(Posted 2006) [#1]
Hi all,

I'm trying to implement a "radar" that tell you where
is the enemy shooting to you.

Really, the radar is a 3d sprite in front of the camera
and the things I would like to know is how could I rotate
this sprite depending of the global coordinates of
your enemy and the angle in which the player is looking.

For example, supposing that the radar is a arrow bitmap pointing to the top of the screen, the result should be:

If your enemy is in front of you, the arrow rotation should
be really small (almost 0)..

If you turn 90 degreess to the right, for example, the enemy
is positioning at your left, at this moment, the arrow should be rotated to the left 90 degress...

I've tried a lot of ways but my results are a completely
disaster.. I've tried with TformPoint but I don't know
how to manager this function and, in the better option,
if this function could help me to do this.

Please, someone could help me?

Thanks in advance!

Regards


octothorpe(Posted 2006) [#2]
Please explain why PointEntity() won't work for you.


jhocking(Posted 2006) [#3]
From what I understand of his description (ie. I may be misunderstanding) PointEntity won't help; the TForm commands are the way to do it, but I'm not at home so I can't explain right now how to do it.


Picklesworth(Posted 2006) [#4]
Calculate angle to bad guy using simple trigonometry, and then draw your radar with that angle + the Y axis rotation of the player.


Pinete(Posted 2006) [#5]
Basically the way in which the "radar" is shown is like
if it was a 2D bitmap in front of you, ocupping the whole
screen.

It was on alpha 0 all the time excepts when a enemy is
attacking you. At this moment, the radar rotates trying
to show where the enemy position is, related to where the player is looking.

For example, if the player is looking to the north and
the enemy is shooting at his back, the way in which this situation
was shown by the radar could be with a arrow pointing to the
bottom of the screen.

The problem with pointentity is that this function makes that one entity point to other and that's not the effect,
the radar is 2D on screen (really is a 3D sprite but it is drawing as 2D)

If you have played to Call of Duty you can see the effect
I would to do.

I don't know if I have explained the things i'm refering to,
if you need a deeper explanation I could try to put a screenshot if someone says to me how could I do it.

Thanks in advance!


Stevie G(Posted 2006) [#6]
I'm assuming that the radar is a plan view?

If you're just looking for an arrow sprite to point to where the atacking enemy is in relation to the player you could use ..

Rotatesprite MySprite , deltayaw( player , enemy )

Not tested so you may have to add +90 or suchlike to the sprite rotation.


Hope this helps.

Stevie


WolRon(Posted 2006) [#7]
Stevie G's solution would be easiest, but it doesn't need to be a sprite. You can rotate meshes as well. Just point the arrow 'up' on the screen (so it's Z axis is pointing 'up') and then rotate the arrow mesh around it's Y axis the DeltaYaw amount.


Pinete(Posted 2006) [#8]
Thanks to all, I will try it...
I'll tell you the results during the day

Thanks and regards!


smilertoo(Posted 2006) [#9]
A radar is easily done with a polar coordinate system.


Bankie(Posted 2006) [#10]
Very co-incidentally, I am trying to implement something very similar to Pinete in a space sim, and was brushing up on my maths in order to solve the problem. However, I had no idea about the DeltaYaw (not to mention DeltaPitch and DeltaRoll) command and it seems to be undocumented. Sorry for the newbie question, but how do you find out about all these undocumented commands which could save B3D newcomers alot of time?


WolRon(Posted 2006) [#11]
I bet you'll find them if you perform a search on this site for undocumented commands...


Matty(Posted 2006) [#12]
Have you got the latest docs, DeltayAw is in the help system on my version of blitz3d?


big10p(Posted 2006) [#13]
Bankie: there is no DeltaRoll command.


Pinete(Posted 2006) [#14]
Please, someone could say me where I could download the latest blitz3d docs?
I have the 1.83 help files... I imagine that's not the latest?...

Thanks!


Matty(Posted 2006) [#15]
Have a look in the forum section "blitz3d updates" under "blitz3d doc packs"


Bankie(Posted 2006) [#16]
Yes Big10p, no DeltaRoll - my mistake.

Thanks Matty for the info re the docs. It's a bit frustrating that I've bought BB3D very recently, yet got an earlier version of the docs with it.


Pinete(Posted 2006) [#17]
Ok, thank you Matty! :P