voxel

Ray voxel intersection

こ雲淡風輕ζ 提交于 2019-12-01 03:03:42
问题 I want to test for an intersection of a ray with a voxel field. I could naively crawl through the voxel field by calculating a ray-box intersection with the edge of the current voxel, then doing the same for the next voxel until I hit something. But isn't there a faster way to trace through a voxel field? I was thinking something along the lines of Bresenham's line algorithm in 3D, something that could quickly give me all of the cells a given line intersects. Anyone done this before? Due to

Detect rings/circuits of connected voxels

China☆狼群 提交于 2019-11-30 09:38:44
问题 I have a skeletonized voxel structure that looks like this: The actual structure is significantly larger than this exampleIs there any way to find the closed rings in the structure? I tried converting it to a graph and using graph based approaches but they all have the problem that a graph has no spatial information of node position and hence a graph can have multiple rings that are homologous. It is not possible to find all the rings and then filter out the ones of interest since the graph

Ray - Octree intersection algorithms

假装没事ソ 提交于 2019-11-28 16:34:32
I'm looking for a good ray-octree intersection algorithm, which gives me the leafs the ray passes through in an iterative way. I'm planning on implementing it on the CPU, since I do not want to dive into CUDA just yet :) At the moment, my Voxel raycaster just does 3D DDA (Amanatides/Woo version) on a non-hierarchic array of XxYxZ voxels. You can imagine that this is pretty costly when there's a lot of empty space, as demonstrated in the following picture (brighter red = more work :) ): I've already figured out that there are two kinds of algorithms for this task: bottom-up , which works from

Walk a line between two points in a 3D voxel space visiting all cells

♀尐吖头ヾ 提交于 2019-11-28 09:26:11
I have a line-of-sight problem I need to solve by visiting all possible cells in a 3D voxel space between two (non-grid-aligned) points. I have considered using a 3D Bresenham algorithm, but it will skip out some cells. A naive implementation might be to just check points along the line at a higher resolution than the voxel grid, but I was hoping for a more intelligent solution. Anyone got any leads? Came up with this, or see: http://jsfiddle.net/wivlaro/mkaWf/6/ function visitAll(gx0, gy0, gz0, gx1, gy1, gz1, visitor) { var gx0idx = Math.floor(gx0); var gy0idx = Math.floor(gy0); var gz0idx =

Basic Dual Contouring Theory

断了今生、忘了曾经 提交于 2019-11-28 03:36:42
I've been searching on google, but cannot find anything basic. In it's most basic form, how is dual contouring (for a voxel terrain) implememted? I know what it does, and why, but cannot understand how to do it. JS or C# (preferably) is good.Has anyone used Dual contouring before and can explain it briefly? Mikola Ok. So I got bored tonight and decided to give implementing dual contouring myself a shot. Like I said in the comments, all the relevant material is in section 2 of the following paper: Original Version: http://www.frankpetterson.com/publications/dualcontour/dualcontour.pdf Archived

Ray - Octree intersection algorithms

北城以北 提交于 2019-11-27 19:56:58
问题 I'm looking for a good ray-octree intersection algorithm, which gives me the leafs the ray passes through in an iterative way. I'm planning on implementing it on the CPU, since I do not want to dive into CUDA just yet :) At the moment, my Voxel raycaster just does 3D DDA (Amanatides/Woo version) on a non-hierarchic array of XxYxZ voxels. You can imagine that this is pretty costly when there's a lot of empty space, as demonstrated in the following picture (brighter red = more work :) ): I've

Drawing 3D sphere in C/C++

倾然丶 夕夏残阳落幕 提交于 2019-11-27 05:31:12
I am looking for an algorithm which can draw a nice looking 3D sphere on small resolution. I found Bresenham's circle algorithm but it's for 2D drawing. I just need spheres borders (I don't need it filled). I also googled for a solution of the problem but I didn't find anything. This article doesn't help (what is the brute force algorithm?). I can't use any OpenGL libraries, I need vanilla C/C++ solution. Thank you in advance. if I get it right you want to render all surface Voxels of sphere The brute force is O(R^3) . If you just project rays from plane and compute the 3-th coordinate then

Walk a line between two points in a 3D voxel space visiting all cells

最后都变了- 提交于 2019-11-27 02:53:36
问题 I have a line-of-sight problem I need to solve by visiting all possible cells in a 3D voxel space between two (non-grid-aligned) points. I have considered using a 3D Bresenham algorithm, but it will skip out some cells. A naive implementation might be to just check points along the line at a higher resolution than the voxel grid, but I was hoping for a more intelligent solution. Anyone got any leads? 回答1: Came up with this, or see: http://jsfiddle.net/wivlaro/mkaWf/6/ function visitAll(gx0,

Representing voxels with matplotlib

拜拜、爱过 提交于 2019-11-26 09:43:36
问题 In Python, given a N_1 x N_2 x N_3 matrix containing either 0s or 1s, I would be looking for a way to display the data in 3D as a N_1 x N_2 x N_3 volume with volumic pixels (voxels) at the location of 1s. For example, if the coordinates of 1s were [[1, 1, 1], [4, 1, 2], [3, 4, 1]] , the desired output would look like this It seems that the mplot3D module of matplotlib could have the potential to achieve this, but I haven\'t found any example of this kind of plot. Would anyone be aware of