2
\$\begingroup\$

I've been attempting to convert this Javascript code into a C# (Unity3d) script. It is an implementation of Naive Surface Nets explained here if that helps.

My translated C# script does compile without errors/warnings but the result is a broken (but recognizable) mesh: C# Script in Unity3D

I've also noticed that the vertices look reasonably correct: enter image description here

If you can't already tell, the input voxels are just simplex noise.

I'd really like to get this working, but I am not well versed with Javascript. If anyone would like the Unity project, here it is. Can someone who knows both languages well tell me what I've missed? Thank you.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Your best bet is to run both projects and debug them. Step through the code, find out where the variable values diverge between the two. Alternatively, you can try asking on a site that's more open to these types of questions, like gamedev.net or reddit.com/r/gamedev \$\endgroup\$ – MichaelHouse Jul 31 '16 at 3:21