|
From: Per W. <pw...@ia...> - 2004-04-15 15:20:31
|
You are drawing the volume as cubes? With the marching cubes algorithm, you just process a volumetric data sampled in the corners of a grid. When processing the grid, you detect cases where each cube have corners that are both above and below the threshold of the volumetric data. Depending on which edges of all the processed cubes are switching side, you generate zero or more triangles. The "marching" part of the algorithm is that by processing the cubes in sequence, you will know which triangles are neighbours to each other, thereby allowing you to detect and handle multiple volumes within the data set. Do display the triangles, you may just process them as any other 3D triangles in a 3D engine, such as OpenGL or DirectX. /Per W On Thu, 15 Apr 2004, michele wrote: > Hi Jan (thank you and thank you Per)... > >>>The testing if the point is inside would be pretty simple. I expect you have some equations that define the conditions. Then setting each point of 3D grid into > >>>this equations would do the work. Then if all the quations are valid, then the point is inside. > > Yes it's exactly what I have done.. and really isn't difficut, the real question is how to render that volume ( now I have a pretty rapresentation (but 'discontinuous')... I draw a little cube in corrispondence of every point inside the surface). > > > But I have found... Another good article (by Paul Bourke) with c code (OpenGL): > http://astronomy.swin.edu.au/~pbourke/modelling/polygonise/ > I think this will be very helpful (for me and for all interested) and so I signalize you. > Bye > > > > ----- Original Message ----- > From: Jan Ringos > To: michele > Sent: Wednesday, April 14, 2004 6:36 PM > Subject: Re: [Dev-C++] marching cubes (3D) > > > Hello Michele. > Yes I am interested but I am not sure if I can help you. > I read the articles but I can't imagine how to find the border points. > > The testing if the point is inside would be pretty simple. I expect you have some equations that define the conditions. Then setting each point of 3D grid into this equations would do the work. Then if all the quations are valid, then the point is inside. > > Hope it helps... > --- > Jan Ringos, Tr...@mx... > http://Tringi.Mx-3.cz > > ----- Original Message ----- > From: michele > To: Jan Ringos > Sent: Wednesday, April 14, 2004 3:23 PM > Subject: Re: [Dev-C++] marching cubes (3D) > > > hi Jan, > if you are interested... > What I have to do is to render a 3D volume from sampled points (certain conditions define that volume)... > > So what I do is to divide the 3D space in a 3D grid and to test each point of this grid to know if it is inside or outside my suface... > Regards > (if you have some suggestions let me know! thanks) > > > > ----- Original Message ----- > From: Jan Ringos > To: michele > Sent: Friday, April 09, 2004 6:44 PM > Subject: Re: [Dev-C++] marching cubes (3D) > > > Very interesting. But honestly I see no use for it. In game I would instead use something like height-map or model with clipping definitons. > But I don't know what specific are you want to do with it. Anyway It shouldn't be too difficult to implement exact use. > > --- > Jan Ringos, Tr...@mx... > http://Tringi.Mx-3.cz > > ----- Original Message ----- > From: michele > To: Jan Ringos ; DEV-C++ > Sent: Friday, April 09, 2004 10:18 AM > Subject: Re: [Dev-C++] marching cubes (3D) > > > Hi... > > "The marching cubes algorithm is used in volume rendering to construct an isosurface from a 3D field of values. > The 2D analog would be to take an image, and for each pixel, set it to black if the value is below some threshold, and set it to white if it's above the threshold. Then smooth the jagged black outlines by skinning them with lines..." [James Sharman] > > if you (and someone else) want to read some interesting articles about marching cubes: > Introduction: > http://www.exaflop.org/docs/marchcubes/ind.html > > Article with some c code: > http://www.cfxweb.net/modules.php?name=News&file=article&sid=199 > (more available at http://matrix.netsoc.tcd.ie/~nash/metaballs/src/ gently by Nicholas: nn...@st...) > |