How to re-orient triangle faces in three.js

匿名 (未验证) 提交于 2019-12-03 01:02:01

问题:

* Edited with better example *

I use Three.js to display the hull of an MRI gastric image; the hull is loaded from an external file as vtk format. Here is a demonstration: http://www.menne-biomed.de/uni/3d/alphahull.html ; use space to toggle.

These are alpha-hulls computed from voxels as nicely three.js displayed in http://www.menne-biomed.de/uni/3d . I love these images. Thanks a log, Mr.doob!!

Example 1-3 are from an almost empty stomach; 4-6 are from a filled stomach.

(1) and (4) are single sided, to show that the triangles are inconsistently oriented in the vtk file.

(2) and (5) shows the problem this creates to when using doubleSided; the ugly patches are best seen on the flat side, where the stomach has been cut at the boundary of the MRI. I looks like the lighting is not symmetric on double-siding.

(3) and (6) are my workarounds: I use doubleSided=false, and have duplicated the Polygons with a different orientation: for example, 1 2 3 in the original was augmented by 1 3 2.

The solution works Ok for me, but I am not sure if there is an easier way out.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!