Jump to content

CSG question


MarianG
 Share

Recommended Posts

Hello guys. One simple question :)
I'm trying to create a profile with holes.
When this profile is composed from only one layer it works:
http://playground.babylonjs.com/#52VGKP#2
But if it is composed by multiple layers it works too, but the hole is not complete, I cann't see through it:
http://playground.babylonjs.com/#52VGKP#1
And I need this visual effect of layers. I mean, I cann't create by default a box whith layers dimensions and apply the csg on it.

Link to comment
Share on other sites

  • 3 weeks later...

http://playground.babylonjs.com/#52VGKP#8

Hi Marian!  Wingnut goofin' around in this PG.

Line 50... after merge, let's call it hole5.

Line 66... off we go to CSG() func... WITH hole5.

Line 87... we kill hole5, right?  IF it had any of the 5 actionManagers, they are probably dead, too.  :)

So now... what do we put actionManager(s) upon?  Hole5 is now dead or turned to air.  Can't use him.  :)

Line 100... fun.  Return something and then we'll try to put an actionManager upon it, after it gets home.

I tried returning subCSG, and innerCSG, and newL... just goofing around with line 100.  You can even disable line 87 (don't kill hole5)... and return hole.  Experimenting.

But really, the problem happened... when 5 actionManagers were killed in a MergeMeshes tornado, right?   I think that is expected behavior, but we'll listen to others, too.

Perhaps you can find a way... that doesn't use mergeMeshes?  MergeMeshes are SO violent, ya know?  ;)  Sorry I had no solution.

But really... I hope you didn't want actionManagers installed on the air in the holes.  If so, we need to talk about some therapy for Mister Marian.  :)  You're going to need some invisible cylinders if you want "nothingness" to be pickable and have an AM.  heh.  We HAVE ways to click on empty air... but it requires special handling.  (Ain't 3d fun?  It's a great vehicle for trying bad comedy). 

Link to comment
Share on other sites

Hey @Wingnut. I'm experimenting too :)
Actually the goal is to create a lot of holes with default radius, and each to be clickable and you can click on one of them and change radius.
And I used mergeMeshes because if I'm doing the csg foreach hole, my browser freeze, so a solution on this was to merge them. Now I want to add an actionmananger to them, and make them invisible, and I wanted to use the shapes already used for mergeMeshes, without dispose source, but finaly I think I'll use mergeMeshes with dispose source and after that I'll create new holes for action manager.
Something like this, http://playground.babylonjs.com/#52VGKP#9. but noh, I have to use 2 loops, and I'm creating the double number of necesarelly holes. This is the only one solution till now :))
 

Link to comment
Share on other sites

Hello, once merged the original meshes do not exist anymore.

The new merged mesh does not contains action information. So you have to create a new manager for it. But you won't be able to get specific action per hole as they are all melted together

You can also sync about using a clone of each hole to create the mergedOne to do the CSG work then dispose the merged mesh and only keep the originals

 

Link to comment
Share on other sites

12 minutes ago, Deltakosh said:

yes this **should** work as well :)

Ok, but why then if I'm adding actions to holes and after that I merge them without dispose, so supooae I can still use the actions on holes, but this didn't work?

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