2
$\begingroup$

I am making skyboxes for a game, and would like to prototype the skyboxes' rotation angle in Blender. I made a simple vertical mesh line that represents the rotation axis of the skybox, and I would like to be able to rotate the skybox along the mesh line's local Z axis, no matter how I rotate the mesh line itself. enter image description here

Here you can see if I rotate the mesh line on the X axis, and make a new custom orientation from it, the skybox rotates around the mesh line as expected, but I would like this to be dynamic, so I can animate the skybox rotating, and when I rotate the mesh line, the skybox rotation adapts accordingly. enter image description here

enter image description here

$\endgroup$
4
  • $\begingroup$ Rotation on local axes can always be achieved by pressing R and then twice the key for the axis: R, Z, Z to rotate on local axis. Pressing Z once is global Z axis, pressing Z again is local Z axis, pressing Z a third time gets you back to global rotation. Or to generally rotate on local axes with pressing the key only once, you can change the Transformation Orientation to Local instead of the default Global at the top menu of the 3D Viewport. If you do this, pressing Z once rotates on local Z and pressing it twice rotates on global Z. $\endgroup$ Jan 8 at 13:48
  • $\begingroup$ Oh, I'm stupid, you want it for animation. I'll write an answer. $\endgroup$ Jan 8 at 13:52
  • 1
    $\begingroup$ I finally understand the question: the simple parenting doesn't work because you don't want the sphere to follow when the rotation axis is moved. Therefore this solution is wrong: i.imgur.com/r09WqPD.gif $\endgroup$ Jan 8 at 18:54
  • 1
    $\begingroup$ @HarryMcKenzie no, just simple animation of the sphere (animating euler Z rotation) $\endgroup$ Jan 8 at 19:03

1 Answer 1

4
$\begingroup$

I think you're looking for driven axis-angle rotation. I don't think this is doable with constraints only, because of the way that Blenders handles rotation in its constraints (it decomposes rotation into Euler triplets and adds/subtracts them, which isn't really right.)

Start by making an empty at the world origin and empty.001 at world Z = 1. Parent empty.001 to empty. Change your skybox rotation mode to axis-angle, then create drivers for its X, Y, and Z rotation. It's X rotation should equal the world space X location transform channel of empty.001, Y should be the Y location, and Z should be the Z location. Keyframe W to 0 at the beginning of your rotation and 360 degrees at the end of your rotation.

enter image description here

Now see what happens when you rotate empty. Its child follows, which changes the axis along which your skybox rotates.

enter image description here

You can change the axis of rotation ussed by your skybox to any axis desired by rotating the parent empty.

$\endgroup$
1
  • $\begingroup$ Hah, that is perfect! It's doing exactly what I need. Thank you very much! And thanks Gordon too, I hope you didn't really go crazy :D $\endgroup$
    – Geri
    Jan 8 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .