Questions tagged [marching-cubes]

An algorithm for creating a triangular mesh from a three-dimensional scalar field, or graphing an implicit function of the form f(x,y,z) = c.

Marching cubes is a computer graphics algorithm for creating a triangular mesh from a three-dimensional scalar field, or equivalently, graphing an implicit function of the form f(x,y,z) = c.

For more information, see:

144 questions
0
votes
1 answer

Is it possible to use multiple compute buffers in compute shader in HLSL in Unity?

Is there any way to use two buffers in compute shader in HLSL in Unity? I need to use one to input some scalar values on a grid and one to get back vertex array generated by marching cubes.
Crimsoon
  • 83
  • 8
0
votes
0 answers

Implementing Transvoxel algorithm, Gaps and Odd Mesh formations

I am trying to implement the Transvoxel algorithm for a game I am working on but I'm noticing some weird issues in the mesh generated: Not sure why there are gaps and why the sphere has fins behind it. For some reason, the mesh has gaps between…
0
votes
1 answer

Physics.Raycast not working with a Marching Cubes -generated mesh

What it spits out My raycast spits out a position way off from what it's supposed to be. I'm trying to place objects procedurally on a procedural mesh. I've been scratching my head at this for a while. Please help. Sorry for the long script. The…
0
votes
1 answer

Converting indices in marching cubes to original x,y,z space - visualizing isosurface 3d skimage

I want to draw a volume in x1,x2,x3-space. The volume is an isocurve found by the marching cubes algorithm in skimage. The function generating the volume is pdf_grid = f(x1,x2,x3) and I want to draw the volume where pdf = 60% max(pdf). My issue is…
0
votes
1 answer

What do the coordinates of verts from Marching Cubes mean?

I have a 3D generated voxel model of a vehicle and the coordinates of the voxels are in the vehicle reference frame. The origin is at the center of the floor. It looks this: array([[-2.88783681, -0.79596956, 0.], [-2.8752784 -0.79596956,…
0
votes
2 answers

How does Marching Cubes work with unsigned distances?

I am working with signed/unsigned distance fields (SDFs/UDFs). I can render a mesh out of signed distances using Marching Cubes. But rendering a mesh out of unsigned distances also works using Marching Cubes, and I wonder why? I am aware of, for…
0
votes
1 answer

Marching Cubes - Getting Skewed Surfaces

I tried to plot all the iso-surfaces generated by the Marching cube LUT by Paul Brouke (http://paulbourke.net/geometry/polygonise/). I chose the vertices to be the midpoint of the edges by the triTable LUT. I am getting these highly skewed surfaces,…
Some_Guy
  • 169
  • 11
0
votes
1 answer

How to triangulate a sparxe voxel octree (SVO)

I implemented a data structure for material removal simulation based on a sparxe voxel octree (SVO). Now, I want to visualize the result. Therefore, I need to triangulate my sparse voxel octree. How can I do that? Can you recommend any fast…
Gilad Pellaeon
  • 111
  • 1
  • 1
  • 11
0
votes
1 answer

Estimating size of marching cubes output geometry

Is there a way to quickly estimate how much geometry the marching cubes algorithm will produce? As in a ballpark estimate of num verts + num faces or STL file sizes? I'm trying to implement a pre-triangulation check that tells the user to lower the…
Joshua Leung
  • 169
  • 2
  • 10
0
votes
0 answers

Marching Cubes not forming any unified mesh

I started using Babylonjs a few days ago and, as I noticed it was very simple to use and powerful, I decided to try and make marching cubes algorithm. I can’t quite understand why it isn’t working. I’ve changed the code so that I can manipulate the…
TheWebs
  • 13
  • 4
0
votes
1 answer

Unity Job System throwing range exceptions and telling me to call jobHandle.complete() even though I have it

Here's the error I cant really make sense of, I don't get why the index is -1? and all these errors im getting are offset by -1. IndexOutOfRangeException: Index -1 is out of restricted IJobParallelFor range [0...799] in…
0
votes
1 answer

Unity Mesh UV problem on the positive and negative x-axis on perpendicular walls

I am trying to make a 3D-voxel game that uses the marching cubes algorithm to procedurally generate a game world. This is working fine so far, except that, on exactly perpendicular sides on the positive and negative x sides of a given perpendicular…
RANDOM
  • 13
  • 3
0
votes
0 answers

Given edges and vertices, how to separate these into connected components?

Given edges and vertices, how can we separate these into connected components? A situation where I need this is when I extract vertices and edges by using an algorithm like the marching cube method, I want to then obtain multiple connected…
orematasaburo
  • 1,207
  • 10
  • 20
0
votes
0 answers

Is there any way to improve performance of my procedural generation code?

I've been working on a project lately that creates procedurally generated terrain which uses 3d simplex noise as well as the Marching cubes algorithm. I am currently running it on my cpu which takes around 10-20 seconds to render a 200x200x200…
0
votes
0 answers

Why does this compute shader skip every 17th buffer value?

I'm using a compute shader in unity to generate density values for the marching cube algorithm and for some it skips the calculation for every 17th value in the buffer and leaves it as 0. The code to set up the compute buffer is: public…