简体   繁体   English

构建自定义的 Threejs 几何

[英]Building a custom threejs geometry

I need to generate a Threejs geometry which is more or less a cube, but with a dent on the top plane formed by a quadratic curve.我需要生成一个 Threejs 几何体,它或多或少是一个立方体,但在由二次曲线形成的顶部平面上有一个凹痕。 Like this, but upside down and dent extending over the entire plane:像这样,但上下颠倒并在整个平面上延伸:

https://www.iconfinder.com/icons/3144889/cube_dent_elastic_erosion_pack_push_soft_icon https://www.iconfinder.com/icons/3144889/cube_dent_elastic_erosion_pack_push_soft_icon

How do I build this geometry?我如何构建这个几何图形?

Thank you谢谢

In blender, you could subdivide a cube and then use proportional vertex editing to pull that middle vertex in and you can get that profile.在搅拌机中,你可以细分一个立方体,然后使用比例顶点编辑来拉那个中间顶点,你就可以得到那个轮廓。 Then optionally set smooth shading and add an edge split modifier.. export as .glb.然后可以选择设置平滑着色并添加边缘分割修改器.. 导出为 .glb。

THREE.BoxGeometry(); The box geometry object might not suit your since it only takes in 8 vertices as arguments.盒子几何对象可能不适合您,因为它只接受 8 个顶点作为参数。

If you want to add a custom shape, you can refer to here , and the buttom curve cylinder extrude can be made with var geometry = new THREE.CylinderGeometry() at here如果你想添加自定义形状,你可以参考这里,底部曲线圆柱挤出可以在这里使用var geometry = new THREE.CylinderGeometry()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM