<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BrickEngineer: LEGO Design&#187; Rendering</title>
	<atom:link href="http://www.brickengineer.com/pages/category/rendering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brickengineer.com/pages</link>
	<description>LEGO Engineering for LEGO NXT and Robot Enthusiasts</description>
	<lastBuildDate>Sun, 08 Jan 2012 05:53:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>LEGO Rendering Tutorial: The Basics</title>
		<link>http://www.brickengineer.com/pages/2009/02/15/lego-rendering-tutorial-the-basics/</link>
		<comments>http://www.brickengineer.com/pages/2009/02/15/lego-rendering-tutorial-the-basics/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 01:44:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[exploration]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[LDRAW]]></category>
		<category><![CDATA[LEGO]]></category>
		<category><![CDATA[LEGO mindstorms]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[MLCAD]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[POV-Ray]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[render]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[solutions]]></category>
		<category><![CDATA[starting]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/?p=49</guid>
		<description><![CDATA[This is the first in a series of installments that describe how to render high-quality 3D images of your LEGO creations.  You will need the following free software: LDraw MLCad L3P POV-Ray v3.6 which can be downloaded with the LDraw All In One Installer In this tutorial, we will be aiming for a nice simple [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first in a series of installments that describe how to render high-quality 3D images of your LEGO creations.  You will need the following <em>free</em> software:</p>
<ul>
<li>LDraw</li>
<li>MLCad</li>
<li>L3P</li>
<li>POV-Ray v3.6</li>
</ul>
<p>which can be downloaded with the <a title="LDRAW Installer" href="http://www.ldraw.org/Article104.html" target="_blank">LDraw All In One Installer</a></p>
<p>In this tutorial, we will be aiming for a nice simple still image of three bricks.  In later tutorials, we will animate them.  That will require extra software to put a series of inages together to form a video or an animated gif.  I use Adobe ImageReady to make animated gifs, but there are cheaper solutions.</p>
<p>You can also download all the files we will create here<br />
<a href="http://www.brickengineer.com/pages/files/BE_render_tutorial_1.zip">BE_render_tutorial_1.zip</a><br />
and follow along.</p>
<p><strong>STEP 1: Create an MLCad file of the scene to be rendered<br />
</strong></p>
<p>Open MLCad and prepare to place a few LEGO pieces in the scene.</p>
<p><strong><em>Step 1.1</em>: </strong>Set up a 1&#215;1 brick<br />
On the upper left-hand side, click on <em>Brick</em>.<br />
Drag the 1&#215;1 brick into one of the three viewing panels.<br />
With the brick selected click the <span style="color: #ff0000;">RED</span> color button to color it red.<br />
Right-click on the brick and select <em>Enter Pos. + Rot&#8230;<br />
Use Position Values</em> should be checked<br />
Set the X and Z values all to zero and Y to -100 (negative 100)</p>
<p><strong><em>Step 1.2</em>: </strong>Add a 2&#215;4 brick<br />
Following the steps above, find the 2&#215;4 brick in the <em>Brick</em> list (+ will expand the list) and add it to the scene.  Set its color to <span style="color: #ffcc00;">YELLOW</span> and its position to X=100, Y=-100,  Z=50.</p>
<p><strong><em>Step 1.3</em>: </strong>Add a 2&#215;6 plate<br />
Following the steps above, find the 2&#215;6 plate in the <em>Plate</em> list (you will have to scroll down to the <em>Plate</em> tab) and add it to the scene.  Set its color to <span style="color: #0000ff;">BLUE</span> and its position to X=100, Y=-100,  Z=-100.</p>
<p>Be sure that these pieces are all at Y=-100.  The -y direction points upward and this will place them above the Y=0 plane.</p>
<p><strong><em>Step 1.4</em>: </strong>Save your work as <strong><em>part-zoo-1.ldr</em></strong></p>
<p>The screenshot below shows what you should see at this point on your MLCad screen.</p>
<div id="attachment_57" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-57" title="mlcad-screenshot-render-tutorial-1_450x316" src="http://www.brickengineer.com/pages/wp-content/uploads/2009/02/mlcad-screenshot-render-tutorial-1_450x316.jpg" alt="MLCad Screenshot" width="450" height="316" /><p class="wp-caption-text">MLCad Screenshot</p></div>
<p><em><br />
</em><strong><em></em></strong></p>
<p><strong>STEP 2: Create a POVRay file using L3PAO</strong></p>
<p>Open LP3AO (<em>L3P-Add-on)</em> keeping in mind where you stored your MLCad files.  This figure shows you the basic L3PAO window.</p>
<div id="attachment_59" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-59" title="l3pao-screenshot-render-tutorial-1_450x468" src="http://www.brickengineer.com/pages/wp-content/uploads/2009/02/l3pao-screenshot-render-tutorial-1_450x468.jpg" alt="L3PAO Screenshot" width="450" height="468" /><p class="wp-caption-text">L3PAO Screenshot</p></div>
<p><strong><em>Step 2.1</em>:</strong> In the <em>L3P-Add-on</em> window set the <em>Model File</em> to point to your MLCad file.  To browse, you may need to click on the button labeled &#8230;</p>
<p><strong><em>Step 2.2</em>:</strong> In the <em>L3P-Add-on</em> window set the <em>POV-Ray Output File</em> to point to the folder where you want your POV-Ray file to go.  To browse, you may need to click on the button labeled &#8230;</p>
<p><strong><em>Step 2.3</em>:</strong> In the middle of the right-hand column is the Quality Level setting.  Set this to 2.  IF you select 3 it prints the LEGO logo on every stud.  If you want this, you may leave it.  But I prefer to remove them.</p>
<p><strong><em>Step 2.4</em>:</strong> At the bottom of the middle column is the <em>Render upon Completion</em> option.  This will launch POV-Ray automatically.  However, if you have problems with the automatic launch, turn this option off and load it manually.  In later tutorials, we will edit the POV-Ray file manually anyway.</p>
<p><strong>Step: 2.5:</strong> To start <em>L3PAdd-on</em> click on the <em>Run L3P</em> button in the lower right.  This will create the POV-Ray <strong><em>part-zoo-1.pov</em></strong> file in the directory you specified, and possibly launch POV-Ray depending on the settings you used in <em>Step 2.4</em> above.</p>
<p><strong>STEP 3: Render the Image with POV-Ray<br />
</strong></p>
<p>If you launched POV-Ray automatically, you will already have your image.  Here we assume that you will render it manually.</p>
<div id="attachment_60" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-60" title="povray-screenshot-render-tutorial-1_450x433" src="http://www.brickengineer.com/pages/wp-content/uploads/2009/02/povray-screenshot-render-tutorial-1_450x433.jpg" alt="POV-Ray Screenshot" width="450" height="433" /><p class="wp-caption-text">POV-Ray Screenshot</p></div>
<p><strong><em>Step 3.1</em>:</strong> Open POV-Ray and in the <em>File Menu</em>, use <em>Open File</em> to open the .pov file that was created by L3pAO.</p>
<p><strong><em>Step 3.2</em>:</strong> Once the file is open, you can simply press the <em>Run</em> button on the upper bar.  This will create a default image, which is a 640&#215;480 .bmp bitmap image.  This is saved automatically in the same folder as your .pov file.  Here it is:</p>
<div id="attachment_61" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-61" title="part-zoo-1-default" src="http://www.brickengineer.com/pages/wp-content/uploads/2009/02/part-zoo-1-default.jpg" alt="Part-Zoo-1 Default image" width="450" height="338" /><p class="wp-caption-text">Part-Zoo-1 Default image</p></div>
<p>Note that the LEGO pieces are lifted up above the floor.  This is because we set their y-coordinates to be -100, which is above the floor at zero.  Remember that negative y is up.  We now look to change a few features of our render.</p>
<p><strong><em>Step 3.3</em>:</strong> If you click on the <em>Ini</em> button (to the left of <em>Run</em> above), you will go to a screen that enables you to change the size of the output image.  The <em>Section</em> field on the right has many options that include the resolution of the final image as well as whether <a title="Anti-Aliasing" href="http://en.wikipedia.org/wiki/Anti-aliasing" target="_blank">Anti-Aliasing</a> (AA) is used.  Try changing the resolution and look at the differences between anti-aliased images and non-anti-aliased images.</p>
<p>Note however, that the output images will always be saved in either .bmp or .png format.  You will have to use another program to convert them to other formats if you are interested.</p>
<p><strong><em>Step 3.4</em>: </strong>You can try playing with the commands in the .pov file.  POV-Ray acts like an editor and you can manually edit your files.  For example, there is a section near the bottom that reads:</p>
<blockquote><p>// Floor:<br />
object {<br />
plane { y, 24 hollow }<br />
texture {<br />
pigment { color rgb &lt;0.8,0.8,0.8&gt; }<br />
finish { ambient 0.4 diffuse 0.4 }<br />
}<br />
}</p></blockquote>
<p>This code controls the floor of the image.  If you delete it completely, the floor will disappear as you can see here in this image:</p>
<div id="attachment_64" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-64" title="part-zoo-1-no-floor" src="http://www.brickengineer.com/pages/wp-content/uploads/2009/02/part-zoo-1-no-floor.jpg" alt="Part-Zoo-1 with No Floor" width="450" height="338" /><p class="wp-caption-text">Part-Zoo-1 with No Floor</p></div>
<p><strong>Step 3.4: </strong>IF you don&#8217;t like the black background, look in the .pov file for the <em>Background</em> section:</p>
<blockquote><p>// Background:<br />
background { color rgb &lt;0,0,0&gt;}</p></blockquote>
<p>Changing the rgb (red, green, and blue) colors to &lt;0.7, 0.7, 1.0&gt;:</p>
<blockquote><p>// Background:<br />
background { color rgb &lt;0.7, 0.7, 1.0&gt;}</p></blockquote>
<p>Will give you an image with no floor and a light blue background:</p>
<div id="attachment_66" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-66" title="part-zoo-1-blue-background" src="http://www.brickengineer.com/pages/wp-content/uploads/2009/02/part-zoo-1-blue-background.jpg" alt="Part-Zoo-1 with a blue blackground" width="450" height="338" /><p class="wp-caption-text">Part-Zoo-1 with a blue blackground</p></div>
<p>We have explored making simple cad images in MLCad, generating a .pov file using L3PAO, and rendering a high-quality bitmap image using POV-Ray.   You should read through the .pov file and try to figure out what the different parts do.  You can change their values and re-render the image to see what impact your changes have.  Just remember that POV-Ray saves the changes on top of the original file,  so you may want to make a backup first.</p>
<p>Happy Rendering!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2009/02/15/lego-rendering-tutorial-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

