ray intersect not working in sphere

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????
Adding the sphere is not the problem. You are using trackball controls and orbit controls at the same time. Your ray-casting logic is buggy. You have console errors... Doing ray-casting inside the render loop is probably not a good idea. You need to simplify your code and start over.

以上就是ray intersect not working in sphere的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏