19
$\begingroup$

Kind of a theorical question here. I would like to know how you would rotate a cube so it stands on one of its tops. I finally managed to do it but probably not in a proper way, and as i'm curious to improve my workflow, I ask you.

Maybe there is a "mathematical" way to compute the Y angle; or even better, would there be a "blender" way to do it even more quickly ? (with snapping or something)

Thanks !

enter image description here

$\endgroup$
15
$\begingroup$

Somewhat better non-mathematical solution:

  1. Extrude one of the side edges along the 'Z axis' and split the extrusion with Y.
  2. Set cursor location with Shift+S and pivot point with comma.
  3. Enable vertex snapping, set 'Edge' snap element and 'Active' snap target.
  4. Select the main object with L and make one vertex active with Shift-Click.
  5. Rotate in front view and side view.

That's how it looks:

Cube snapping

$\endgroup$
  • $\begingroup$ While all answers here are really good, I think this is the most efficient way for me. Thanks ! $\endgroup$ – gordie Nov 11 '15 at 1:38
  • $\begingroup$ But the problem with this nice technique is that you work in edit mode, and thus the rotation isn't applied on the object but on the mesh... $\endgroup$ – gordie Nov 16 '15 at 18:41
14
$\begingroup$

Here is a mathematical solution. When you have finished your first rotation you have something like this (a cube staying on its edge):

Cube in ortho mode

I added a diagonal for this explanation. From the side view it looks like this: enter image description here

When the cube stays on its edge, the new object height is \sqrt{1^2+1^2}=\sqrt{2}. The angle for rotation is defined by formula \alpha = \arctan(1/\sqrt{2}). To perform this rotation type in 3D view: ry=atan(1/sqrt(2))*180/pi. This will give you a perfectly oriented cube.

$\endgroup$
  • $\begingroup$ And if you don't need perfect mathematical precision, just need to do it faster than eyeball, ry=35.26. $\endgroup$ – Kroltan Nov 11 '15 at 14:20
12
$\begingroup$

Late to the party so adding an "out of the box" fun solution, use physics. (Not to be taken seriously really but it could work if you increase the simulation steps, wait for the entire sim to end and then convert to a mesh from the baked simulation, remove the "string" and set an origin on the cube).

Example below is terrible as well since I use cloth as opposed to rigid body, the point is made however.

enter image description here

$\endgroup$
11
$\begingroup$

Can't speak for mathematical ways, but you can do it like this.

  1. create a "segment object" which connects your object "poles" (nort/south)
  2. parent the cube to the "segment object"
  3. create a vertical "reference segment", along Z
  4. using snapping to edges, rotate the "segment object" from front/side views, snapping it to the "reference segment"

like

enter image description here

you'll get this

enter image description here

$\endgroup$
10
$\begingroup$

Mathematically

if you look at the Front Ortho of the image there is the triangle ABC. Length B is the side of the cube L, length A is the length of a faces diagonal L * sqrt(2) (basic pythagoras). The tangent of angle alpha will be L / (L * sqrt(2)) or 1 / sqrt(2) atan of which equates to 35.2644 degrees.

The rotation_euler XYZ (45, 35.264, 0)

The length of the longest diagonal C is L * sqrt(3), Once again from pythagoras. If the origin is in the middle of the cube translate the cube L * sqrt(3) / 2 to put it on its point.

Interestinglythe volume can be calculated using C**3 / (3*sqrt(3))

enter image description here

$\endgroup$
-1
$\begingroup$

Fast---

In object mode ortho 1, rotate cube by eye so vetex is in line with axis. Zoom in if you want to be accurate.

Go to ortho 3 and repeat.

Good enough for me.

... or have I missed something?

$\endgroup$
  • $\begingroup$ That's what I did myself before asking this question. Good enough, but not perfect :) Anyway, thanks you all for your nice answers ! $\endgroup$ – gordie Nov 11 '15 at 1:36
  • 1
    $\begingroup$ My foray into level design taught me that being exact rarely matters, and eye-balling things gives a softer, more human touch. There are legitimate cases when you'll need to be exact, but one should know with discretion whether and when they actually need exact, and when they do not. $\endgroup$ – ThorSummoner Nov 17 '15 at 10:00

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.