I am trying to get an orthographic render out of Blender with precise accuracy. The scale that I would like is 1"=1'. To prepare my scene, I have changed units to Imperial with separate values. I then changed the output dimensions to 7200x5400 - so that I can get an 24"x18" output at 300ppi. My problem now is setting the orthographic scale. I have tried 12 (for 12 inches in a foot), but the resulting render is too small. After fiddling with the scale manually, I figure that I'd need something less than 7.4, but I don't know how to get a precise scale for my use case.
-
1$\begingroup$ blender.stackexchange.com/questions/64914/… $\endgroup$– Duarte Farrajota Ramos ♦Commented Mar 19, 2020 at 17:42
-
$\begingroup$ Hi :). I made it work with scene units set to inches. The orthographic scale is then 0,6096. But it took me another hour to figure out why. Turns out 24 inches=609,6mm. $\endgroup$– jachym michalCommented Mar 20, 2020 at 0:04
-
1$\begingroup$ I'm voting to reopen this so Qwerty can post his solution as a full answer. Not everyone has @Duarte's big brain :). $\endgroup$– jachym michalCommented Mar 20, 2020 at 0:08
-
$\begingroup$ reopened @qwerty you should post your edit as an actual answer below. $\endgroup$– Duarte Farrajota Ramos ♦Commented Mar 20, 2020 at 1:02
2 Answers
Summary
- Pick the larger of your output width and height. E.g., my render is 4096 px wide by 1024 px tall, so I'd pick width, since 4096 > 1024.
- Find the desired size of the output camera. E.g., my cliff is 1600 ft wide by 400 ft tall. Since width is higher, my camera size needs to be 1600 ft.
- Convert from desired size in scene units to meters. E.g., 1600 ft is 487.68 m.
- Plug the size, in meters, into the camera's scale. E.g., I would set my scale to 487.68.
- Enjoy!
Explanation
This answer will focus on lining the camera up to a plane that's parallel to a major scene plane. Vertical, in the XZ or YZ planes, or horizontal in the XY plane. It will presume you have a rectangular object to line up to. In these cases, it's trivial to position and orient the camera so it's located at the center of the target plane, pointed straight at it.
If you're trying to line up with a non-standard angle, you'll need to do additional math. Duarte's answer to a similar question can give you some ideas about how to calculate the angles.
In my case, I have a flat, vertical plane that's 1600 feet wide by 400 feet tall. It will (hopefully) end up being a cliff face I plan to import into another scene as a bump-mapped diffuse texture. So I set up an orthographic camera that will render to a 4096 x 1024 image for the final material.
Since the plane is 1600 x 400, with the base centered on the world origin, that puts its center at [0 ft, 0 ft, 200 ft]. I simply put the camera at [0, 0, 200], then moved it along the -Y axis. Since cameras point down by default, I rotated it 90° on the X axis, then it was lined up. Again, for more complex angles you might need a bit more math.
As explained in Duarte's answer, the scale of the camera is such that the largest dimension of the output render will be mapped to scale units in the scene. In this case, the output is wider than it is tall, so our scale tells us the width, in Blender units, of the camera.
I initially tried using 4096, then noted that 409.6 was somewhat close. But it's not really close. AAARRGGG!!!! Why??!?!? Blender, whyyyyyy!?????????????
Manually playing with it, I can see that 483 is much closer, but still not quite right.
As noted in the comments and other answer on this page, it's because Blender is using the metric system behind the scenes. Even though Blender is set to Imperial with units of feet, the camera scale expects units of meters.
Now, we could create the entire scene in metric units to begin with, or convert the scene to metric now. But an easier way is just to calculate the factor between feet and meters. Unfortunately, you can't enter units into the camera scale to automatically convert. However, Google, WolframAlpha, etc. will do the math for us, or we can remember from grade school that 2.54 cm is 1 inch.
$1 \text{ ft} \cdot \frac{12 \text{ in}}{1 \text{ ft}} \cdot \frac{2.54 \text{ cm}}{1 \text{ in}} \cdot \frac{1 \text{ m}}{100 \text{ cm}}$ $= \frac{381}{1250} \text{ m}$ $= 0.3048 \text{ m}$ $\rightarrow 1 = \frac{0.3048 \text{ m}}{1 \text{ ft}}$
So we can multiply our values in feet by 0.3048 to get the value in meters.
$1600 \text{ ft} \cdot \frac{0.3048 \text{ m}}{1 \text{ ft}} = 487.68 \text{ m}$
$400 \text{ ft} \cdot \frac{0.3048 \text{ m}}{1 \text{ ft}} = 121.92 \text{ m}$
Since our output is wider than it is tall, we want to use our width value. Instead of plugging 1600 or 4096 or something into the scene, we just need to plug in 487.68. Flawless victory!
Addendum
This process can be used for any other units. You just need to find the scale from your units to meters.
Also, you can plug calculations right into the Blender interface. So if you want your scale to be 895 inches, you can just enter "895*0.0254" in the scale menu.
Imperial Units
- $1 \text{ mile} $ $= \frac{201168}{125} \text{ m}$ $= 1609.344 \text{ m}$
- $1 \text{ foot} $ $= \frac{381}{1250} \text{ m}$ $= 0.3048 \text{ m}$
- $1 \text{ inch} $ $= \frac{127}{5000} \text{ m}$ $= 0.0254 \text{ m}$
- $1 \text{ thou} $ $= \frac{127}{5000000} \text{ m}$ $= 0.0000254 \text{ m}$
Metric Units
- $1 \text{ kilometer} $ $= 1000 \text{ m}$
- $1 \text{ meter} $ $= 1 \text{ m}$ (*gasp*)
- $1 \text{ centimeter} $ $= \frac{1}{100} \text{ m}$ $= 0.01 \text{ m}$
- $1 \text{ millimeter} $ $= \frac{1}{1000} \text{ m}$ $= 0.001 \text{ m}$
- $1 \text{ micrometer} $ $= \frac{1}{1000000} \text{ m}$ $= 0.000001 \text{ m}$
No Units
- $1 \text{ internal Blender unit} $ $= 1 \text{ m}$
Post Script
I presume the camera's scale is actually just using internal Blender units, not metric. But because the units system maps 1 Blender unit to 1 meter, we can conveniently use real-world conversions instead of having to remember some arbitrary conversion from Blender units to one real unit, then convert real unit to real unit.
It's simpler to just pretend internal Blender units are meters.
-
1$\begingroup$ Nice! Bookmarking this for future reference, thanks :) $\endgroup$ Commented Aug 13, 2021 at 10:49
Unfortunately the answer by Duarte Farrajota Ramos does not address the orthographic scaling in imperial units. However, after pulling my hair out for a few hours, I finally understood that the Blender cameras do not respect the scene units (is this a bug?). So what I did was to set the orthographic scaling to 0.9144 so that it would match a yard (it seems that a yard is a better target than a foot) and then adjust the unit scaling in the scene properties, and voila, it works!