View Full Version : xpresso rolling rig
Linds 04 April 2006, 12:26 AM has anyone got an xpresso set up they'd be willing to share, to alow me to move a sphere around freely and have it roll acordingly?
(I found Mikael Sterner's COFFEE expression, but I don't know COFFEE and can't alter it to meet my needs.)
thanks a lot
Linds


Tiziano
04 April 2006, 03:00 AM
Scroll down to the bottom of my first post here:
http://forums.cgsociety.org/showthread.php?t=339482
and download the FreeWheelin'BETA file.
It's still only good in the +x/+y positions but it freely rolls.
Otherwise, the other links have some good rolling options too.
Linds
04 April 2006, 04:21 AM
Hey, thanks very much for your post. I checked out the links and as you point out, all these solutions rely in a path spline. Your xpresso set up seems good, but I can only get it to roll corectly allong one axis.
Antway, thanks for your help, but I think i'll just keyframe it by hand.
Cheers
Linds
tcastudios
04 April 2006, 08:43 AM
Not knowing exactly what you trying to achive, I'd say moving/rolling the sphere along a spline would be the easiest way. Taking in account the euler behaviour of a sphere rolling and changing direction, doing it by hand would be allmost impossible I'd think.
Cheers
Lennart
Tiziano
04 April 2006, 02:18 PM
...but I can only get it to roll corectly allong one axis.I'm pretty sure I got it going in both posiitive directions as well as backwards (as long as you're in +x/+y space). Unfortunately my C4d machine has been down for awhile (and will be for some time) so I can't check it or fix it :( .
Pesronally I'd give Lennart's RollOn a try.
Good luck. :)
Kokosing
04 April 2006, 08:33 PM
A very simple way to convert it's movement to rotation is make the sphere a child of a null. Take the null's local position X (or Z), divide it by the sphere's radius and pipe it into the sphere's local b (or p) rotation. Because Xpresso looks at rotation in radians, you don't need to calculate the sphere's circumference.
So, create an Xpresso tag, drag the null and the sphere into the Xpresso editor, pipe the null's local position X into a calculate:maths node:input 1, make the maths operator divide, type the sphere's radius into input 2 and pipe this out to the sphere's local rotation b.
I'm trying to think of a way to take this a step further and allow for turning and banking. I suppose you could use a spline path and convert the position value into a rotation.
I'll get back to you if I have the answer. I'm still fairly green on Xpresso though.
W
Kokosing
04 April 2006, 09:05 PM
OK, I think I have it. You'll still have to keyframe your banking but here goes. Sorry I don't know how to post screenshots (or to take them for that matter) so here's a lengthy explanation.
You'll need three nulls. Two will drive the sphere's position and rotation within Xpresso, the third will allow you to move the sphere where you like.
Call null 1 the X driver, null 2 the Z driver and Null 3 the sphere control.
Drag the driver nulls and the sphere into an Xpresso editor.
For the X driver, create an output for Global position X. Patch this directly into the sphere's global position X. Then make another patch into a math node input 1. Set the math node to divide and type the sphere's radius into input 2. Patch the math output into the sphere's rotation B input.
Do basically the same for the Z driver, but patch into the sphere's global position Z and rotation P. Remember to use a math node to divide the value for rotation. AND add a negate node after the math node to correct the rotation value.
Now make the two nulls children of the Sphere control null.
You can then animate the sphere control null on a spline path or just keyframe it. Since the Xpresso script uses the driver nulls' global position, the coords of the control null don't really matter.
Good luck,
W
Linds
04 April 2006, 11:41 PM
Brilliant, thaks Will, I'll give it a try and report back. I'm no xpresso genius either, but I do like playing around with it. Unfortunately I think I must have been bunking off when we did trig at school (a very long time ago).
Thanks for your explanation.
Cheers
Linds
PS, you'll never believe it, but it's a talking brussel sprout for a TVC! What a way to make a living!
Linds
04 April 2006, 05:11 AM
Hey that works great Will. Nice simple solution, and no trig!
Simple is always best.
Thanks again.
Linds
Tiziano
04 April 2006, 02:36 PM
Hey guys, I was able to get that to work as well (until my computer crashed again). But, on occassion the rolling was wonky. If you roll it back and forth +/x and then try a y it rolls sideways for me. It doesn't happen all the time but when it does I have to revert to the original file.
Very clever and simple solution though. Cool.
CGTalk Moderation
04 April 2006, 02:36 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.