# Rolling an irregular 2dshape or 3dObject , on a plane

#1

Hi guys,
how would you approach rolling an irregular shape (not an egg nor a cube nor a sphere) , on a flat surface ? > Something like this <

im interested in writing a tool to do this, alto im not sure how it should work.
Also, any, pseudo real-time system/script/trick would be good (even if i have to bake something out to extrapolate the offset translation data from such object), obviously , it would be perfect if i could also animate the position of such object and it would rotate compensating the translation Y value in real-time, but at this stage im only interested in understanding how i can make something like this to work .

#2

Well, how about you start with an egg or a cube? The essential principles will be the same. Later, you’ll likely want to roll a convex (edit: not concave) version of the shape, rather than the shape itself.

#3

Hi Clesage,

what im looking for is more of a guideline on how to achieve the end results, (calculate first the contact points…then the offset of such point so that the surface stay on top…etc) .

Yesterday i figured how to keep the poly on top of the base surface calculating an offset for my geometry, it was a simple distances comparison, taking advantage of the point on poly constraint i projected
a locator from the edge of my poly to the surface, then i calculated the radius and distance between these 3 points , and as the contact point goes to 0 i could extrapolate an offset.

Now i have 1 point only that keeps my surface on top of the other… the tricky part now is that i need to find a way to rotate such surface… and then i would need to also find a way to interpolate between all these points as my geometry rolls on the surface…all these things i haven’t quite figure out how to do it yet.

once i can do it on a round surface (convex ) , then ill also have to figure how to do it on a concave one (then i have no clue on how to interpolate my position/rotation based on two points contact…)

I am wondering if i would need some sort of weight blender type of thing, based on the distances of all these points…mh, if is not clear maybe ill try doing some sketches.

Again, if you have any hints would be appreciated .

thanks
-a

#4

interestingly enough, i stumbled upon a maya command that does exactly this automatically.

Is not quite perfect but can be looked up on.
ill leave it here if anyone is coming across a similar problem.