Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

let OpenGL do bullet collision?

Name: Anonymous 2006-09-06 0:11

this is something that's been on my mind but I can't find much information on this on Google (which leads me to believe that it's probably not a good idea if nobody else has thought of it).

Umm... okay say I have a scene with a bunch of enemies and other moving models.  And I want to implement localized damage (shoot enemy in the foot, or in the shoulder, etc... specific places).

Is there any reason I can't do this by using GL_SELECT rendering mode in an auxiliary buffer?  like when a shot is fired, render everything like normal as always, but then, in an unseen auxiliary buffer, switch the "camera" to your gun's point-of-view, and then draw the models to the namebuffer (remember this is GL_SELECT rendering mode so things like textures, lighting, even regular won't cause overhead because they're not drawn -- just flat polygons with "names" associated with them).  And then if there's any hits in the auxiliary buffer upon a shot, take the identity of the hit polygon and figure out which body part of a model got hit?

this probably is useless for true collision (as in physics, bouncing, etc) but I thought it might be a neat solution to registering bullet-shots on dynamic entities in a scene.

has anyone ever done bullet-collision this way?

Name: Anonymous 2006-09-06 3:32 (sage)

AI MOTHERFUCKER, DO YOU USE IT?

Name: Anonymous 2006-09-06 10:25

Name: Anonymous 2006-09-06 15:58

You'd be rendering the scene twice, which is pretty WRONG. Although on modern hardware, writing a shitty game, you can probably get away with something like this, there are more elegant ways to model the movement and collision of fast-moving objects like bullets. I think that most games use ray-casting for this sort of thing, which is where you represent the path of the bullet with a ray and then perform collision detection on that. Note that performing a ray-intersection test with every triangle in a scene is hardly realistic, so you might want to use bounding spheres, for example, as an optimization.
Also >>3

Name: Anonymous 2006-09-06 18:16

I didn't know you could do raytracing in Opengl except to draw 2D pixels. Links please.

Name: Anonymous 2006-09-06 19:37

>>5
Raytracing doesn't involve OpenGL, you just create a ray in the direction the bullet is travelling and calculate the time it will intersect objects in the scene, lowest t is the one it hits.

Name: Anonymous 2006-09-06 19:52

>>4

Name: Anonymous 2006-09-06 19:54

>>4

Name: Anonymous 2006-09-06 20:37

>>2

Name: Anonymous 2006-09-06 22:22

>>4

Name: Anonymous 2006-09-07 3:49

>>8

Name: Anonymous 2006-09-07 4:05

Man, all these people are retards.

Yes you can do it that way, and yes it's fairly slow. As for determining what to do as the result of a collision, depending on the system you're using it may or may not be of use.

Another shitty way of doing it is rendering the scene to the back buffer with solid colors then flipping a single pixel to the front buffer and seeing what color it is.

An alternative to this is the excellent ColDet library which will do this sort of thing better, or Open Dynamics Engine which is a full physics simulator but rather complex to use.

Or you can always use the common vector approximations like boxes, cylinders, and spheres - they're simple enough to write - but I personally can't stand games that use them as they are too inaccurate.

Name: Anonymous 2006-09-07 10:57

Name: Anonymous 2006-09-07 19:36

Name: Anonymous 2006-09-07 19:54

Name: Anonymous 2006-09-08 4:26

Name: Anonymous 2006-09-08 4:40

Name: Anonymous 2006-09-08 4:45

Name: Anonymous 2006-09-08 6:36

Name: Anonymous 2006-09-08 8:54

Name: Anonymous 2006-09-08 9:02

Name: Anonymous 2006-09-08 11:06

Name: Anonymous 2006-09-09 16:05

Name: Anonymous 2006-09-10 2:39 (sage)

>>SAGE

Name: Anonymous 2006-09-10 12:56

>>25 is a moron!!!

Name: Anonymous 2006-09-10 13:05

Name: Anonymous 2007-07-05 7:05 ID:gNFIvyhR

you could picking but its better to do geometric calculations yourself.

Name: Anonymous 2007-07-05 7:33 ID:JjXoQzQ2

>>27
Bumping faggot

Name: Anonymous 2007-07-05 7:42 ID:LvSsLKGP

>>28
It's better then having a page full of friggin Satori threads

Name: Anonymous 2007-07-05 8:09 ID:63su+Kz4

As a newcomer to /prog/, I have been somewhat astonished by these old threads that actually discuss programming.

Name: Anonymous 2007-07-05 11:03 ID:JjXoQzQ2

>>30
Yes, /prog had a bit more quality in the past as far as discussion goes, but it can be more fun now. Ever since it became the new /VIP, we've been outdoing ourselves every week.

Yet I wouldn't mind serious discussion as long as we can make funny references to memes in every post.

Name: Anonymous 2007-07-05 11:47 ID:jsoSUfQe

>>32
wiichan.net/c
Wherein Anal Touring posts an ircd written in Python.

Name: Anonymous 2009-01-14 13:13

SICP

Name: Anonymous 2009-01-31 11:20

As a newcomer to /prog/, I have been somewhat astonished by these old threads that actually discuss programming.

Name: Anonymous 2009-01-31 11:24

>>34
discuss programming?
why the hell would we want to do that?

Name: Anonymous 2009-01-31 12:09

>>35
Especially since most of /prog/ is at the stack pointer monadic overflow level.

Name: Anonymous 2009-01-31 12:13

As a ɹǝɯoɔʍǝu to /prog/, I'm still somewhat astonished by these old threads that discuss inane programming ideas like they were worth discussing.

Name: Anonymous 2009-01-31 12:19

It's better then having a page full of friggin Satori threads
OMFG FFFFFFFFFFFFFFFFFFFFF *rage* XD

Name: Anonymous 2009-01-31 13:17

>>38
The Sussman?

Name: Anonymous 2010-06-28 10:59

beware the army of 12 year old autistics

Name: Anonymous 2010-06-28 19:38

The Pleasure of Being Cummed Inside

Name: Anonymous 2010-06-29 14:36

nigger

Name: Anonymous 2010-12-17 1:19

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Sgt.Kabuᕤꐜkiman봴 2012-05-28 19:58

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List