Copy link to clipboard
Copied
I have a 3d shape layer that I would like to rotate across one of its edges instead of the traditional x, y, or z axis. For example, in the attached image, I might rotate the blue hexagon up and over (in 3D space) so it would land on top of the green hexagon. Is there a way I can rotate the x or y axis or simply create a custom axis of rotation?
Thanks!
3D layers have both rotation and orientation properties. They do similar things, but the benefit of two controls is that you can set the orientation of your layer independently and then rotate around the layer's own major axes. So for the hexagon you'd do something like this:
Copy link to clipboard
Copied
If I understand correctly you'd use expressions. So you'd have to figure out the math but an example expression would be something like:
transform.yRotation/2
That will make the rotation of that axis = to the Y rotation divided by 2.
Copy link to clipboard
Copied
3D layers have both rotation and orientation properties. They do similar things, but the benefit of two controls is that you can set the orientation of your layer independently and then rotate around the layer's own major axes. So for the hexagon you'd do something like this:
If you're using a polystar shape as your hexagon, you can precisely line up the anchor point with the right hand side with an expression. The width of the hexagon will be different from its radius, if you look you'll see that a line from the center to the center of the right edge, to the top of the right edge and back to the center creates a right-angled triangle.
The long side is the radius and the width will be the cosine of the angle × the radius of the hexagon. The angle expressed in radians is π/(number of points in the polygon), so the expression on the anchor point just needs to find polygon radius × π / number of points, or something like:
[Math.cos(Math.PI/content("Polystar 1").content("Polystar Path 1").points)*content("Polystar 1").content("Polystar Path 1").outerRadius, value[1]]
that's assuming the polystar is called "Polystar 1"
Copy link to clipboard
Copied
That's what I needed. Thanks! Unfortunately that was the simplified example. Now to do a bunch of trig and figure out where my triangle and trapezoid vertices need to be pre-orientation.. 🙂