What I have been doing in blender requires me to orient the camera to face planes oriented along the x and y axis head on.

In other words, the camera plane needs to be perfectly parallel to the x-y plane.

I can more or less get what I want if I choose top view and move the camera and center it on the x-y axis. But then I need to rotate it to face the x-y plane directly.

This is tedious and the result is imprecise.

(It's been far easier to just rotate whatever object I'm working with to face the camera's weird default angle, but then I lose the sense of logic in the coordinate system, and it's still imprecise.)

A programmatic solution might be best.

  • $\begingroup$ You can of course move the viewport to a side view, top view, or any view, and press Ctrl+Alt+Numpad 0. Is this a viable solution? $\endgroup$
    – VRM
    Jun 13 '15 at 22:06
  • $\begingroup$ another alternative: blender.stackexchange.com/a/31568/1853 $\endgroup$
    – user1853
    Jun 14 '15 at 0:32
  • $\begingroup$ Clearing the camera's rotation (Alt R) is likely the fastest way to do this $\endgroup$
    – gandalf3
    Jun 16 '15 at 19:53

The question suggests that you are using the manipulator widgets or mouse to position and rotate your assets.

Blender provides numerous input methods for performing transform operations upon assets.

To specifically answer your question:
Typing (or pasting) the following into the console will center the camera 3 blender units above the world origin, and orient it so that it is looking directly at the x-y plane.

bpy.data.objects['Camera'].rotation_euler[0] = 0
bpy.data.objects['Camera'].rotation_euler[1] = 0
bpy.data.objects['Camera'].rotation_euler[2] = 0
bpy.data.objects['Camera'].location[0] = 0
bpy.data.objects['Camera'].location[1] = 0
bpy.data.objects['Camera'].location[2] = 3  

However, there are simpler methods for achieving the same results;
With the camera selected, you can input the numerical values directly into the input fields shown here
enter image description here

or even simpler; with the camera selected;
press [Alt + G] (to reset the camera position)
press [Alt + R] (to reset the camera rotation)
then drag on the blue manipulator arrow to raise the camera to any height you like.

Or you can set the camera to the view plane as suggested by NoviceInDisguise


If you lock the X and Y rotation of the camera, every movement will stay oriented toward the XY plane.

enter image description here


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.