Jump to content

3D mouse position using a "virtual" plane


Recommended Posts

The current mouse picking tutorial only deals with picking objects from the scene. Often, when getting the 3D mouse position, you only want to get the point at which the mouse ray intersects a ground plane. I could manually create a ground plane and use intersectsWith, but it seems inefficient to create a mesh for the sole purpose of detecting the mouse position. Other 3D engines I have worked with allow creating a plane without actually attaching it to the scene. The calculation would still work because all of the transform data is there. Is there a way to do this? My current solution is to create a "ground" plane and set isVisible to false, but this seems hacky especially since there seems to be a limit to the size of ground.

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.

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.


  • Recently Browsing   0 members

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