PDA

View Full Version : Shooting an enemy



vibi
04-09-2001, 03:36 PM
I am writing code to shoot an enemy directly in the line of my firing gun. What checks should I make to figure out if my enemy has been hit?

lpVoid
04-09-2001, 06:52 PM
by responding to this post, I'm probably going to be shunned and banished from this forum, but since I'm newer than a lot of folk here, i feel it's my civic duty to take this one on....

One of the reasons that no one has responded to your two identical posts is that this is the advanced forum. What you're asking about is called collision detection, and if you would take the time to search on the archives, you'll find hundreds or even thousands of posts like yours.

There are many ways to detect a collision, and the method you choose has a lot to do with the type of engine you've designed. If you need help on a specific implementation of CD, then you need to post more information about your engine.

Sorry if I sound harsh, but really, questions like these are just redundant, and after a few months here you'll feel the same way.

Dave

HFAFiend
04-10-2001, 11:03 AM
i'm new too, but i agree :-)

Michael Steinberg
04-10-2001, 10:25 PM
Let the line intersect and take the nearest intersection... http://www.opengl.org/discussion_boards/ubb/smile.gif
Or you may take a straight if the projectiles have finite speed.
This is actually the easiest thing about collision detection...

Hey you guys: Why do you state that this would be an advanced board? The question was not even opengl related. On the other hand you waste work on writing this stuff... If you don't want to write something then (or was it "than"? http://www.opengl.org/discussion_boards/ubb/smile.gif)let it be.

john
04-10-2001, 10:47 PM
because if you don't point out that something's inappropriate, then soon this board will be swamped by people seeking fashion advice for their pet poodles.

cheers,
John

kieranatwork
04-11-2001, 02:28 AM
So long as the post has an appropriate title, I don't see a problem with it. Don't read it if you aren't interested in collision detection!
Collision detection is relevant to OpenGL - how vertices are stored affects what sort of algorithm you use etc.

On the other hand, what's relevant about endless discussions about the f*cking XBox? Or someone asking what games everybody's writing at the moment? I don't see anyone complaining about that.
Thank you for speaking for the rest of the newsgroup, mate, we all really really appreciate it...
Ooo, you've got me riled now!

LordKronos
04-11-2001, 03:19 AM
Originally posted by kieranatwork:
So long as the post has an appropriate title, I don't see a problem with it. Don't read it if you aren't interested in collision detection!
Collision detection is relevant to OpenGL - how vertices are stored affects what sort of algorithm you use etc.


So if I made an openGL rendered porno movie, you wouldnt mind me making a post:
"XXX, Hot, Live, Streaming, OpenGL XXX Sex"

and then went on to give you the URL to my site plastered with ad banners and popup windows (before anyone gets excited, no this site doesnt actually exist...just theoretical), you wouldnt mind? It would have an appropriate title, and it would even be OpenGL related. (just trying to see if I can get you a little more "riled" http://www.opengl.org/discussion_boards/ubb/smile.gif)

His question had nothing to do with opengl. He was asking about algorithms. Check an algorithms newgroup for this.

Personally, I dont mind SO MUCH when someone posts off topic, as they might not know a better place to post. However, I DO mind when someone doesnt take a search through the archives (and the answer is there). But this post is off topic AND in the archives, which makes it doubly bad. And on top of that, he/she did one of the other things I hate the most which is...
"Hmmm, maybe nobody will look at my other post, so I will post the exact same thing under a differnt title 1 minute later"




On the other hand, what's relevant about endless discussions about the f*cking XBox? Or someone asking what games everybody's writing at the moment? I don't see anyone complaining about that.

Well, I did do a search, and most of the references to the XBOX were relevant (will it support OpenGL, and what 3D features it will support). Surely there are some off topic comments in relevant post (and if you look, you will even see me comment in one of these "and on the topic of blah blah blah, yes I could response, but thats way off topic".

As for the "what games are people working on" thread...yes, also off topic. But, you have to use a bit of judgement on what to shoot down. To me, that thread was a little more oriented at building comminity relations here. A lot of us kinda know each other around here (I recognize about 20 or 30 names here on a regular basis), though only for whats been posted. To me, that thread was kinda saying "lets get to know each other a little better". I dont really have a problem with that.

And no, we dont jump in on every thread and yell "OFF TOPIC". Just every now and then. Its like traffic law enforcement. You dont pull over EVERY speeder...just do it often enough to make a point to others that you are there enforcing(so you best behave). And you use a little judgement in the process (some cops will let you get away with 12 over, some will stop you for going 3 over, and some wont bother you for going 20 over if they think its gonna make them spill their coffee or knock the donuts off the dash http://www.opengl.org/discussion_boards/ubb/smile.gif).

Hull
04-11-2001, 04:33 AM
Vibi wants us to provide either links or code of an extremely simple collision detection using OpenGL matrices and OpenGL functions.

If anyone has done something like using gluProject() to get the window screen position of possible target triangle domains from objectspace to window screencoordinates and then issue a possible 'hit' if the triangle touches or engulfs the screen position of vec2_t(winWidth/2,winHeigth/2), then U should make a post here http://www.opengl.org/discussion_boards/ubb/wink.gif

It can be done.
(But I haven't tried it myself.)

Further note:
I believe Kieranatwork is a Japanese Manga lover who makes gameports to ps2 and therefore hate the concept of Xbox.

I hate consoles in general and believe that a REAL computer is a better choice for kids because of the education/learning factors.

kieranatwork
04-15-2001, 11:05 AM
Hull, you're probably right about me. Who knows.
I remember when I started using certain other discussion groups to get help in learning OGL, linear algebra etc. and the people there were really unfriendly, constantly blasting on about searching the archives, without really reading my questions - the answers to which weren't in the bleeding archives.
I just think that people should not answer posts if they don't want to - don't go to the trouble of doing it just to make silly points unless it's *really* off the topic.

You're all very nice people, and I don't want to piss you off too much.
I don't port games, Hull - I also don't do cover versions of Billy Joel songs...

jwatte
04-15-2001, 03:20 PM
I need some pet poodle fashion advice.

I have a pet poodle mesh which I need to texture. Do you think texture_combine4 or texture_env_dot3 will give me the best imitation pink fur texture?

LordKronos
04-16-2001, 02:54 AM
Originally posted by jwatte:
I need some pet poodle fashion advice.

I have a pet poodle mesh...

I think you need to get a more lifelike companion. A real pet would probably be much more rewarding.