Notifications
Clear all

[Closed] rolling cube

im in need of a script where you can let a cube (or rectangular) form, roll over an other surface. That surface could be another cube.
like this sample:

so when the cubicform come at the top it rolls over it.

I can animate this manually by using a lot of link contrains, but i want masses of cubes to do this. And even cylindric and other forms to do this over other forms.
Is there any way? Or any person who can make some sort of script for me?
maybe c it as an challenge? Like the ones CGSOCIETY is giving you guys.

tnx,

harm

35 Replies

The problem you have specified is really unclear. Do you want to be able to specify a path (perhaps by a spline) and then have an object follow the path while rotating?

Or do you want this to be more like a physics simulation? And if that is the case, why not use reactor?

sry if i have been unclear.

i want the forms to crawl. to roll themselves and over another object. And so that i can assign the objects that crawl and the objects that are crawled over.

basicly the object should roll over its own edges. I need 3 different obect types. Cubes, Cylinders and paramid forms.
and when for instance assigned to an object it uses that object surface to crawl over. When it comes to a edge, its crawls over it and follows the surface. I hope this is more clear.

so i think this are 2 problem.

  1. the rolling of the objects (in any direction)
  2. the rolling over objects.

I would be happy with 1 of them solved.
Sry i come to you with this problem. But im a noob when it comes to scripting. Im learning it, but i cant even begin to think, how to start here.

If i am still unclear plz let me know.

tnx

Well, a cube does not really roll because of it’s geometry…do you just want to imagine a sphere that circumscribes the object and have it rotate within that boundary? Because that does not sound too hard

no i can make a cylinder roll based on pi and its diameter.
A cube can ‘roll’. just imagen square wheels. i used it in a animation before but i hand animated that. I you want i can make a preview maxfile of it. so you know what i mean?

i understand what you want, and i dont think it will be easy to get results.

mark

 eek

if you want a box to roll, like a square wheel, just by moving it is gunna be some complex math, maybe step algorithm, with pi and some sin stuff, in all directions is harder. Hmmm… maybe not

maybe a sin/zig zag algoritm for the z position, but no that wont work going up the sides of things.

Why cant you just hand animate the the z/x/y position, its just a wave, based off the the rotation. I.e animate it moving, and rotating, add the keys to stop it cutting through the floor. I wouldnt even use constraints id just key it.

i’d also do this by hand, but i’d just animate the pivot instead of bothering with waves or anything.

parent your boxes / pyramids whatever under a point helper. initially position the helper at the first corner your object will roll over.

animate the helper so the object rolls over this first corner and lies on it’s next edge (let’s say this happens on frame 20. then animate the helpers position from frame 20 to 21 so it’s at the next corner the object is to roll over (the object itself will move as well obviously), you need to animate the object as well from frame 20 to 21 to counter this movement so it stays in place. once you have done this you can use the helper to animate the next roll.

the part about this that could be scripted is a simple tool to help animate the pivot with the object itself staying in place

here’s a quick example(tscc / techsmith codec)

here’s another one

it’s showing the cube rolling over the top edge of the obstacle

thank you very much, but i already use that methode in a previous animation.
call me stubborn but i really to try to script it, or do it in wire parameters.
i focused on the cube. How to let it roll. I tried it in wire parameters but dunno how to do it.

heres my thought. the rotation should be linked to the position of the cube. So when the cube moves in a x_position he should rotate in the y_direction. the linking should be in this way, that when the cube travels its own length it should rotate 90°. this is dun by dividing the units by the lenght of the cube and then multiplying it by 90.

x_postion=(y_rotation/length)*90

then you measure half the diagonal of the square. you take half the height of the cube.
and subtract that from the diagonal. to get the sinus for the z_position.

z_position=sin ((diagonal/2)-(height/2))

so when the cube is 60,60,60

y_rotation=(x_position/60)*90
z_position=sin 12,42640687119285

This can be applied to all of the axes.

is this the way to do it? Or am i just plain stupid. (which could be). And can someone tell me how to do this in a script or in wire parameters.

thanx a lot…

Page 1 / 4