我正在一个项目中,该项目想移动小对象并使用ThreeJS库在360图像中显示它们。因此,我在具有一定半径的球体中使用球坐标系来移动对象。用户开始在球体的中心看到该应用程序。我想在球体上显示一些网格辅助线(非常类似于经度和纬度线)。我从库中的here中找到了以下代码:
var radius = 10;
var radials = 16;
var circles = 8;
var divisions = 64;
var helper = new THREE.PolarGridHelper( radius, radials, circles, divisions );
scene.add( helper );
但是它只会在场景中添加一个带有一些圆的极板,而不是一个球形网格助手。
PolarGridHelper
是一个平面。如果要使用球形几何图形,请使用SphereBufferGeometry
并为其提供线框外观:
SphereBufferGeometry