Create a concave half sphere with three.js

前端 未结 2 2032
时光取名叫无心
时光取名叫无心 2021-01-03 15:56

I\'m a web developer with a good js experience, and I\'m currently exploring three.js possibilities. However, I\'m not very familiar with 3D shapes and vocabulary, and I can

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-03 16:11

    You can create a half-sphere by setting the additional SphereGeometry parameters:

    SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength )
    

    Experiment until you get exactly what you want.

    You will also have to set the side property of the material you use for the sphere to either be THREE.BackSide or THREE.DoubleSide.

    material.side = THREE.DoubleSide;
    

    EDIT - SphereBufferGeometry, which is more efficient memory-wise, is now also available. Its constructor has the same arguments.

    (Three.js r.82)

提交回复
热议问题