0

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 :-(

TomsaJan
  • 27
  • 4
  • Can you explicit which ray doesn't work (`directionRay`, `gravityRay` or both), what's the meaning of these both ? Also, maybe you should have a look to http://stackoverflow.com/questions/18546875/three-js-pointerlock-and-collision-detection ? sorry if it's not related – vincent Oct 31 '13 at 13:41
  • Both rays doesn't work with scene loader, cause they can't find intersect with loaded model (in fact, they can - viz edit). But I still can't find out, if my problem is in rays (not so possible - same functions worked with JSON loader) or if this is bug within scene loader.. Question is related, but solves stg else. Oh, and meaning - gravity raycaster casts a ray in direction (0,-1,0) to detect items under feet, so I can decide when to stop my model. Direction ray is not important at the moment, it's just a ray in direction of camera to decide what am i looking at. – TomsaJan Oct 31 '13 at 15:14
  • ok. are you sure your `models` variable contains the good object ? also, did you tried with the `recursive` option ? – vincent Oct 31 '13 at 15:22
  • Recursive has no meaning in this case (btw. already tried). I'm loading models with no descendants. And when i'm loading my model with scene loader, I cut of as many problematic parts, as I could - I use just intersectObject(), instead intersectObjects(), where models passed to this functions are filled above problematic part with loaded object named Zdi (means walls). Also object found with gravityRay (see edit) corresponds with object named Zdi (to the walls of my room). Thanks for trying to help me, I appreciate it a lot! – TomsaJan Oct 31 '13 at 15:40

0 Answers0