sayajin at June 10th, 2010 20:51 — #1
is there an algorithm for split a single 3d object into several other object dynamically ?
reedbeta at June 10th, 2010 20:53 — #2
You'll need to be more specific...how do you want to split the object? What kind of sub-objects do you want to extract? What are you trying to do?
sayajin at June 10th, 2010 21:13 — #3
Suppose I have an 3d Object, and inside that object i choose a point randomly. From that point for example i choose the plan in the X axis, that plan cut the object in two part (one upside the X plan and the other donwside the Y plan). That i want is to split that object along the X plan. But finally i could do that with any object 3D and any plan that cut the 3d object, even several plan !
samuraicrow at June 10th, 2010 22:55 — #4
I know of a program that does that for you called ParaView. It is used in medical and scientific applications. I wrote plugins for it at my previous job as a contractor. It uses a slow but very accurate OpenGL wrapper called the Visualization ToolKit. See http://www.paraview.org/ and http://www.vtk.org/ for more information.
geon at June 11th, 2010 06:27 — #5
That's basically what you would do thousands of times when you build a BSP tree.
First of all, don't think in terms of the x, y or z axis. If you split a 3d object you need a plane. This plane could be defined by a normal and a distance along the normal from origo.
With triangles completely on either side, it's trivial. But some triangles will probably intersect the split-plane. They need to be clipped.
Google will serve you from here...
rouncer at June 12th, 2010 06:36 — #6
This goes under geometry tools, they are pretty tough unless youve done it heaps of times.
Its actually what im specialized at splitting triangles in 2, ive recently written csg for a modeller and it works perfectly.
z80 at June 12th, 2010 15:29 — #7
If you want to do it at render time (the term "dynamically" kinda hints that) it might be fairly easy to do in a vertex shader assuming you understand the method (which geon already explained).
rouncer at June 12th, 2010 21:37 — #8
Also, if its dynamic and its only "visual" it might not be important to keep model integrity perfect.
If it was actually in a modelling program, then you would need to chop all the tri's perfectly, but if its just visual, like (id imagine maybe youd like to cut a guy in half with a sword?) then if your repeating vertices, triangles arent actually connected it doesnt actually really matter and you could get away with a cheaper easier to write algorythm.
rouncer at June 13th, 2010 06:15 — #9
Hey I got another idea, if you want a visual effect, you could draw the model multiple times with culling planes knocking off the part of the model thats chopped off... you know how to do that? In direct x its easy.