# N00b struggles with rotation constraints for hinged objects at odd angles

To test my slowly growing knowledge I made a 16x16 UV sphere, selected a few faces on one side of it, popped them off into a separate mesh § then tried to make that mesh into a hinged hatch or door into the sphere. Of course most edges of a UV sphere are at odd angles, and this was the challenge I was setting up for myself.

I tried this two different ways.

A)

1. create an empty axis object.
2. glue the axis object to an edge of the opening in the sphere
3. rotate the axis object until one of its axes aligns with that edge.
4. parent the axis object to the sphere.
5. parent the hatch object to the axis (hinge).
6. rotate the hinge object in local coords (on whatever axis seems to work) and the hatch opens and closes smoothly.

B)

1. make a single bone
2. carefully align the bone to one edge of the opening in the sphere.
3. parent the bone to the sphere.
4. parent the hatch to the bone
5. rotate the bone in the appropriate local axis and hooray, the hatch opens and closes smoothly.

Then I want to place a rotation constraint on the hinge or bone, so that the hatch can only swing in the desired direction and only through a limited arc.

Here all hell breaks loose I select the hinge or bone, I impose a Rotation Constraint, selecting Local from the menu at bottom of the editor panel. As soon as I click on, say, X (limited by default 0-0), the hatch object twists wildly out of place. I then say to myself, ‘aha, I did have to rotate the hinge or bone object to line it up with the parent sphere edge, so I could read its rotation position in the data panel (n) and make the limits match its default position in the 2 unused axes’. So I try this… which sort of works, I can get the hatch object back into place; but when I try to place a constraint on the final axis (the actual hatch rotation action), I get very weird results; the hatch opens a few degrees then blinks back into place, or suddenly blinks into the interior of the sphere…

I am just a few Aha moments away from understanding the interactions of the coordinate systems, but not quite there yet – can someone help me figure this out? What I was hoping was to set up a rotation constraint in coordinate space that was entirely local to the repositioned empty axis object. So if my hatch is rotating with Y axis rotation of the empty, I wanted to limit X and Z to 0, and Y to a range of 0 to 90 degrees. I thought that this was how it would work, if I selected Local in the constraint editor (which I did).

I have been watching tutorials and reading the manual, trying to figure out where I went wrong, but am still in the dark. I think I followed instructions exactly, yet I can’t get a reasonable rotation constraint onto my hatches. [Therefore somewhere along the way I did not follow instructions exactly :-)] A zillion people must have solved this problem (or never even got confused in the first place) because of all the spacecraft and airplane modellers out there so I am hoping this is a classic n00b error and someone can put me right in one or two sentences.

Got pics and blend file?

Sorry, I am new around here and still getting the hang of it… My blend file is pretty rudimentary, just a sandbox for learning a couple of concepts – joining meshes while getting rid of unseen interior structure (unions) and hinges in various orientations. And here it is…

HingesDoorsUnions.blend (591 KB)

And I hope that worked… thanks in advance for any light you can shed!

Hi Pyro
I did post my blend file… hoping that someone, maybe your kind self, will see immediately what I did wrong…

The constraint is in the wrong place for the bone. You’re using an object constraint which is for the armature object, instead it should be a bone constraint, in pose mode.