8 Replies Latest reply on Jan 9, 2016 1:51 AM by Rick Gerard

# Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Hi there, I'm trying to animate a 3D ball rolling on all three Axis in a 3D space in after effects.   I have a null object, and can move the object along a path relative to that surface.   I'm currently guessing the rotation, and the ball obviously looks like it is ice skating across the surface.  I'm also using Video Pilot 3D plug in so adding models and skinning them is no problem.   Since the ball has a unique skin across the surface, I can't fake this with a 2d object and scaling.  Here is what I would like.

An easy solution to:   If I set a ball object to mimic the path of a null object can I have it

1. Take the speed and distance of the the null object and use the Balls diameter to calculate the actual rotation.
2. Take the XY and Z position of the path to rotation on all three Axis'
3. Using Z change the scale relative to the camera

And anything else I'm not considering.   This might be a 101 concept that related objects can easily manage, or it might be that I need to write some code for it.  Either way, does anyone have a tutorial or guide they could recommend?  I also have access to Lynda.

Windows 10

VideoPilot 3D Animate v2.0

Thanks!

Kevin

• ###### 1. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

I would recommend using the Newton plugin or "toy bricks" to create collision planes & paths. They are a bit pricey, but if you would like to apply actual physics to your objects without using other standalone 3D software (Cinema4D or 3D Studio, for example) you may want to give them a try.

http://aescripts.com/toy-bricks/

http://aescripts.com/newton/

"iExpessions" may be an alternative solution (physics with expressions in AE), but I have no idea if it will work with Element3D objects.

http://aescripts.com/iexpressions/

Alternatively, using easing and the graph editor in AE, you should be able to closely guesstimate the path and rotation for a sphere. I would also suggest looking for real-world or pre-rendered examples online as inspiration.

Matt

• ###### 2. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Newton will not work with Element 3D. This is nothing more than simple geometry. You only need to know the radius of the sphere and remember the formula for circumference. Convert the the circumference to rotation by dividing by 360 and move the layer exactly by the circumference for every rotation and as long as you have not scaled the 3D object it will roll perfectly. Here's how that works with a simple circle made from a shape layer:

In this case the circle was 390 pixels and the stroke was 20. Since the stroke is centered on the circumference of the circle the total diameter is 400.

The expression for rotation looks like this:

r = 400/2;

c = 2*Math.PI*r;

R = value + (360/c * position[0]);

It's just junior high math.

As long as you are rolling the ball on a single axis and in a straight line in X this will work. The expression gets a lot more complicated if the ball is not moving in a straight line.

If the path of the ball is not in a straight line a single axis easiest way to do what you want to do is to make the floor and the ball in the 3D app and just roll it around there. You can use the same formula or in some 3D apps you can set friction for the floor and the ball will rotate realistically no matter how you move it around.

• ###### 3. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Thank you very much Rick, I concur the math is simple and I'm not intimated by it at all.   However I want to be able to change the path speed along key frames and play around with the results, so I'd like to apply the formulas problematically.   Is there a way to apply functions to objects so that as the object triggers a keyframe, it can run a function and update the properties based on a function (formula).  Does that make sense?  Again sorry if this is a 101 question, I'm fairly new to After Effects.

• ###### 4. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Thank you Matt, I appreciate the response.  I've seen the power of these Physics engines in the 3D modeling programs, and I can see myself taking advantage of those.  In the short term I'm hoping there is a more elegant and simple solution with a built in programming language. I will definitely look into Newton in any case.   Thanks again! Kevin

• ###### 5. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

OK, it appears I'm looking to create expressions and linking properties.  Thank you again Rick, I'm thinking this put me in the right direction.

• ###### 6. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Last reply: Rick, now that I understand your answer better, this works perfectly!  Thank you very much, just exactly what I needed.

• ###### 7. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Appreciate the reply too, Rick. I may be able to apply these to a future project as well.

Expressions aside, I came across the link below this morning (may be helpful to someone):

Tutorial: Dynamic 3D motion in After Effects using Newton 2 and Element 3D - aescripts + aeplugins - aescripts.com

• ###### 8. Re: Any help or tutorials on easily making a  3d Ball Model roll along X,Y,Z and correct rotation for speed (note with skin, so 2d is not sufficient)

Newton is great. Expensive but great.

I made some progress on the expression using the speed that a layer moves along a path. The following expression results in a perfect roll as long as the speed is constant even on a curved path. I'm using a masked solid as a wheel, Auto Orienting the wheel to the path then applying the expression to Z rotation and rotating the wheel -90 in Y to line up the wheel with the path.

The expression looks like this:

l = thisComp.layer("Wheel"); // Sets the that will rotate

d = l.width/2; // Radius of Sphere

s = l.position.speed*time; // Constant speed

c = 2 * Math.PI * d; // circumference formula c = 2π r

s/c*360

The next step is to figure out how to make it work with a sphere where you have to control rotation in x, y, and z to get it to behave. The last step will be to modify the expression so you can ease in and out of the keyframes. This solution requires a constant speed but can take a curved path. To ease in and out of the motion you would have to pre-compose and then time remap. As I get more time I'll wrap this up and turn it into an animation preset that I can save to my library.

I've also written a simple expression that will move a circle or sphere on the X axis based on the rotation. Simply keyframe rotation and the layer moves. This expression will move a layer in a straight line along the x axis. With some more development this expression would also be fun.

r = content("Wheel").content("Ellipse Path 1").size[0]/2;

c = 2 * Math.PI * r;

R = rotation;

xp = value[0] +(c * R/360);

[xp, value[1]];