PDA

View Full Version : How would you explode a piece like this?



Succinct
11-17-2000, 05:42 AM
Alright, guys, i'm making a new ogl wapper, and to test it, i decided to go w/ a simple tetris program, still in 2d, but w/ some added 3d effects.

Well, now i have a question.

How would you blow up a block?
I have my own idea, but i'd like to see what you guys think.

here's how the block is arranged (it kinda looks like the blocks in the dungeons from the original Zelda)

888888888888
88++++++++88
8+8++++++8+8
8++888888++8
8++8++++8++8
8++8++++8++8
8++8++++8++8
8++8++++8++8
8++888888++8
8+8++++++8+8
88++++++++88
888888888888

the inner square is just 2 triangles
888888
88+++8
8+8++8
8++8+8
8+++88
888888

and the outer trapezoids are
888888888888888888888888
8+++++++++++++++++++88
8++++++++++++++++8+8
8+++++++++++++8++8
8++++++++++8+++8
8+++++++8++++8
8++++8+++++8
8++8+++++8
88+++++8
888888

bad drawing, but they're also 2 triangles, same as the square, but the top is deeper and wider.

given that the enitre block is only 10 polygons (it's small onscreen, so the tesselation is high enough), how could i make a good explosion?

i don't need to have fire effects. maybe just like glass breaking. I'm just curious if you guys would further subdivide each poly w/ some random edge generator or what?

any cool ideas, lemino, k?

thx for the input in advance

-Succinct


[This message has been edited by Succinct (edited 11-17-2000).]

Dodger
11-17-2000, 09:05 AM
First I'd just try to explode the model as it is... if it doesn't look good enough, subdivide http://www.opengl.org/discussion_boards/ubb/wink.gif

Give every triangle an initial velocity 'away' from the center of the object, and initial x-y-z-rotations, maybe a gravity simulation to make it look right.

For subdividing, the simplest thing I could imagine would be this:

Generate another vertex D for every triangle ABC in the middle of edge BC.
Then make two new triangles ADB and ACD, and forget the old one.
And then blow it up http://www.opengl.org/discussion_boards/ubb/smile.gif

Succinct
11-17-2000, 09:27 AM
Kewl, thx. that was close to my original subdivision idea, but the initial states were what i wasn't thinking about.

(see, i'm getting ready to do it, but i haven't started it yet (gotta finish a few other parts of the program), so i didn't really think about the details yet, just wanted to see what u guys would say. call me a cheater http://www.opengl.org/discussion_boards/ubb/wink.gif )

thx again, dewd, it'll work great if i make each piece a little oo spiel.

i just realized, when the pieces flip around, they'll be culled, huh?

awww crap.

now instead of just creating opposite poly's w/ opposite normals, is there some way to
turn culling off, allow the backfacing polys to be rendered, and still have them use lighting, even though the normals are facing away?

hrmm..

Dodger
11-21-2000, 08:27 AM
Let me know how it goes http://www.opengl.org/discussion_boards/ubb/wink.gif
For the culling, yes... just call

glCullFace(GL_FRONT_AND_BACK);

before drawing the exploding block, and reset it to the original state when finished drawing.