- 2020-08-04 at 11:04 am #31133vmtsLicensee
I’m having a trouble when I make a test for Raycasting in VR mode.
I created some objects in Blender
The yellow cube is at the origin (0,0). The position of controller is used as a origin of raycaster. Raycaster’s direction is set by a constant vector3 (0,-1,0). (I want to ray to the plane). .
To check the result, I printed the controller’s position and the intersection to console.
As you can see in the picture, the intersection object is got only if Y coordinate is positive. If the Y coordinate is negative, the result will be empty.
Is there any problem in my code?
Best regards.2020-08-04 at 12:57 pm #31144Alexander KovelenovDeveloper
I believe this issue happens because the coordinate system in Verge3D is different (we use OpenGL/WebGL-based). X Y Z in Blender becomes X Z -Y in Verge3D. Thus, X the same, Y points UP, Z points in the negative direction compared to Blender’s Y.
2020-08-05 at 2:09 am #31163vmtsLicensee
- This reply was modified 1 month, 2 weeks ago by Alexander Kovelenov.
Thanks a lot for your response. I found my problem, the direction of raycaster is set correctly with the coordinate system in Verge3D (X Z -Y), however, the origin is achieved by puzzle that seems to be in Blender coordinate system (X Y Z). It leads to inaccurate results.
Thank you so much.2020-08-07 at 7:36 am #31244
- You must be logged in to reply to this topic.