three.js图片对象缩放以适合对象

时间:2018-09-07 02:30:23

标签: three.js

我确实使3d对象成为动态对象,并且我希望透视相机缩放以适合对象 但它不起作用,我不知道该如何寻求帮助!!!

动态对象添加是这个

RewriteEngine On 
RewriteCond %{HTTP_HOST} !^example\.com 
RewriteRule (.*) http://example.com/en/$1 [R=301,L] 

并且我进行光线投射鼠标按下事件,并且我希望缩放以适合对象 代码是

在此处输入代码

enter code here
    function plusobject(witch,clicknum) {

   //var geometry = new THREE.BoxGeometry( 5,5,5 );
   var geometry = new THREE.RingBufferGeometry( 2.4, 6,30,1,0,6.3 );
   //var geometry = new THREE.RingGeometry( 2.4, 6,30,1,0,6.3 );
   var material = new THREE.MeshBasicMaterial( { color: 0x610B38 } );
   material.side =  THREE.DoubleSide;
   var mesh3  = new THREE.Mesh( geometry, material );
   mesh3.name =  clicknum;
   mesh3.userData.id =  clicknum;

    witch.x += 3;
    witch.y += 5;
    witch.z += 3;
    mesh3.position.set(witch.x , witch.y, witch.z);

    mesh3.castShadow = true;
    mesh3.receiveShadow = true;



    scene.add( mesh3 );
} // plusobject END 

我需要帮助

0 个答案:

没有答案