4
$\begingroup$

I'm trying to make a sphere roll diagonally but the sphere rotates oddly. I assume this is because it is rotating relative to the sphere's axis rather than the world's.

Is there a way to get a sphere to rotate evenly along two axis? If you can't, is it possible to use an empty and rotate it based on that?

Edit: This is what it does with the correct rotations on the y- and x-axis.

http://minus.com/i/iUqJl0iHl3y6

$\endgroup$
  • $\begingroup$ As far as I can tell it's doing exactly what I expect it to do.. Is it possible you could give an example of how you want it to behave? $\endgroup$ – gandalf3 Nov 16 '14 at 7:03
  • $\begingroup$ @gandalf3 I have a sphere that is 8 meters north and 8 meters east from the center. I want it to roll towards the center (diagonally down and to the left). When I enter the correct degrees for the rotations separately, they work okay (it rotates around the x-axis or the y-axis just fine). But when I combine the two, the ball starts to spin normally before acting like a wind-up spin toy and roll in ways that a normal ball would not roll. I'm making a gif right now and will edit if that doesn't make sense. $\endgroup$ – Qwurticus Nov 16 '14 at 8:03
  • $\begingroup$ Related: blender.stackexchange.com/q/12211/599 $\endgroup$ – gandalf3 Nov 16 '14 at 9:13
10
$\begingroup$

This is because you seem to want to rotate around a custom axis, rather than two axes at once.

One way to do this:

  1. Align one of the object's local axes to the axis you wish to rotate around. If you don't want to rotate your actual mesh, see Set rotation values without applying them.

    In this screenshot I've rotate a sphere so that it's local Z is aligned around the axis I wish to roll it along:

    enter image description here

  2. Add an empty and animate it spinning around the axis you aligned (so in this case I've animated it rotating 360° around the Z)

  3. Add a copy rotation constraint to the sphere and select the empty as the target (note that you can press E while hovering over the object selection drop down to select an object in the 3D view). Then disable the axes you don't want to be copied and set the rotation to be "pasted" in the sphere's local space:

    enter image description here

  4. Animate the location of the sphere and you are good to go. Note that the sphere has no rotation keyframes, the rotation is done on the empty and copied with the constraint.

enter image description here


To explain what is happening when you rotate around two axes at once, hopefully this gif can make it clearer:

enter image description here

It's hard to explain :P

The gray Suzanne represents your sphere. Note that it rotates 360° around the Z and 360&deg around the X. Rotating around these axes will not make it rotate around a imaginary diagonal like you seem to expecting.

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Thank you! I assumed that what was happening to the grey Suzie was what was happening to my sphere. I'm new to animating so thanks a bunch. $\endgroup$ – Qwurticus Nov 16 '14 at 10:16
  • 1
    $\begingroup$ If you're keyframing it manually, you could also rotate directly around a local axis. Align one local axis as described in point 1. in gandalf3's answer. Let's say the local Z axis. Then, to rotate it, use RZZ instead of RZ. I'd use quaternion rotation mode for this, as it's free of gimbal lock. However, with quaternion it always makes the shortest rotation, so you should rotate LESS than 180° between each keyframe, or it will rotate in the wrong direction. (It could, of course be done with a driver as well, but quaternions aren't very intuitive to calculate). $\endgroup$ – user7952 Nov 19 '14 at 1:21
  • $\begingroup$ @SixthOfFour I haven't gotten that to work with eulers, but it works great with quaternions. Still, using quaternions makes it a bit difficult to do many rotations like a rolling ball.. $\endgroup$ – gandalf3 Nov 19 '14 at 2:11
  • $\begingroup$ @gandalf3 I haven't tried rotating a moving object like this, but I recently did rotating text around a local axis. However, the text was stationary in location, and the axis didn't change direction. And quaternions are difficult. I discovered them about a year ago, when I discovered Blender, and although I'm truly, madly, deeply in love with math, I'm still trying to wrap my head around them. $\endgroup$ – user7952 Nov 19 '14 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.