elkyu Posted June 29, 2015 Share Posted June 29, 2015 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 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 30, 2015 Share Posted June 30, 2015 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. Quote Link to comment Share on other sites More sharing options...
elkyu Posted June 30, 2015 Author Share Posted June 30, 2015 Hi W ! Under the "hole" I have an another plane, and I can see it through the "hole" .. Quote Link to comment Share on other sites More sharing options...
jahow Posted June 30, 2015 Share Posted June 30, 2015 Will you need the plane's reversed polygon back at some point? I.e. will you have to patch up that hole in the future? If not, you can remove this face altogether and the picking function will do exactly what you want. Quote Link to comment Share on other sites More sharing options...
elkyu Posted June 30, 2015 Author Share Posted June 30, 2015 Yes I need to patch up that hole in the future .. Quote Link to comment Share on other sites More sharing options...
jahow Posted June 30, 2015 Share Posted June 30, 2015 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. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 30, 2015 Share Posted June 30, 2015 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.) Picking through a culled backface, Jahow? Interesting! Modified pickingRay? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.