Author Topic: [ask] how to make 3D explosion  (Read 2724 times)

Offline genbasic

  • Mc. Print
  • *
  • Posts: 13
    • View Profile
[ask] how to make 3D explosion
« on: 2010-Nov-10 »
i want to make 3D game with glbasic, but i dont know how to make cool 3D explosion or even 3D particle in glbasic.
any one can help me? ( + sample code will be help alot  :nw: )

( sry for my english )

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10667
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: [ask] how to make 3D explosion
« Reply #1 on: 2010-Nov-10 »
Hemlos has a particle engine somewhere on the forums. If you don't know about that, first try to focus on the main game before you implement the killer features.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: [ask] how to make 3D explosion
« Reply #2 on: 2010-Nov-10 »
A simple way is to create or import a 3D star object (still or animated) and animated a fire-like texture, with rotation and scaling it up and down...ka-boom!!  :good:

Offline genbasic

  • Mc. Print
  • *
  • Posts: 13
    • View Profile
Re: [ask] how to make 3D explosion
« Reply #3 on: 2010-Nov-10 »
tq for reply.

Hemlos has a particle engine somewhere on the forums. If you don't know about that, first try to focus on the main game before you implement the killer features.

i see.. but to much slow i running the sample code from that engine. maybe i must try some else or not using particle for 3D explosion ( using 3D particle too much kill CPU resource ).
but thx for help..    =D

A simple way is to create or import a 3D star object (still or animated) and animated a fire-like texture, with rotation and scaling it up and down...ka-boom!!  :good:

sound nice, ok i will try it..  :good:

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1579
  • Particle Hawk
    • View Profile
Re: [ask] how to make 3D explosion
« Reply #4 on: 2011-Feb-16 »
The only thing is, i dont think i published the 3d version.

One thing you must keep in mind about particles.....use as few as possible.
My samples are purposefully over-built with way too many particles for anything practical, not to mention its 2d.
They just show off the fact that a thousand objects can move around on thier own paths.
I recommend (depending on size) to use 12-128 particles for brief explosions.
You can use 12 for the fire particles, 12 for the smoke, keep the particle lifetime short too...1 second.

Heres a faster solution, although it "looks" more rigid, it will run faster than a particle engine.
Make a 3d bezier rotation around a point, 360 degrees for each frame, this is the template path, so rotate it 12 time or so, to make it seem circular.
Move small billboards along the template bezier coordinates, randomly timing the spawning will look best. Spawn them all within a second, and about 100ms apart(roughly).

Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)