Maybe we can get better implicit meshes

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Maybe we can get better implicit meshes

Post by kattle87 »

Ville, could you check this?
http://local.wasp.uwa.edu.au/~pbourke/g ... /source1.c
It's a standard Marching Tethraedrons algorithm like we have now. The only big difference is that the point for the triangle is obtained through linear interpolation of the value of the vertexes of the tethraedron. I've started thinking about it and it sounds to me it might be a huge difference from what we have now with very little coding.
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Interesting. The difference is in the VertexInterp which makes linear interpolation between points. This should be compared to the Converge-function in ZGE:s polygonizer that instead finds the crossing point by repeatedly calling the implicit-function until it is close enough to the surface or 10 attempts are tried.

We can try interpolation instead, however it seems to me like it would result in faster execution at the cost of polygon accuracy. The converge-function makes a more accurate approximation of the surface while the VertexInterp-function guess the value by interpolation?
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Yes the converge function used by ZGE is a standard bisection method. In theory it's enough accurate but it's actually really computational-intensive. One can always make 3 or 4 times the linear interpolation per vertex and maybe we get good results too.

However, even if we do retain the bisection method, I feel like there's no need of always making 10 iterations! The best woud be doing 10 iterations only to find the starting point, then changing the RES value to something like 4 or 5. Give it a try :P
Idea is: set RES as a variable, not a const. Then before and after the line

Converge(TIn.P, TOut.P, TIn.Value, Self.Start);

add the lines:
RES := 10; //or even 20 :P
Converge(TIn.P, TOut.P, TIn.Value, Self.Start);
RES := 4; //or something similar: error will be less than 1/(2^5);
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

I have a proposal of changing the code for the implicit mesh generation algorithm.
I know that marching cubes algorithm needs a giant lookup tables, but since we do now have the zeroing of unused code, the increase would be noticed only if someone used the implicit generator, am I right?
I'm asking this since I feel like this component had a great potential but it's really too "buggish" to be used: it produces strange artifacts with no apparent reason and makes meshes with tons of "extra" triangles. I would love to see if a different implementation could give different results.
I know this might sound dull, but I think that no one ever used this component in a serious project because it's behaviour is not predictable.
Maybe we could also break backwards compatibility (if we need to change some component properties) because I think no one has used this in a project (we need approval by all of the active users of course).
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I would welcome a more stable implicit mesh algorithm that will produce better quality geometry. I also agree that backwards compatibility is probably not very important here (if someone disagrees then speak up now :) ).

But what algorithm can we use? I remember that we've discussed this before here.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Yup backwards compatibility is not an issue for me on this one, and yes I don't use it much for the reasons noted,. I would enjoy more mesh generation stuff (and/or subdivision smoothing to do http://www.topmod3d.org/ type complexification work) ,. so a new approch would be good imho.

here is sht load of quite interesting and well organised info., with some licencing issues, however interesting for learning purposes;

http://www.cgal.org/

and these guys are doing some cool stuff,. fully comercial, but insperational;

http://www.groboto.com/

Anyway have fun and good luck!
iterationGAMES.com
Post Reply