Page 1 of 1

shooting in 3d

PostPosted: Oct 25, 2002 @ 12:32am
by brendan
Hi all, I'm working on a new game, with some 3D elements, example here

http://www.ozcreations.com.au/screenshot.jpg
(comments welcome)

Anyhows, the landscape in this pic is built on x,y co-ords that are created using info like texture, height, solid. So to reference an xyz point on the map it would be somthing like map[x][z].hieght or (y) etc...

anyhow I'm now starting to fire bullets around, and what I "think" is the best way to do this is via vectors x,y and z, these are set by the player in the bottom right of the window (red dots)... so the bullet starts with these vectors, then to calc its next position I just add the vectors etc, take into account the gravity and wind etc!

for checking that it has hit the ground or player I could do a simple check like is the height at x,z higher than the bullets y co-ord etc, but if the bullet it fired along the ground it could detect a hit a fair distance after "penetrating" land

has anyone played around in simillar situation before?

should I calculate all pixels in the bullets path? or each sub section (frame)?

I was hoping to calculate each sub movment because I'm going to have "live" wind, so it will effect the bullet in real time!

-anyhows comments, suggestions, code whatever are welcome!
p.s the sheep probably wont feature in the final ;-)

PostPosted: Oct 25, 2002 @ 4:35am
by brendan

PostPosted: Oct 25, 2002 @ 10:24am
by jont

PostPosted: Oct 25, 2002 @ 11:25am
by brendan

PostPosted: Oct 25, 2002 @ 12:09pm
by refractor

PostPosted: Oct 29, 2002 @ 2:53pm
by Malmer
Interesting shot. Do I sence a little bit of Argentum in there. I mean how the maps are rendered... ;)

Good luck with the development!

PostPosted: Oct 30, 2002 @ 12:42am
by brendan

PostPosted: Oct 30, 2002 @ 2:19pm
by Malmer

PostPosted: Oct 31, 2002 @ 7:15am
by brendan

PostPosted: Oct 31, 2002 @ 9:21am
by refractor
(Thinking out loud here 'cos I've only just got up).

Brendan:

If your map doesn't scroll:
you could calculate a static screen-sized z-buffer from the viewpoint to the terrain and use that when plotting objects.

If your map scrolls:
then you could compute a mini z-buffer for your plot area at run-time... it would be costly, but you're probably not plotting all that many objects. If you cut the screen into "sectors" you could cache the mini-z-buffers.

PostPosted: Nov 25, 2002 @ 5:22am
by brendan

PostPosted: Nov 25, 2002 @ 11:01am
by refractor

More on Z-Buffers

PostPosted: Nov 26, 2002 @ 2:27pm
by Conan