Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: 3D Explosions

  1. #1
    Intern Newbie
    Join Date
    May 2000
    Posts
    40

    3D Explosions

    I am interested in doing 3D explosions for the game that I am making. Does anyone have experience with this? Can you point me to some resources? I basically want to created an alpha blended, textured sphere that expands as the explosion gets bigger. My initial thought is that texturing the sphere is going to be the hardest part. Thanks in advance.

    Tone

    [This message has been edited by Tone (edited 05-28-2001).]

  2. #2
    Junior Member Newbie
    Join Date
    May 2001
    Location
    France
    Posts
    1

    Re: 3D Explosions

    Explosion with texture mapped sphere is not very good, I tried and the explosion is too regular. What you can do is
    1) several texture mapped spheres
    or
    2) texture mapped particles
    I'd vote for the second one

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    718

    Re: 3D Explosions


  4. #4
    Intern Contributor
    Join Date
    Mar 2001
    Posts
    70

    Re: 3D Explosions

    How about using a single billboarded(i think that's the right term for a face that always points towards the viewer) quad and map an animated texture to it.

    Use glTexSubImage2d to modify the texture. Modify your Quad by slowly increasing it's size. You can even sync the 2.

  5. #5
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Dunblane, Scotland
    Posts
    353

    Re: 3D Explosions

    For an ultimate power weapon type thing make it really fancy with a couple of textured,blended spheres that increase in size and then fad out, add loads of cool particle effects and smoke at the end, a bright flash of light always makes it look cool, shake the camera randomly bit (amount dependent on distance etc.)
    Reality is for idiots only the best over come it!

  6. #6
    Intern Newbie
    Join Date
    May 2000
    Posts
    40

    Re: 3D Explosions

    Thanks for the ideas. Now what I need is an algorithm that draws a sphere (or more specifically a hemisphere) where I can control the radius. Does anyone know were I can find that?

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    Re: 3D Explosions

    There's a recursive sphere drawing routine in the red book. IIRC, it actually draws 1/8 of a sphere, but just rotate and redraw

    -- Zeno

  8. #8
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,142

    Re: 3D Explosions

    You can draw spheres with glut and with quadrics, and you can specify the radius for both. When you have other methods where you cant specify the radius you can always scale it with the modelview matrix.

    But I wonder why you want to draw a hemisphere. When there is an explosion above the ground you need a sphere, when its on the ground the lower hemisphere won't draw because its behind the ground (supposing the viewer is above ground ).



    [This message has been edited by Overmind (edited 05-30-2001).]

  9. #9
    Intern Newbie
    Join Date
    May 2000
    Posts
    40

    Re: 3D Explosions

    Yeah, okay. Initially I wasn't planning on explosions in mid-air, but I changed my mind. For spheres though, I need an algorithm to draw them manually, since I want to texture map it. I would prefer not to use glut or glu functions for that.

  10. #10
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: 3D Explosions

    ild ditch the idea of a single billboarded quad for an explosion. though this is what a lot of games do quake/UT. IMO the only place this looks good is in a space game where theres no background.
    personally ild go with the hundreds of small exploding particles. render as small billboarded quads
    for each particle go for velocity
    x = random number from -1 to 1
    y = random number from -1 to 1
    z = random number from -1 to 1
    normalize this vector (it doesnt give a perfect distribution but near enuf)
    place all the particles in the center of the explosion and each frame update them outwards by their velocity
    vola a nice looking explosion

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •