three.js: sceneLoader & rays issue

时间秒杀一切 提交于 2019-12-12 03:53:55

问题


Issue: Rays doesn't work with models loaded via sceneLoader

Problem explanation: I used to load my model with JSONLoader, but needed to import all information of scene, so I tried sceneLoader(). Everything loads fine, but raycasters intersectObject() function doesn't find intersections.

Old version with JSONLoader (cca line 350): http://golem.fjfi.cvut.cz/virtual/matusu/BakalarkaMM/Bakalarka.html New version with sceneLoader (cca line 900): https://www.dropbox.com/s/ikpobra4bo5iz2y/BMM.html

First I tried to use IntersectObjects(), then I focused just on one object with IntersectObject(). It didn't help. Object loaded via both methods seems the same, but with sceneLoader this method can't find any intersection.

Am I missing something?

P.S.: Sry, if I didn't mention somthing important, just tell me to do so.

Edit: After some testing, I found, that 'model loaded with scene model' program works like if there is an invisible copy of my model rotated by (Math.PI/2,0,0) - gravity ray finds intersection with invisible copy on right or left side of the room.. Model loaded with scene loader: http://golem.fjfi.cvut.cz/virtual/matusu/BakalarkaMM/BMM.html

Edit n.2: It's definitely somehow rotated object named "Zdi" - tried to rotate its geometry and other possibilities and I can't drop through that imaginary doors. Problem is, that visible walls rotates as well :-(

来源:https://stackoverflow.com/questions/19681267/three-js-sceneloader-rays-issue

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