Creating a cube with rounded corners in Three.js

耗尽温柔 提交于 2020-01-01 04:36:10

问题


Is it possible to create a cube with rounded corners of custom radius in three.js and then be able to texture that cube with an image?


回答1:


You can round the corners of a cube using the Loop subdivision algorithm implemented in THREE.SubdivisionModifier.

Here it is in action: http://threejs.org/examples/webgl_modifier_subdivision.html.

You can texture this geometry just as you would texture any other geometry.

three.js r.70




回答2:


For a simple and straightforward example of subdivision modifiers on cubes (and other basic geometries), check out

http://stemkoski.github.com/Three.js/Subdivision-Cube.html



来源:https://stackoverflow.com/questions/12994175/creating-a-cube-with-rounded-corners-in-three-js

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