3d formulas

Community Forums/General Help/3d formulas

Hardcoal(Posted 2013) [#1]
Any web site were i can get/ learn mesh manipulation formulas?
Fot example. I want to explode a mesh
To pieces...


Hardcoal(Posted 2013) [#2]
I guess no one knows what i want


GfK(Posted 2013) [#3]
I guess no one knows what i want
Either that, or some of us have been asleep in the eleven hours since you posted.

Fot example. I want to explode a mesh
There's no magic formula for this. You need to break up the mesh* and have each triangle as a separate entity.

* The only way you can 'break up' a mesh, is by making a copy of it, triangle by triangle, done by way of manually creating a mesh, then adding a surface to the mesh, vertices to the surface, and faces to the vertices.

How you deal with the texture part, I dunno. 3D is not my forte.


big10p(Posted 2013) [#4]
If you want to explode a mesh in Blitz3D, there's this demo I did ages ago:

http://www.blitzbasic.com/codearcs/codearcs.php?code=680

OMG, I did that 10 years ago?!?!?


ima747(Posted 2013) [#5]
There isn't really a formula to exploding a mesh, as you can define the concept a number of different ways. Further the engine and other tools (physics system?) you're trying to implement it in could drastically alter your approach.

A couple hypothetical examples:
Using an engine like B3D or MiniB3D, if you want to break a mesh apart to it's component tris and then move those away from each other to create an explosion effect:
- Create a new empty mesh
- Cycle through the existing mesh surface by surface and tri by tri and duplicate the points of each tri into a a new tri in the new mesh. This will Result in each try being un-welded from it's neighboring tri's and allow you to manage them individually. Don't forget to assign textures, and UV coordinates as needed. Also the resulting mesh will contain exponentially more verts (though the same number of tris) as the original which may result in considerably slower rendering depening on how the render pipe works in the engine.
- Place the new mesh in the same location of the old mesh and hide or delete the old mesh.
- Now you need to find an algorithm to find the center of each tri, and then animate the motion of each vertex on each tri away from the center point of the mesh relative to the center point of the tri. You want the center of each tri to move away from the center of the mesh, and the vertexes must move relative to the tri center, otherwise you will just be stretching the vertexes and the mesh will just expand not explode.
- This will produce a spherical explosion appropriate for space/air. Probably a good idea to figure out what you're going to do with the components as they explode, my guess would be fade to transparent.

That's a lot of work and each phase needs to be addressed individually and again it will depend on how your engine works as to how you go about any of those things.

If you are going for a more realistic approach to destruction where you're not blowing up the mesh, but trying to create the destruction of the object the model represents (i.e. a building crumbling rather than just a bunch of 2 dimensional triangles moving away from each other). You will need to figure out how you want to cut the mesh up into 3D sub meshes. This is usually easies to do in a modeling program and then you just run the animation of the explosion rather than actually tearing the mesh appart since the math behind creating 3D puzzle pieces out of a mesh is very complicated and the results are likely not going to be as good as if you did it with an animation suite to make it look just right. Very few games actually break things apart in real time, and don't just use some form of faking it. Red Faction is the only one that comes to mind, and it was limited to cave walls for truly dynamic destruction, building were still pre-calculated break apart models.

If you want more realism and you're using a physics system you will need to figure out how to mesh your components with the physics system to get them to behave like physical entities rather than just floating triangles/blobs/whatever.

If you're using something like Unity or another engine with plugins there's a fair chance someone has created some form of library or suite to help explode things in one way or another.

None of that really directly answers the question but hopefully it will provide a little insight on the issue and also explain why it's not likely you'll find just what your looking for, certainly not without more information on what/how you want to accomplish it...


Hardcoal(Posted 2013) [#6]
@Gfk..
All i wanted is the math concept.
Since many people did 3d editors
Like cinema 4d and some people here
Did some as well.
I thought maybe there is a website for
Mesh manipulation math..
Explode mesh was just an example..

Instead of me breaking my head doing what others already did.
You know..
Btw good morning, have a nice day ;)


@big10p
Thanks cool! ill checkit..

@ima747
Thanks for the long reply.
I know how mesh is built.
And im gonna experiment with that.

Ill post info when im done


Blitzplotter(Posted 2013) [#7]
@big10p - fantastic demonstration piece of code - bit like watching firwroks go off. 10 years ago though - doesn't time fly ?


big10p(Posted 2013) [#8]
Sure does. :)


-=Darkheart=-(Posted 2013) [#9]
Watching that demo reminded me of all the other awesome bits we've seen over the years. This place used to have so many talented coders I'm always a little surprised there weren't more real hits to come out. I can't think of a more than a few 3D titles that really stood out and were successful.

Darkheart


Blitzplotter(Posted 2013) [#10]
Doing 3d stuff indie style takes some dedication. I remember someone called grasshopper from wayback that said not all devswith B3d share the fact they've developed with it. am working on a draft website for my B3D program, it will see the light of day!


Kryzon(Posted 2013) [#11]
When I was little I used to go to the BlitzCoder gallery and drool at the projects people were doing, it was very inspiring.
Too bad that site went down.