Jump to content

How to judge which side I click on a plane mesh?


Recommended Posts

i have a 3d house. when the camera in the house, i can see the ceiling and i can click to select the ceiling mesh.

when the camera above the house. the ceiling can't be see. But when i use scene.pick to check click, i still get the ceiling mesh.

How can i judge the side when i pick the ceiling mesh? So i can ignore the ceiling to pick the items in the house????

Link to comment
Share on other sites

A few suggestions (without implementations:) ) :

  • You could create a bounding box around the house, and make sure you are still in it when clicking. This can be a part of the predicate in the pick function.
  • Create two ceiling meshes, with a minimal gap between them, and run pick with fast check. This will deliver the first mesh it found. This way you will know if the lower mesh or the upper mesh was selected
  • Simply define a y threshold and test it in the predicate of the picking function
  • get the picked point in the picking info, and create a ray between the camera and the point. Then check the direction of the ray and see if it is positive or negative in the y axis.


I wonder which one is the best :) The simplest is the y threshold, which was already suggested.


Link to comment
Share on other sites

Yes, i already used y compare check... simple but not my really want.

i need to click the things in the house when i click through ceiling. So all your suggestions need to know what mesh i click. But I actually need the way to check side and don't want to check what mesh.

Thank you both.

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