Difference between revisions of "Conversion 101"
|Line 114:||Line 114:|
Revision as of 02:02, 31 July 2012
Old page 1
What your reading now is a beginners guide to L3P/L3PAO and POV-Ray. It assumes you have some knowledge of and experience with LDraw and one or more of its editors (such as MLCAD, LeoCAD, BrickDraw3D, etc) and creating models. What it wants to provide is a step by step guide of converting LDraw-models to POV-files and rendering them and what options you have when converting or rendering. What you won't find here is how to create models or parts.
Some chapters are on the practical side; you will do things after reading it. Other chapters are more theoretical, for example about cameras and lenses or color and light. Please read these chapters too. We try to make them as short and "light" as possible but they are important to understand some of the functions and options of L3P and POV-Ray.
Chapter 1: Introduction
So you have made some models; your own or existing Lego models. Now you want to have a nice picture of it, like the ones you see on Brickshelf or on other people's websites. However, your editor for LDraw can't so how do people do that? What you need is three programs and some additional files:
- L3P: a program that converts .DAT, .LDR and .MPD files to .POV (the native file format for POV-Ray)
- L3P AddOn (or L3PAO for short): a graphic interface for L3P
- POV-Ray: a freeware program to ray trace POV-files
- The LGEO-files for POV-Ray.
L3P is a DOS-program. It uses switches to call certain options. So for example, when you want your model with a certain camera position and background color you have to type the following in the DOS-prompt: L3P.exe tp-7745.dat tp-7745.pov -cc0,-96,-250 -ca45 -b0.000,0.000,0.251 -o You have to know (all) the options and their acronyms and when you make a typo, (and who doesn't now and then) you have to type it all over again. Or if you want a batch of models you have to retype the whole line over and over again.
This is why J. Boen created L3P AddOn, a graphic interface for L3P where you can turn on or off options in an easy way AND can save these options in "scenes" or snapshots.
POV-Ray is a freeware program to create and render computer generated pictures or animations. POV-Ray has no graphical interface in the sense that you see what you create; it has a source window where you type text commands and you can see what you created when you render the picture. Luckily, you don't have to learn all these commands; L3P creates a ready to render POV-file!
The LGEO-files for POV-Ray are files that POV-Ray uses to substitute some of the LDraw parts. The LGEO-files look better; cylinders are rounder, sloped bricks have that sandpaper structure, etc. They are also harder to render for POV-Ray; you will need lots of memory to use them.
However, before you can make a nice rendering of your model you have to download the above mentioned software. Best place to start is http://www.ldraw.org/download/win/. Go to the download section and click the appropriate links. We going to guide you with installing the programs but please read the installation guides of each program carefully!
Chapter 2: Downloading and installing L3P, L3PAO and POV-Ray and LGEO
We will start with the easiest: the LGEO-files.
- Go to http://www.el-lutzo.de/lego/lgeo.html
- Download the LGEO POV-Ray Library (Â±548kB)
- Place the Zip-file in the LDraw-directory an unzip it.
- That's it (for now)!
L3P comes in two flavors: a 16-bit version and a 32-bit version. We recommend the latter because it is a bit faster, can handle long directory names (but no long filenames!) and can handle large LDraw files.
- Go to the [/modules.php?op=modload&name=Downloads&file=index Download] section
- Download L3P.zip.
- After downloading L3P.ZIP place the ZIP-file in the LDRAW-directory and unzip it. There are now two files in the LDRAW\L3P directory: L3P.EXE and L3P.TXT.
- DOS has to know where it can find L3P. Open a simple text editor like Notepad and open the AUTOEXEC.BAT or type "EDIT C:\AUTOEXEC.BAT" in the DOS-prompt.
- There probably will be a line starting with "set PATH=%PATH...". Place your cursor at the end of that. Now type the following sentence: ;C:\LDRAW\L3P (see below) and hit "Return" or "Enter".
6. Now L3P has to know where it can find the LDraw parts and models. On the new line type:
assuming the LDraw-directory is there. If you have placed it somewhere else please type the correct directory tree after C:\
7. L3P also needs to know where the LGEO-files are so in a new line under the SET LDRAWDIR line type:
Now every time you start up, DOS will read these commands and "know" where L3P is and where to find the LDraw parts and LGEO-files.
8. So, before going further with the L3PAO installation, please restart Windows.
- L3PAO.ZIP contains three files that should be unzipped in a temporally directory.
- Double click the SETUP.EXE and follow the instructions on screen. It is very simple. All you have to do is to point to the directory where L3PAO should be. By default, this is Program Files\L3PAO but the L3PAO manual recommends the same directory as where L3P is placed. So, hit the change directory-button and change the directory to c:\LDRAW\L3P.
- Now click the button with the computer icon on it. L3PAO will be installed. When finished it is ready to use, no restart needed.
- When you open L3PAO for the first time, it wants to know were it can find L3P (choose the LDRAW/L3P directory), Ledit (in the LDRAW directory) and LGEO-parts. Please point to the right directory.
- If you haven't installed POV-Ray and you open L3PAO, you will get a warning about that. Ignore it, close L3PAO and read on...
POV-Ray comes as POVWIN3.EXE. Download it and place it in a temporary directory. Now follow these 10 steps:
- Double click POVWIN3.EXE. You will be asked if you want to install POV-Ray: Click OK. The License Agreements opens now, read it and close it.
- A window opens asking if you agree with the agreement. Click Yes.
- The installer now asks where to place POV-Ray. By default, this is in the Program Files directory. Click OK if that is OK with you or choose an other directory.
- The installer will place an older version in a backup directory if you want (and have a older version). Choose Yes if you want to place the older version in a backup directory and No if you don't have a older version or don't want a backup of it.
- After copying the files in the right directories, the installer wants to know where to place the shortcut in the Start Menu. Click OK if you are happy with the default or choose an other place.
- The installer can place a shortcut on the desktop. Click Yes or No.
- By default, double clicking a POV-file will just open the file (click Yes). You can choose (but I don't recommend) to choose for double click is open and render. If you really really really want that, click No. By the way: as the window states: clicking with the right mouse button will open a menu where you can choose between Edit or Render.
- Next question: do you want a default directory for rendered files? It's up to you: choose Yes or No. Remember that if you choose No that POV-Ray will place the rendered file in the same directory as the POV-file, which can result in, files scattered all over your hard disk. (I chose Yes).
- A reminder
- Do you want a small demonstration? Click Yes.
Well that was easy wasn't it? You are ready to go now!
- Keep an eye on the various lugnet newsgroups for software updates: lugnet.cad.ray (for POV-Ray), lugnet.cad (for the others) or check ldraw.org.
- Lugnet.cad is also the place to post questions. However, before posting a question do a search to find out if no one posted the same question before you.
Chapter 3: First conversion and rendering
All the software is installed and you are ready to go! From the Start menu, choose L3P Add-On. The program starts and will show the following window:
The L3PAO Interface
Across the top you see three menu-items: File, Tools and Help. Below this are two text fields: the Model File (input) and POV-Ray Output File (output). Then there is the "switchboard" which is divided in 3 columns: camera, lights and other commands. Below these three columns is the "Generated Command Line"-box. This is where you can see (but not edit) the command line, which will be sent to L3P when you hit the "Run L3P" button bottom right. And lastly, the "Exit" button next to the "Run L3P" button, which will simply close the application.
The commands in the three "switchboard" columns will be covered in detail throughout this tutorial. Some of the more advanced topics are not covered. They will be discussed in other tutorials.
Alright, let's get started!
First, we need to load a .dat or .ldr model. To do this, use the "Model File" pull-down menu. Find a model file on your computer, by hitting the "..."-button to the right of the pop-up. You will be presented with a standard Open window where you can browse your computer. Throughout this tutorial, we will use the CAR.DAT, which is located in the LDRAW\MODELS-directory on your computer. This file is copied on your hard disk by the LDraw installer.
Because it is the first time you use L3PAO click the "..." button next to the "Model File"-pop-up. Browse to the LDRAW\MODELS-directory, click the CAR.DAT file and click "Open". The POV-file will be generated in the same directory as the DAT-file, unless you choose to specify a different location. For this example, we will not.
Uncheck "render upon complete" located near the bottom of L3PAO. Now click the "Run L3P" button. A DOS command window will appear and you will be able to watch the L3P commands run. However, if you have a fast computer, the box will disappear before you noticed it was there!
So now it is time to make your first rendering! Open the LDRAW\MODELS folder from your desktop and double click the CAR.POV file. The POV-Ray program will open, and will display the POV-Ray source code.
Before we get into any detail about POV-Ray, follow these instructions:
- On the top left-hand side, there is a pull-down menu with a series of dimensions. Choose 320 x 240, NO AA
- Hit the Start/Run button at the top of the interface to kick off your very first rendering
- POV-Ray will double check the code and prepare to render the car.pov file.
- After a few seconds (depending on your computer speed and the size of the file) a new window will open and line for line your first ray-traced (rendered) LEGO image appears!
Chapter 4: A better first rendering
Yikes! It isn't what you hoped it would be, is it? It is a bit dark ...sort of a "car floating in space. Well you are right... the car is floating in space!
When making LDraw models, you usually don't need to define floors or backgrounds. Ldraw models look fine floating in space because of the flat, 2-Dimensional nature of the look. However, when you create a fully ray-traced model, you see something much closer to items in the real world that you see every day. When you see this "real" image, you expect it to also appear as though it is in a real environment. So let's fix this!
Open L3PAO again and choose the CAR.DAT again. If you look in the right side column, you will see two options: background (-b) and floor (-f)
Click the checkbox to select background. The default background color in L3PAO is black,however, for our new rendering we will choose a different color. Click on the big black square, and a color picker window will open. Choose a nice shade of blue from the predefined colors. Click "OK".
Now select the floor option. By default, the floor is a light shade of gray, but we have some options to change that. There is a pull-down menu were you can choose between "g" (gray) or "c" (checkered, like a chess board).
In addition, there is a box with "Y" above it. This is the distance between the model and the floor. By default, this number is zero and this means the lowest part of your model will touch the floor. You can adjust this distance to make different effects. For instance, if you wanted to render an airplane or other flying object, you can lower the floor to make the model appear to be flying.
For our rendering select the "g" (gray) floor option, and leave the Y field blank. This will provide a rendering of the car sitting on a gray floor.Now, let's see what these new changes do for the rendering. Before we convert the file with these new options, let's change the "output name" of the file, to avoid overwriting our original car.pov file. In the "POV-Ray Output File" field at the top of the interface, change the name CAR.POV to CAR01.POV.
Now we are all set, so hit "Run L3P", and when it is done converting, switch back to POV-Ray, load the new CAR01.POV file, and Hit the "Start/Run" button to render.
Note if you check off "Render upon complete" in L3PAO. L3PAO will open POV-Ray for you automatically and render the image using the last setting that POV-Ray had.
The result should look something like this:
Ah, that looks much better!
Because we have added the added floor, much more light will reflect back on the car, so the car looks much better. In addition, the car casts shadows on the floor so you get a lifelike image. The background will reflect light in the same manner as the floor, but since the background color is blue, the light being reflected is also somewhat blue. You can always change this by changing the background color to white.
Next stop: camera and lenses!