我试图在我使用正交相机的场景中挑选物体.我的代码片段已经有效,但不准确.我已经在stackoverflow上找到了一些答案,但是这些已被弃用或根本不再有效.这是我的代码onMouseDown
function onDocumentMouseUp( event ) {
event.preventDefault();
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
var vector = new THREE.Vector3(mouse.x, mouse.y, 0.5);
var pos = camera.position;
var ray = new THREE.Raycaster(pos, vector.unproject(camera).sub(camera.position).normalize());
var intersects = ray.intersectObjects(objects);
if (intersects.length > 0) {
console.log("touched:" + intersects[0]);
}
else {
console.log("not touched");
}
}
Run Code Online (Sandbox Code Playgroud)
请参阅http://jsfiddle.net/ujzpe07t/1/
如果你点击立方体左/右/上/下的一些像素,它仍然告诉我对象被触摸了.
我正在使用three.js r69.
任何提示都将非常感激.谢谢,干杯!
我在iOS应用程序中分配给accessibilityLabel的一些文本包含"混合语言".
例如,在德语中,文本将是"Bier und guter Sound".用德语VoiceOver语言说的"声音"这个词没有意义(它应该说"saund",但听起来像"sund").
有没有办法说出有关单词语言的信息?