An easy explanation to Dual Contouring?

Started by
24 comments, last by JoeJ 6 years, 5 months ago
1 hour ago, JoeJ said:

You have not understood Surface Nets.

Other people might come to this post and hoping to get some help understanding Dual Contouring and while they try to get some compact help and some visuals they need to read through 3 posts of one guy who argues about whether a computer game has used Dual Contouring or not. This thread is about finding a easy explanation/implementation to Dual Contouring and I have already told you that I don't want to discuss here what algorithm they used there. Because I don't care about it. I just want to get a working Dual Contouring algorithm and maybe help some other people too.

--------------------------------------------------------------

11 hours ago, sjhalayka said:

@QuesterDesura -- can you please share your code on GitHub?

I have been continuing working on the Unity Project and made some progress. Sadly it seems like my way of making a mesh out of the crossing corners seems to be rather bad. What I now came up is somehow working but sadly the normals are inverted in some cases.

I have added as many comments as I could so it's easy to follow what I'm trying to do. I have used most of the stuff from the github project of emilk but I'm not quite sure how they triangles are being created there. Maybe you have an idea how I could do it.

I have added .unitypackage here and the two C# files can be found here: https://github.com/PowerOfCreation/Dual-Contouring.

Normals are inverted:

1Zt97hx.png

My current approach is to find the closest 2 corners with a sign change to a corner with a sign change. Then I create a triangle between this 3 corners and mark them as processed. The processed ones won't try to create another triangle but in case a other corner needs corners to form a triangle then they can be reused.

DualContouring.unitypackage

Advertisement
44 minutes ago, QuesterDesura said:

Other people might come to this post and hoping to get some help understanding Dual Contouring and while they try to get some compact help and some visuals they need to read through 3 posts of one guy who argues about whether a computer game has used Dual Contouring or not. This thread is about finding a easy explanation/implementation to Dual Contouring and I have already told you that I don't want to discuss here what algorithm they used there. Because I don't care about it. I just want to get a working Dual Contouring algorithm and maybe help some other people too.

Maybe those other people ARE interested in less known alternatives, you already made clear you are not.

Also, YOU brought up the game and said this is what you want.

Sorry for wasting space in your thread (and my time in trying to help), while you are allowed to repeat yourself and being rude. Work on your social competence!

No worries: End of conversation.

 

I have cleaned some stuff up in the code and tried a different scenario. As far as I can see it connected all the triangles correctly wich is great :). Sadly I still didn't figure out how to fix my problem with the normals facing sometimes in the wrong direction. I have updated the GitHub project and put the new .unitypackage here as well.

dRcGRsi.png

DualContouring.unitypackage

This is a general reminder to keep the conversation civil.  Some private warnings have been issued.

No more personal attacks.  Let's keep it focused on the topic of the mesh data processing.

1 hour ago, frob said:

This is a general reminder to keep the conversation civil.  Some private warnings have been issued.

No more personal attacks.  Let's keep it focused on the topic of the mesh data processing.

Quote

Note for member

Several of your replies in the Dual Contouring discussion have been abusive, and a few border on useless. In one reply you state that you don't remember a technique but it is better. In another your declare that the person asking the question doesn't understand your answer in an insulting way, yet make no attempt to help them understand.

Some of the replies include subtle personal attacks, which are not tolerated on this site.  Statements like "stop being rude" and "work on your social competence!" are not okay.

Please tone it down.  Replies should generally help people learn and become better game developers, not insult them.

Well - fair enough. I apologize for being rude myself, instead i should have explained why Questers quoted commend was wrong:

If you look yourself to the video, it's clearly visible that the geometry is just a deformation of grid aligned cubes. Deformed cubes can of course have sharp features. Dual Contouring would contain intersections with the grid and also new geometry inside the cubes for the sphere shown in the video. (I did not say Surface Nets are 'better', just 'easier to implement' - so probably attractive for a beginner.)

Quote

I have already said: they clearly say on their website they are using Dual Contouring. But that's really not what I want to discuss here.

I won't commend on why they state on their website their technique is BASED on dual contouring (whatever that means exactly), but you see that there was no interest in any further explantation as you suggest.

And that made me angry because of the time it took me to find information about the technique i remembered. I still perceive this reaction as ignorant. Asking for help and then rejecting valid points it is not nice either and contradicts public discussion.

But i took that much too personal. Shouldn't get upset that fast, even on a bad day.

Sorry again, guys!

Edit: ... and sorry for wasting even more space;)

This topic is closed to new replies.

Advertisement