Return to “Technical”

Post

Re: Concave polyhedras

#2
Thanks!

Unfortunately, not nearly as easily. Distance fields for concave polyhedra is a tough problem, but is of great interest since it is basically the same problem as distance fields for arbitrary triangles meshes. The formula I gave will not work for concave polyhedra, I believe it will yield a convex result even if you give it a concave set of planes.

Best I can suggest for concave objects is to perform convex decomposition, use this formula, and combine the pieces with a min over all of them (equivalent to union on the fields). Sadly, not very intuitive or easy (the decomposition step, at least).

Oh well :/
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Concave polyhedras

#5
On that topic, how easy is it to join (union) different polyhedra together? Obviously a ship is comprised of many different polyhedra, and joining then with operations that removes lighting/normal/texture/etc seams is something that is necessary (normal seams especially are the bane of my (modding) existence, but that's another story). Simply allowing the user to create concave ships using parts from a collection of convex shapes will be sufficient, as long as there's some way of joining stuff together.
Post

Re: Concave polyhedras

#6
Gazz wrote:So what about distorted / dented shapes to visualise combat damage?

The whole point about the approach is that objects can be altered instead of consisting of a static mesh, no?
Oh yes, no problem. The polyhedron formula is just a primitive type, but on top of it I can union other primitive types, then I can take that surface and bend it, destroy it with procedural noise, etc. The whole point of the approach is that it simplifies many operations, one of which is easy geometric computation on the mesh, which, as you say, will allow us to alter it to produce dynamic effects like destruction. Whether it will be able to compute the surface fast enough for us to actually chip pieces away exactly where bullets hit is another question, but certainly it will be possible to take the ship mesh and compute "broken" pieces of it, then use these to indicate combat damage.
Phibrizo wrote:Thank you for the answer,

Is it possible to calculate your picture by using some kind of trick ? Cannot you do the calculus indirectly by using your algorithm on the complementary convex polyhedra, someting like Babinet's principle ?

I hope my english is clear enough... :oops:
Sorry, I don't really understand the question or how this link that you provided relates, but yes, there are many tricks that you could use to calculate the picture via other methods. As for the surface normals, yes, can do the calculus indirectly by the finite differencing method, but, as I said, it produces significantly lower quality results, and will be slower than using the real math.
jimhsu wrote:On that topic, how easy is it to join (union) different polyhedra together? Obviously a ship is comprised of many different polyhedra, and joining then with operations that removes lighting/normal/texture/etc seams is something that is necessary (normal seams especially are the bane of my (modding) existence, but that's another story). Simply allowing the user to create concave ships using parts from a collection of convex shapes will be sufficient, as long as there's some way of joining stuff together.
Bordering on triviality, actually. In distance field space, unioning f(x, y, z) and g(x, y, z) is just min(f(x, y, z), g(x, y, z)), which is both cheap and ridiculously simple. My implementation uses a bit fancier math to perform a continuous union, so that the shapes smoothly blend into one another (you can control the smoothness), and also so that there are no normal seams, which you mentioned. So there will be no seams whatsoever in these meshes :)

And of course, I can allow creation of concave ships via unions (and subtractions, which are even more exciting!!), no problem at all. I am particularly excited about subtraction, as it is notoriously hard to perform on triangle meshes, and I have yet to find a CSG implementation that can accurately subtract arbitrary shapes. With this approach, as I said, it's mind-numbingly simple.

I am not positive that this technology will be available in the ship editor, because, as I said, it might be too slow. However I'm about to start working on a GPU solution that should be quite fast...we'll see. Wish me luck :)
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Concave polyhedras

#7
Well, I was wondering if it was mathematically feasible to replace a "difficult" calculus done on a concave polyhedra by another one but "easy", done on the complementary convex polyhedra.

Maybe my english is not good enough... or maybe my question make no sense, i am not a CGI artist :oops:

Online Now

Users browsing this forum: No registered users and 7 guests

cron