在three.js中更改几何类型

时间:2018-07-26 20:40:36

标签: three.js

如何在three.js中将几何类型从.spherical更改为.SphereBufferGeometry

https://codepen.io/anon/pen/ajyvyB

        // sphere
        var vector = new THREE.Vector3();
        var spherical = new THREE.Spherical();
        for ( var i = 0, l = objects.length; i < l; i ++ ) {
            var phi = Math.acos( -1 + ( 2 * i ) / l );
            var theta = Math.sqrt( l * Math.PI ) * phi;
            var object = new THREE.Object3D();
            spherical.set(1000, phi, theta );
            object.position.setFromSpherical( spherical );
            vector.copy( object.position ).multiplyScalar( 2 );
            object.lookAt( vector );
            targets.sphere.push( object );
        }

0 个答案:

没有答案