开发者

Method for finding normals to a voxel surface

开发者 https://www.devze.com 2023-03-18 03:12 出处:网络
I was working on a method to approximate the normal to a surface of a 3d voxel image. The method suggested in this article (only algorithm I found via Google) seems to work.The suggested method from

I was working on a method to approximate the normal to a surface of a 3d voxel image.

The method suggested in this article (only algorithm I found via Google) seems to work. The suggested method from the paper is to find the direction the surface varies the most in, choose 2 points on the tangent plane using some procedure, and then take the cross product. Some Pascal code by the article author code, commented in Portuguese, implements this method.

However, using the gradient of f (use each partial derivative as a component of the vector) as the normal seems to work pretty well; I tested this along several circles on a voxellated sphere and I got results that look correct in most spots (there are a few outliers that are off by about 30 degrees). This is very different from the method used in the paper, but it still works. What I don't understand is why the gradient of f = 1/dist calculated along the surface of an object should produce the normal.

Why does this procedure work? Is it just the fact that the sphere test was too much of a special case? Could you suggest a simpler method, or explain any of th开发者_如何学Goese methods?


Using the gradient of the volume as a normal for lighting is a standard technique in volume rendering.

If you interpret the value of a voxel as the opacity, the gradient will give you the direction of the greatest change in the opacity, which is similar to a surface normal.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号