ray intersect not working in sphere

旧街凉风 提交于 2020-02-06 03:57:40

问题


created the sphere and the plane geometry when i ignore the sphere form scene.add() interesect work but

here is the code.. http://jsfiddle.net/praveenv29/PZeY4/

for ( var i = 0; i<10; i ++ ) 
        {
    var gloom = new THREE.ImageUtils.loadTexture('../map_pin.png' );
materialr = new THREE.MeshLambertMaterial( { color:Math.random() * 0xffffff ,side: THREE.DoubleSide} )
    var geometry = new THREE.PlaneGeometry(10,15,2, 2);
    var object = new THREE.Mesh(geometry, materialr);   
                object.position.x = Math.random() * 2 - 1;
                object.position.y = Math.random() * 2 - 1;
                object.position.z = Math.random() * 2 - 1;


                object.position.normalize();
                object.position.multiplyScalar(125 );    

    scene.add( object );
    }

and once add the sphere scene intersect not working the ( http://jsfiddle.net/praveenv29/PZeY4/1/ )

var texture = THREE.ImageUtils.loadTexture('../world.jpg'); 
materials = new THREE.MeshBasicMaterial( {color:0x000000, wireframe:true}); 

var cone = new THREE.SphereGeometry(120,25,25);

var coneMesh = new THREE.Mesh(cone,materials);

coneMesh.position.y =0;
coneMesh.rotation.set(0,0,0);   
scene.add( coneMesh );

tried in geometry merge may be some properties missing????

来源:https://stackoverflow.com/questions/13860196/ray-intersect-not-working-in-sphere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!