Jump to content

Scene.pickWithRay question


isigui
 Share

Recommended Posts

Hello,

I'm loading my scene from Blender, containing a simple plane (acting as ground), a camera and a light.

I put a sphere (diam 1) on my ground and a ray with origin the center of the sphere and the vector direction (0,-1,0)

 

When I move the sphere on this ground (say on the z axis only for example) , I check the altitude of the ground with scene.pickWithRay using the predicate to exclude my sphere.

 

This works.

 

But, when my sphere  comes at the middle of the ground(for example), I clone this ground, change its id and set its position (z axis) at the end of the last ground (to fake an "infinite road").

 

My problem is that when my sphere comes on the second ground, the method scene.pickWithRay does not hit anything ..;o((

 

When I used the method Mesh.intersects(Ray), I had to express the ray in the world of the Mesh I wanted to test against.

 

But I think I read in the forum that scene.pickWithRay does not require to make this transformation.

 

Does the problem comes from the fact that I clone the "ground mesh" and set its position via mesh.position ??

 

Thanks for your help !

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...