We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Raycasting in VR Mode

Home Forums Programming Raycasting in VR Mode

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31133
    vmts
    Customer

    Hi,
    I’m having a trouble when I make a test for Raycasting in VR mode.
    I created some objects in Blender Objects
    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). Code.
    To check the result, I printed the controller’s position and the intersection to console. Result
    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.

    Take a look at our website
    One stop services Verge3D: 3D Modelling + Coding
    Our sample ECO2 Sales Tools
    Audi

    #31144

    Hi,
    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.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #31163
    vmts
    Customer

    Hi Alexander,
    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.

    Take a look at our website
    One stop services Verge3D: 3D Modelling + Coding
    Our sample ECO2 Sales Tools
    Audi

    #31244

    :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.