GLBasic forum

Main forum => GLBasic - en => Topic started by: BdR on 2013-Feb-03

Title: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: BdR on 2013-Feb-03
What is the best way to create a .ddd model that holds a simple explosion animation? I don't mean explode an existing spacehip model into tiny vertices, but just an explosion ball and some random debris.

I'm new to 3D and I'm looking for a way to do explosions in a Space Invaders type shooter game for iPhone and Android.

Doing particles is CPU costly (both in 2D as in 3D) so I thought creating a model with 2 keysframes would be a good solution. The first keyframe is some debris parts close together, and the second keyframe would be the same parts except exploded like the AC3D object->explode function. So something like below, except with more parts and in more random directions.

(http://i46.tinypic.com/18gdo3.png)

I know there is a .dda ascii fileformat, because I saw it mentioned here on the forum. But I don't know what it can do or how I can use it. I suspect that I could create a model and then edit the animation in by hand, because it is only 2 frames of animation, and only a few vertices that represent the debris. Maybe I can just write a small program to generate the data and write it to an a ascii text file. But where can I find documentation on the file format?

Also, there is Convert3D program in the GLBasic tools folder, it has buttons labeled "(+) keyframe" and "(-) keyframe" but I don't know how to use this program or what it can do. Is there any documentation on this tool?

So the question is, how to do a simple animation? :nw: Any help would be appreciated
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-04
Quote from: BdR on 2013-Feb-03
...
Also, there is Convert3D program in the GLBasic tools folder, it has buttons labeled "(+) keyframe" and "(-) keyframe" but I don't know how to use this program or what it can do. Is there any documentation on this tool?

So the question is, how to do a simple animation? :nw: Any help would be appreciated

The + or - keyframes you use to add same object but deformed, like press + and add your second circle (as an independent object).
I usually use OBJ files there.

I think they must have same numbers of points and faces.
I think someone did a 3d explosion not too long ago, it is somewhere on the forum too.

I could be wrong though. ;/
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: mentalthink on 2013-Feb-04
HI Bdr, I think the best way for make 3D explosions, it's using a particle System... the problem it's the cost of CPU...
I have another way for make explosions, very easy...
Whit some planes, rotated in the 3 axis, you draw planes and put in the texture channel, some animation... in example 25 frames, and the you play this images ... You will have a very simple explosion, really not it's a good 3D, but can be very usefull...

Another way , if you want do this whit an object, the best way I think it's, get your model, and cut it in parts, this initial positions, you leave like in your 3D soft, then put all the XYZ into an array, and then into GLbasic, make a routine for lanunch this pieces of your objects, making a movement...

Very Simple, Cos(soma angle)*vector (the vector it's a counte), and the same for the Sinus... and you can draw, an FX, whit shape like an Sphere...

If you this last I told you and the planes whit the sequence of imagens in .PNG, you can obtain a good results...

PS: I'm planning to do a Particle system, very simple and customizable but for noe it's only an idea...
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-04
Bdr, say, do you need that explosion in a flat 3d? or do you want it to have volume/transparencies?
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: Schranz0r on 2013-Feb-04
"Billboards" and alphamode?
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: BdR on 2013-Feb-04
I've got a simple 2D-like explosion working now, like pictured in opening post. I exported my object from AC3D to 2 objs (frame 1 and frame 2), then convert with Convert3D, then in my app I can animate it with X_DRAWANIM :good: excellent. However, it seems the OBJ file doesn't keep color values, my object was red but in GLB it is light blue.

erico: yes I want the explosion to have more 3D volume, instead of just flat.
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-04
how many polygons in average do you think you could use for that?
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: BdR on 2013-Feb-04
I don't know how many polygons, around 20 to 40 I guess. How can I test the total amount polygons of the scene I'm drawing? Is there some count-polygon command? I can't search my helpfile (http://www.glbasic.com/forum/index.php?topic=8896.0) :doubt:
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-04
You can always use the excelent AGOSE by Hemlos to count your polys!
http://www.glbasic.com/forum/index.php?topic=8764.0
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: kanonet on 2013-Feb-04
There is no command to count all rendered triangles, you need to calc this manually.
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-04
You could assemple a mock scene on your 3d package and count them there.
Or you could save this all assemled mock scene as a single object and give it a try to check performance.
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-05
Another question, what kind of explosion are you looking for?
Is it realistic, cartoon, etc? Do you have any visual reference?
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: matchy on 2013-Feb-05
What really is an explosion visual effect because not everything has to include fire and hydrogen? The simplest way I found is the increase the scale of a mulit-pointed 3d star and rapidly spin it whilst animating the texture. That's only one mesh object (no key anim) and low res sprite keeping the game smooth when blowing up a fleet, for example.
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-05
That is a really good path Matchy! It sure can resolve in a great fashion!

I was wondering myself how to get some volume going, maybe using 2 polyhedron so not to get it repeated?
Maybe calculating some fluids end explosion into voxels and then convert that to polygons?

Abstract objects, like an explosion, are really interesting!
I´m quite found of japonese explosions and pixel art ones too, there must be a way to do it in low poly and keep a possible variation asset and good textures.
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: BdR on 2013-Feb-09
I know how to make an .ddd with 2 animation frames by exporting from AC3D to .obj. However, the Convert3D tool seems to remove all colors from .obj models.

I've just made a post in the Bug Reports (http://www.glbasic.com/forum/index.php?topic=8910.0) about this.
Title: Re: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: erico on 2013-Feb-09
The OBJ format is quite weird and has some variation from package to packages.
Are you sure it is not something like that?

The 3dconverter tool won´t work with the OBJ coming out of lightwave 3d.
It works with Blender version of OBJ.

But you are right, just tested an OBJ from blender, comes gray.

Can you color them by UVmap as a quick solution?
Title: Create explosion animation in .ddd/.dda or how to edit .dda?
Post by: Kitty Hello on 2013-Feb-09
Don't use colors. They are slow on mobiles. Use a texture instead.