我正在尝试将一系列平面排列成一个圆圈,“面向”中心,但是在经过 180 度后我得到了一些奇怪的结果。我的对象围绕圆圈正确分布,但旋转已关闭。我附上了截图,我的代码如下:我的方程式有什么问题?
var circleRadius = 12;
var diameter = circleRadius*2;
var centerX = -5;
var centerZ = -2.5;
var mpi = Math.PI/180;
var startRadians = startAngle + mpi;
var totalSpheres = 8;
var incrementAngle = 360/totalSpheres;
var incrementRadians = incrementAngle * mpi;
for ( var i = 0; i < totalSpheres; i ++ ) {
var xp = centerX + Math.sin(startRadians) * circleRadius;
var zp = centerZ + Math.cos(startRadians) * circleRadius;
var camObj = new THREE.Mesh( new THREE.PlaneGeometry( 1*camSize, .75*camSize ), material );
camObj.position.x = xp;
camObj.position.z = zp;
camObj.rotation.y = i*incrementAngle; //MH - do this without degrees
console.log(camObj.rotation.y);
startRadians += incrementRadians;
scene.add( camObj );
}