Jump to content

How to click through a hole in a plane (to hit element under the plane)


elkyu
 Share

Recommended Posts

Hi,

 

I have a plane with multitude of faces (triangle).

 

What I want to do, is to create a hole in the plane (I already done this part by inverting the order of the indices of the face in question, that invert the orientation of the face).

 

My problem is that I would like that the elements below the plane will be clickable through this "hole" created in the plane.

How can I do that ?

 

If, when I click on the "hole", I get a pickinginfo, the pickinginfo will send me as result, the plane which contain the "hole" but not possible to hit the elements below.

 

I precise that to create the "hole", I don't want to remove the face, I want to can invert the orientation of this face as many time as I wish.

 

Is it possible ?

 

Thank you

Link to comment
Share on other sites

Hi E!  The problem is... a triangle with reversed backface... is not a hole.  It's a backfacing face... but the 'surface' is still there.  It's not a hole.  I bet you can't see through it.  Try putting some colorful mesh shapes under the "hole".  I bet you can't see them through the hole.

 

When you can see the colorful mesh through the hole, then you KNOW you have a TRUE hole, and can click on the colorful objects on the other side of the hole. :)

 

Our CSG system can be used to drill holes in planes/grounds... I suspect.  So can our polygon mesh system.  The background image on that demo is being grumpy, but trust me... its a bird-shaped HOLE.  :)   Be well.

Link to comment
Share on other sites

Well then, I'd say you have two options:

1/ change the way the picking works, for example adding a parameter to ignore back faces (that may be done by redefining the function)

2/ store the removed faces in another mesh, for which picking will be disabled

 

For option 2, you'd have two meshes with identical vertices list, and different indices. Basically, when you want to remove a face from the first mesh, you remove the three indices and add them to the second mesh. And vice versa.

 

But honestly I think having a parameter in the picking function to ignore backfaces would be a great addition! Will check how the code works to see if something like that is possible.

Link to comment
Share on other sites

Elkyu, can you build us a playground that shows the problem?  (thx)  I think Jahow has some great ideas.  Before making the hole, grab a copy of the indicesKind data for the plane... and store it safely in a variable or property.  Then drill your hole by removing some indices.  Later, when you want to fill the hole, set the indices data on the plane... to the stored pre-hole indicesKind data.

 

In my last post, I forgot that we can see through a backface of a mesh that has .backFaceCulling = true;  It's still not a hole, and I think that's why thru-the-hole picking is failing.  (Just about the same thing as Jahow said.  I'm just now catching up.)  :D

 

Picking through a culled backface, Jahow?  Interesting!  Modified pickingRay? 

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