playMaker

Author Topic: Rolling Geometry algorithm[SOLVED]  (Read 2421 times)

Astrydax

  • Playmaker Newbie
  • *
  • Posts: 4
Rolling Geometry algorithm[SOLVED]
« on: May 11, 2016, 11:10:38 PM »
I'm trying to rework this algorithm into a playmaker project and I'm having a really hard time. Is this possible within playmaker?

I'm trying to rotate and move various cuboids around a tile grid map.

http://answers.unity3d.com/questions/710087/tipping-a-cube-over.html#answer-710471
« Last Edit: June 06, 2016, 03:24:35 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Rolling Geometry algorithm
« Reply #1 on: May 12, 2016, 02:29:53 AM »
Hi,

 Yes, it's possible, However quite tricky, I give you that.

where do you hit problems when trying to reverse engineer this system?

 Bye,

 Jean

Astrydax

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Rolling Geometry algorithm
« Reply #2 on: May 15, 2016, 05:03:53 AM »
I ended up using my own method, by checking for 3 states I call: tall(where the top and bottom faces of the rectangle have != y transforms) and shortVert(!= z transforms) and short horizontal(!= x transfroms). I created 12 states, moving L,R,U, and D from each of the orientations. I then rotate and move the cube using itween. The problem seems to be that this is causing gimbal lock, and after a few moves, I get odd rotations which eventually causes my float comparison on the transform of the 2 faces to create false positives due to the imprecise transforms caused by the gimbals lock, thus entering the wrong state for animation.

I've tried rounding off the rotations and positions during the idle state, but this doesn't fix the issue and seems to make the behavior worse.

I really don't even know how to begin to fix that sadly.
« Last Edit: May 15, 2016, 05:08:01 AM by Astrydax »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Rolling Geometry algorithm
« Reply #3 on: May 19, 2016, 05:22:51 AM »
Hi,

 Ok, I have done a sample on the Ecosystem to show you a first version using simple procedures.

 https://twitter.com/JeanAtPlayMaker/status/733225664539709440

Have a go at this, try to understand how it works and build it from scratch. If you have questions let me know.

As soon as 1.8 will become public, I'll do a updated version making use of arrays which makes the routines a lot more efficient with less redundant states.

Bye,

 Jean


Astrydax

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Rolling Geometry algorithm
« Reply #4 on: May 31, 2016, 07:06:13 PM »
Wow that's fantastic! that's really going above and beyond. That's seriously a godsend.
« Last Edit: May 31, 2016, 07:16:56 PM by Astrydax »