码迷,mamicode.com
首页 > 其他好文 > 详细

模型按一个圈摆放(10等分)

时间:2020-03-14 18:33:37      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:运用   mamicode   set   inf   UNC   position   src   on()   function   

技术图片

var R = 320;
 function setPosition(){
            pivot2.position.x  = -    Math.sin(Math.PI/5)*R;
            pivot2.position.z = Math.cos(Math.PI/5)*R;
            pivot2.rotation.z = -Math.PI/10*3;

            pivot3.position.x  = 0;
            pivot3.position.z = R;
            pivot3.rotation.z = -Math.PI/2;

            pivot4.position.x  = Math.sin(Math.PI/5)*R;
            pivot4.position.z = Math.cos(Math.PI/5)*R;
            pivot4.rotation.z = Math.PI/10*13;

            pivot5.position.x  = Math.sin(Math.PI/10*4)*R;
            pivot5.position.z = Math.cos(Math.PI/10*4)*R;
            pivot5.rotation.z = Math.PI/10*11;

            pivot6.position.x  = Math.sin(Math.PI/10*4)*R;
            pivot6.position.z = -Math.cos(Math.PI/10*4)*R;
            pivot6.rotation.z = -Math.PI/10*11;

            pivot7.position.x  = Math.sin(Math.PI/5)*R;
            pivot7.position.z = -Math.cos(Math.PI/5)*R;
            pivot7.rotation.z = -Math.PI/10*13;

            pivot8.position.x  = 0;
            pivot8.position.z = -R;
            pivot8.rotation.z = Math.PI/2;

            pivot9.position.x  = -Math.sin(Math.PI/5)*R;
            pivot9.position.z = -Math.cos(Math.PI/5)*R;
            pivot9.rotation.z = Math.PI/10*3;

            pivot10.position.x  = -Math.sin(Math.PI/10*4)*R;
            pivot10.position.z = -Math.cos(Math.PI/10*4)*R;
            pivot10.rotation.z = Math.PI/10*1;

            pivot.position.x  = -Math.sin(Math.PI/10*4)*R
            pivot.position.z = Math.cos(Math.PI/10*4)*R
            pivot.rotation.z = -Math.PI/10;
            //
        }    

技术图片\

运用

模型按一个圈摆放(10等分)

标签:运用   mamicode   set   inf   UNC   position   src   on()   function   

原文地址:https://www.cnblogs.com/chenyi4/p/12493345.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!