LDraw.org - Centralized LDraw Resources

  Download | Reference | Community | Parts Library | Login

  Tutorials | Books | Documentation | Specifications | FAQ | Glossary | Help Desk

Reference: Tutorials: Conversion 101 - Converting LDR Files to POV Files for Rendering

Conversion 101 - Converting LDR Files to POV Files for Rendering
By: Jeroen de Haan and Jake McKee
Posted: March 26, 2002
Version: v1 rev.1 110202

Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6

Chapter 5: Camera and lenses (part 1)
For a picture, you need three things: a model, light and a camera. Leave one out and the will be no picture (a Zen Buddhist would say you also need someone to watch the picture but more on that in the tutorial "Zen and the Art of LDraw).

With what we have rendered so far, you don't need to think about lights and camera placement. L3P very kindly places both of them for you at "fixed" locations. However, many times, you will want to change them to better suit your needs. So let's dive into camera placement and how L3P knows where to place it!

Before we start actually talking about the camera, we need to make sure that we understand the world the camera lives in, so to speak.

L3P uses the same coordinate system as LDraw. Remember those X, Y, Z axes from math class? Well, they're back! The X axis can be though of as the left to right plane, Y is the up to down plane, and Z is the forward to back plane. X and Z are parallel to the floor, while Y is perpendicular.

All three axes have both a positive and negative direction. Each axes changes from positive to negative at the center point of the globe. LDraw's coordinate system defines the axes in the following way:

+X (or simply X): Moving along the X axis to the right
-X: Moving along the X axis to the left

+ Y: Moving along the Y axis upwards
-Y: Moving along the Y axis downwards

+Z: Moving along the Z axis into the background
-Z: Moving along the Z axis into the foreground

If you take a look at the picture below, you will see all three axes, as well as a "globe" that is formed around them. This globe is the key to understanding how to move the camera and lights. L3P considers the model to be placed inside this globe, with the center point of the model's bounding box at the same place as the center point of the globe. (For reference, the Bounding Box is an imaginary box that the model fits in exactly. The top of the box lays on top of the highest point of the model, the bottom at the lowest point, and so on.)

Based on this globe system, the camera and lights can be easily placed by specifying Latitude, Longitude, and Radius (also known as polar coordinates).

Latitude is in the range from -90 degrees (south, along the positive y-axis) to 90 degrees (north, along the negative y-axis). Zero degrees is at the equator. Longitude is in the range from -180 to 180, where 0 degrees is along the negative z-axis. 90 degrees (east) is then along the positive x-axis and -90 degrees (west) is along the negative x-axis.

The basic LDraw views can be represented by these Latitude, Longitude pairs: Front=0,0 Right=0,-90 Left=0,90 Back=0,180 Over=90,0 Under=-90,0.

By now, you are probably asking, "This is great and all, but how do I move the camera around?" So let's dive into it!

The camera is placed at a certain distance from the model, which is called the "radius". By default, L3P calculates the radius so that the model fits very tightly in the rendering window. If you look at your last rendering, you see that the roof of the car is almost at the edge of the rendering window as is the bumper. If you want to specify a different camera globe position, L3P wants to know three things: the latitude (north or south position), longitude (east or west position) and radius (camera distance). As you can see in your last rendering, L3P calculates the radius so, that the model fits almost exactly in the picture. If you want you can move the camera away from the model so there is more space around the picture. The amount you give is a percentage.

By default L3P will place the camera as close as possible to the model. The viewing direction will be parallel to the direction given by the latitude () and longitude (). This won't necessarily be through the globe's center (also the model's center).

Think of the camera view towards the model as a funnel, with the point of funnel at the camera lens and the open end pointing towards the model. The funnel will be rotated so that its centerline is parallel to the direction vector defined by and coordinates. L3P will move the funnel towards the model until it cannot come any closer.

The rendered image may look a bit distorted when the camera is moved that close, but this is to minimize the waste of empty rendered area. However, to get a nicer looking image (and a better look at the shadows) it may actually be better to have some amount of space around the model. To add this space, simply move the camera away from the model along the direction vector. If you specify a negative radius, e.g. -20, the camera will be moved 20% further away.

Yeah, yeah, you just want to do more rendering right? So let's do!

Open L3PAO, select CAR.DAT again and change the output name from to CAR02.POV Now go to the left column in the "switchboard" and check the -cg box. In the three input boxes, type in 0, 0, and -10 from left to right. Don't forget to add a floor and a background! Hit "Run L3P", and then render the new CAR02.POV file It will look like this:

Do you see what you did? You positioned the camera at the front of the model, and moved the camera back 10%. Fun, eh?

Now experiment for yourself on views. Try some different latitude and longitude settings to get a good feel of the polar coordinate system.

As an added feature of L3PAO, there is a "View Preset" pull-down menu that offers several standard views. These presets are already set to use the correct latitude, longitude, and radius to render some standard angles. You can use these as-is, or choose a preset and change the parameters a bit.

Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6

  Tutorials | Books | Documentation | Specifications | FAQ | Glossary | Help Desk

© 2003 LDraw.org. See Legal Info for details.

In Memory of James Jessiman - 1971-1997