Jump to content

Collision after mesh.bakeTransformIntoVertices()


Arte
 Share

Recommended Posts

Cooool, John! 

But, CAN one be made... where we CAN simply scale the parent for cabinet resizing?

For example, when we up-scale parent width, the side-panels will get thicker (not wanted).  But the side-panels could be sidePanelClass objects... which have an observer on them... which watches-for changes-of inherited-from-parent scaling.  When that is observed, the observer triggers code that automatically re-scales the child's side-panel thickness BACK-TO preferred thickness (by using specific x-scaling upon the child itself).  WOW!

We REALLY want to be able to "freeze" the scaling of certain axes... on certain TYPES of children.  Since we don't have per-axes freezing of child scaling, we could instead use observers (or other thickness-monitoring methods) to up/down-scale the "frozen axes" back-to correct scale (in order to maintain thickness size).

Essentially, while (side-panel.getBoundingInfo().boundingbox.extendsWorld.x <> wantedPanelThickness) { up/down scale its thickness scale };

Could it be done?  :)  Essentially, a "smart" sidePanelClassObject... which self-maintains its thickness size, no matter what the parent does.  Cool, but my head hurts for some reason.  :)

Link to comment
Share on other sites

:)  Babylon.MeshBuilder.createProgrammableIgnoreParentBox().  Easy.  :D

I guess we'll need the ProgrammableIgnoreParentSphere(), too... for the cabinet door knobs.

hmm... maybe the "scalingFreezer" is an add-on object for any mesh... a proxy... a scaling policemanperson that stands nearby and hits the mesh with a stick whenever the mesh tries to scale "illegal" scaling axes.  heh.  Scaling cop, quick-draw with his/her police tape measure.  Obesity Policity.  :D

Personal fitness trainer.  Makes the mesh add/reduce size if/when mesh ever gets too fat or skinny on some axes, per the fitness trainer's rules.  :)  The trainer holds the rule book, and the mesh takes scaling orders from the trainer.  Multiple mesh can use the same fitness trainer/fitness-rules.  Gooooofy.

Fitness.  Fitting-ness.  :)

Link to comment
Share on other sites

@Wingnut @JohnK You're reading my mind.

I really like "We REALLY want to be able to "freeze" the scaling of certain axes... on certain TYPES of children".

Just imagine:

parent  = BABYLON.Mesh.CreateBox("parent",1,scene);

parent.scaling = new BABYLON.Vector3(60,100,30)

child= BABYLON.Mesh.CreateBox("child",1,scene); (Cabinet left side )

child.scaling = new BABYLON.Vector3(2,1,1)

child.scalingFREEZE = new BABYLON.Vector3(0,1,1) (we freeze/locking coordinate x) 0=scaling false, 1=scaling true

child.parent = parent; (after this child size should be x=2, y=100, z=30 )

Is this simple and clear enough?

I would like to know your opinion as well as others on whether this would be possible to achieve?

Let's ask @Deltakosh is well.

Link to comment
Share on other sites

I bet it would be DIFFICULT to implement, framework-wide.  I really wouldn't know, though.  I don't know how/where "the big 3" hand-me-downs... are handed down (rotation, position, scaling).  That's why I thought it might be wiser to allow an .inheritenceManager or sizeManager add-on object.

Just possibly, we are seeking a "customParentClass" object, right?  One that can be told WHICH of "the big 3" (and their axes) we wanted handed-down, and which not.  This customParent could then be used for rotation and position, too, if a user ever wanted to freeze THOSE on children.

ProgrammableInheritenceCustomParentClass - alright!  :)  It "queries" a child to check for frozen properties/axes... BEFORE attempting to force a value upon them.  But... you know... to allow cool recursion, every mesh in the entire structure... needs to be type ProgrammableInheritenceCustomParentClass.  erf.

ChildConstraintHeedingCustomParentClass.  wow.  heh

Link to comment
Share on other sites

Max123 said in another thread:  " when you're on a train, you can still walk and turn around or check out a gorgeous chick picking up the purse she dropped "

I live too close to northern Wisconsin to experience any gorgeous chicks.  In this area, train girls must be weighed to make sure they don't crack rails or snap boxcar axles.  :D

Yeah, your statement is true when the train is a classic parent.  If a mesh is a "loose" parent (pick and choose what gets handed down)... then the person in the train MIGHT stay position-aligned with the train on X and Y axes, but maybe not Z. 

Also, this rider might tilt-up/down when the train experiences hills, but perhaps the rider does not turn when train turns (on Y axis). 

And, if the train is scaled wider, rider might/might-not get wider, too.  (coder programmable)

Select-able hand-me-downs. 

The challenge is... given a parametric cabinet, where all its "pieces" are "children"... Arte wants to be able to LIVE up-scale some single object  (LIKE a parent of all pieces)... changing the size of the overall cabinet, yet NOT have the thickness of the side/top/back/front panels... change.  For example, this cabinet uses 1/2 inch plywood on all panels.  If Arte slides a slider to up-scale X (make cabinet twice as wide)... then all the side panels will get thicker... exceeding 1/2 inch.  If he could LOCK that panel thickness on all panels... then he could scale the cabinet size easily, and not change the panel/shelf thicknesses.

The train gets wider, but not the people within.  :)  The light fixtures within the train do not get wider (size-scaling hand-down NOT allowed), yet they are positioned appropriately for the 2x wider train (positional hand-down IS allowed).

If we can't lock/freeze some of the handed-down things, the people get double-wide when the train gets double-wide.  heh.   Does any of that make sense?  If so, you're doing better than I.  :)  I don't know if any of this will work or be useful, but it's fun to think about.  The live-sizeable cabinet is a perfect test case, too.

Link to comment
Share on other sites

https://www.babylonjs-playground.com/#USNSTF#5

Thats how I would handle the drawers, I did not do uv's or normals yet, but that should be simple enough.
Now the hard part, the frame for the whole thing... Ill keep trudging at it as i get time today.


*UPDATE*

https://www.babylonjs-playground.com/#USNSTF#6
getting there, just need to iterate over the sides that need to go up now and then the top surface.  Once this is done though, you will be able to rebuild the whole mesh quicker then if you were manipulating a bunch of separate meshes, not like performance would be an issue with this but yeah this just makes things easier and more expandable.
https://www.babylonjs-playground.com/#USNSTF#8


*update*

https://www.babylonjs-playground.com/#USNSTF#11
Im done with this for now, I don't have time to spend on it and you can take over from here.

Link to comment
Share on other sites

13 hours ago, Pryme8 said:

https://www.babylonjs-playground.com/#USNSTF#5

Thats how I would handle the drawers, I did not do uv's or normals yet, but that should be simple enough.
Now the hard part, the frame for the whole thing... Ill keep trudging at it as i get time today.


*UPDATE*

https://www.babylonjs-playground.com/#USNSTF#6
getting there, just need to iterate over the sides that need to go up now and then the top surface.  Once this is done though, you will be able to rebuild the whole mesh quicker then if you were manipulating a bunch of separate meshes, not like performance would be an issue with this but yeah this just makes things easier and more expandable.
https://www.babylonjs-playground.com/#USNSTF#8


*update*

https://www.babylonjs-playground.com/#USNSTF#11
Im done with this for now, I don't have time to spend on it and you can take over from here.

Interesting :huh:

Thank you.

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