Interactive multiple folding steps

folding
fold

#1

Hi all

This is my first post, here.
I am trying to fold a game board in four. I need to move a panel twice in the same animation. Is this possible?

Thanks
Stephen


Dynamic Components Resources [wiki]
#2

Here’s a quick example.

dc-folding-board.skp (22.8 KB)

I used flat quads which end up in the same plane when folded - this causes some z-fighting to occur between the faces. Giving the quads some thickness would solve this, but you then would need to move the axis of rotation so each quad is stacked rather than ending up in the same plane.

This example shows the stack. I faked it by just animating the Z height of 2 of the quads.

dc-folding-board.skp (22.8 KB)


#3

Hi Jim.

Many thanks for taking the time to answer my question.

This is what I have come to till now. The folding of the board is a bit different from what you did.

My model is folding the board through the table. I wish to turn the model 45 degree up, the do the folding I have, and put the board back on the table.

Is it possible?

Thanks in advance.


#4

I believe it’s possible - with another cup of coffee…


#5

I’ll make u a cuppa if you where over


#6

Ok try this.

Gameboard[jf].skp (923.0 KB)


#7

WOW!

I’ve got some arithmetics to look into to see how you managed to do all that with one variable (anim) but this is exactly what I was looking for.

Many thanks, mate.


#8

I can try to explain, but I’m not a good teacher. Luckily, it’s fairly simple.

[1] When we click on the Component, we animate the anim attribute from 0 to 3. The next click will animate it back from 3 to 0.

Your animation requires 3 steps which is why I used 3. Step 1 occurs when anim is between 0 - 1, Step 2 occurs between 1 -2, and step 3 occurs between 2 and 3.

[2] the a1, a2, and a3 attributes are how we divide anim into 3 steps.

  • a1 goes from 0 - 1 when anim goes from 0 - 1
  • a2 goes from 0 - 1 when anim goes from 1 - 2
  • a3 goes from 0 - 1 when anim goes from 2 - 3.

Any number of components can be animated for each step by tying their positions or rotations to the appropriate a# attribute. [3] So for the Child4 Component, it only moves during step2 because it is tied to the a2 attribute. As a2 goes from 0 - 1, the angle goes from 0 to 180° because multiplication.

Of course, the technique can be used for any number of steps just by creating more a# attributes. Just increase the “step” in onclick and follow the same pattern for the a# attributes.


#9

Nice technique! I’m adding to my forum bookmarks for future reference!


#10

Moved to Dynamic Components category, and
now linked in the Tips & Tricks list of the
Dynamic Components Resources [wiki] thread.