<?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; Uncategorized</title>
	<atom:link href="http://www.brickengineer.com/pages/category/uncategorized/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>Philo&#8217;s Extreme NXT Pages</title>
		<link>http://www.brickengineer.com/pages/2011/11/05/philos-extreme-nxt-pages/</link>
		<comments>http://www.brickengineer.com/pages/2011/11/05/philos-extreme-nxt-pages/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 11:55:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[LEGO mindstorms]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/?p=226</guid>
		<description><![CDATA[Phillipe &#8220;Philo&#8221; Hurbain, co-author of Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level (Technology in Action) has a wonderful website dedicated to the technical aspects of LEGO NXT and its component sensors and motors. Philo&#8217;s website has several tabs corresponding to different topic areas: LEGO® MINDSTORMS™ &#038; LEGO Technic: a variety of [...]]]></description>
			<content:encoded><![CDATA[<p>Phillipe &#8220;Philo&#8221; Hurbain, co-author of <a href="http://www.amazon.com/gp/product/1430224533/ref=as_li_qf_sp_asin_tl?ie=UTF8&#038;tag=onlicort-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399369&#038;creativeASIN=1430224533">Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level (Technology in Action)</a><img src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&#038;l=as2&#038;o=1&#038;a=1430224533&#038;camp=217145&#038;creative=399369" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> has a wonderful website dedicated to the technical aspects of LEGO NXT and its component sensors and motors.</p>
<p>Philo&#8217;s website has several tabs corresponding to different topic areas:<br />
<a href="http://www.philohome.com/mindstorms.htm" title="Philo's LEGO Mindstorm's and LEGO Technic">LEGO® MINDSTORMS™ &#038; LEGO Technic</a>: a variety of interesting projects<br />
<a href="http://www.philohome.com/nxt.htm" title="NXT">NXT</a>: details about LEGO NXT components and NXT-specific projects<br />
<a href="http://www.philohome.com/sensors.htm" title="Sensors">Sensors</a>: detailed information about sensor workings and electronics<br />
<a href="http://www.philohome.com/tech.htm" title="LEGO Technical Information">LEGO Tech Info</a>: LEGO technical information<br />
<a href="http://www.philohome.com/ldraw.htm" title="LDraw tools for part authors">LDraw</a>: tools for LDraw part authors<br />
<a href="http://www.philohome.com/legophoto.htm" title="LEGO for photographers">LEGO &#038; Photo</a>: accessories for photographers</p>
<p>My favorite pages are:<br />
<a href="http://www.philohome.com/motors/motorcomp.htm" title="LEGO Motors">LEGO® 9V Technic Motors compared characteristics</a> studies the various characteristics of a wide variety of LEGO motors.<br />
http://www.philohome.com/traction/traction.htm studies the capabilities of a wide variety of LEGO wheels.</p>
<p>Enjoy!<br />
and check out his new book:<br />
<iframe src="http://rcm.amazon.com/e/cm?t=onlicort-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=1430224533&#038;ref=qf_sp_asin_til&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2011/11/05/philos-extreme-nxt-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Grown Man Builds LEGO Boba Fett Costume!</title>
		<link>http://www.brickengineer.com/pages/2009/11/15/grown-man-builds-lego-boba-fett-costume/</link>
		<comments>http://www.brickengineer.com/pages/2009/11/15/grown-man-builds-lego-boba-fett-costume/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 23:55:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[LEGO mindstorms]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/?p=133</guid>
		<description><![CDATA[Geekologie posted an article about a man who made a wearable Boba Fett costume out of LEGOs. Mind you, its not a full costume. The helmet is most impressive, the rest are pieces of LEGO body armor that attach to his outfit. Actually, I am a bit more impressed by the LEGO Darth Vader costume! [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.geekologie.com/2008/08/grown_man_builds_lego_boba_fet.php">Geekologie posted an article</a> about a man who made a wearable Boba Fett costume out of LEGOs.  Mind you, its not a full costume.  The helmet is most impressive, the rest are pieces of LEGO body armor that attach to his outfit.</p>
<div id="attachment_134" class="wp-caption aligncenter" style="width: 460px"><img src="http://www.brickengineer.com/pages/wp-content/uploads/2009/11/boba-lego-1.jpg" alt="LEGO Boba Fett Costume" title="LEGO Boba Fett Costume" width="450" height="300" class="size-full wp-image-134" /><p class="wp-caption-text">LEGO Boba Fett Costume</p></div>
<div id="attachment_135" class="wp-caption aligncenter" style="width: 460px"><img src="http://www.brickengineer.com/pages/wp-content/uploads/2009/11/boba-lego-2.jpg" alt="LEGO Boba Fett Helmet" title="LEGO Boba Fett Helmet" width="450" height="338" class="size-full wp-image-135" /><p class="wp-caption-text">LEGO Boba Fett Helmet</p></div>
<p>Actually, I am a bit more impressed by the LEGO Darth Vader costume!<br />
Who IS that masked man???</p>
<div id="attachment_136" class="wp-caption aligncenter" style="width: 460px"><img src="http://www.brickengineer.com/pages/wp-content/uploads/2009/11/darth-lego.jpg" alt="LEGO Darth Vader Costume" title="LEGO Darth Vader Costume" width="450" height="600" class="size-full wp-image-136" /><p class="wp-caption-text">LEGO Darth Vader Costume</p></div>
<p>If only, it had lights that were controlled by the LEGO Mindstorms Brick, and a Breathing apparatus controlled by the LEGO pneumatic system!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2009/11/15/grown-man-builds-lego-boba-fett-costume/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interface a Potentiometer to the NXT</title>
		<link>http://www.brickengineer.com/pages/2009/10/05/interface-a-potentiometer-to-the-nxt/</link>
		<comments>http://www.brickengineer.com/pages/2009/10/05/interface-a-potentiometer-to-the-nxt/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 15:12:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[LEGO Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[extreme]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[LEGO]]></category>
		<category><![CDATA[LEGO mindstorms]]></category>
		<category><![CDATA[NXT]]></category>
		<category><![CDATA[potentiometer]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/?p=92</guid>
		<description><![CDATA[NOTE: WE ARE NOT RESPONSIBLE FOR ANY DAMAGE YOU MAY DO TO YOUR NXT BRICK. THIS EXERCISE PRESUMES SOME WORKING KNOWLEDGE OF ELECTRONICS. In this exercise, I will walk you through interfacing a potentiometer (variable resistor) to the NXT brick. You will need: - A stripped NXT cable - A potentiometer with a maximum resistance [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: WE ARE NOT RESPONSIBLE FOR ANY DAMAGE YOU MAY DO TO YOUR NXT BRICK.<br />
THIS EXERCISE PRESUMES SOME WORKING KNOWLEDGE OF ELECTRONICS.</strong></p>
<p>In this exercise, I will walk you through interfacing a potentiometer (variable resistor) to the NXT brick.<br />
You will need:<br />
- A stripped NXT cable<br />
- A potentiometer with a maximum resistance no more than <img src='http://www.brickengineer.com/pages/latexrender/pictures/070c47ad71d57ef2eacf1d64186ccd3a.gif' title='$10 k\Omega$' alt='$10 k\Omega$' align=absmiddle><br />
- A small piece of wire<br />
- An NXT Brick</p>
<p>This exercise is derived and expanded from a chapter in Extreme NXT by Gasperi, Hurbain and Hurbain.</p>
<p><strong>THEORY</strong></p>
<p>The NXT monitors the potential difference between the black and white wires with an Analog-to-Digital (A/D) converter.  The A/D converter converts this potential difference to a RAW value between 0 and 1023 (10 bits accuracy).  This RAW value is given by the ratio</p>
<p>(1)     <img src='http://www.brickengineer.com/pages/latexrender/pictures/1cad6789deeb4cd24eda028aaf82c9d4.gif' title='$RAW = \frac{RAW_{max}}{V_{max}} V_{R} = \frac{1023}{5} V_{R}$' alt='$RAW = \frac{RAW_{max}}{V_{max}} V_{R} = \frac{1023}{5} V_{R}$' align=absmiddle></p>
<p>where <img src='http://www.brickengineer.com/pages/latexrender/pictures/b43b792b8a0ad9e20bbed3ffe589f270.gif' title='$RAW_{max}$' alt='$RAW_{max}$' align=absmiddle> is the maximum RAW value of 1023, <img src='http://www.brickengineer.com/pages/latexrender/pictures/dd101dae0851cc03c2c9afa9ee7d58eb.gif' title='$V_{max} = 5V$' alt='$V_{max} = 5V$' align=absmiddle> is the voltage used by the NXT A/D Converter, and <img src='http://www.brickengineer.com/pages/latexrender/pictures/bec7483bf7de7666e8169bfb2677affc.gif' title='$V_{R}$' alt='$V_{R}$' align=absmiddle> is the voltage drop between the black and white wires.</p>
<p>The circuit diagram looks like this:</p>
<p><img src="http://www.brickengineer.com/pages/wp-content/uploads/2009/10/ad-nxt-schematic.jpg" alt="NXT A/D Converter Schematic" title="NXT A/D Converter Schematic" width="300" height="300" class="aligncenter size-full wp-image-108" /></p>
<p>I have a little <img src='http://www.brickengineer.com/pages/latexrender/pictures/5e0f22e358604402c3a03443068c077c.gif' title='$1k\Omega$' alt='$1k\Omega$' align=absmiddle> potentiometer that can turn over a range of about <img src='http://www.brickengineer.com/pages/latexrender/pictures/75509215276170cb42d350f8ef4d0a82.gif' title='$0^{\circ}$' alt='$0^{\circ}$' align=absmiddle> to <img src='http://www.brickengineer.com/pages/latexrender/pictures/0bd080041b349b48631cfa8cadce5cd8.gif' title='$270^{\circ}$' alt='$270^{\circ}$' align=absmiddle>.  Below is a diagram.  The resistance between the leftmost and rightmost pins is the maximum resistance of <img src='http://www.brickengineer.com/pages/latexrender/pictures/5e0f22e358604402c3a03443068c077c.gif' title='$1k\Omega$' alt='$1k\Omega$' align=absmiddle>.  We will focus on the resistance between the leftmost and center pins, which varies based on the angle through which the potentiometer has been rotated.  To keep things safe, we wire the center pin and rightmost pin together.  This doesn&#8217;t affect the potential difference between the leftmost and center pins.</p>
<p><img src="http://www.brickengineer.com/pages/wp-content/uploads/2009/10/potentiometer.jpg" alt="Potentiometer Wiring" title="Potentiometer Wiring" width="145" height="200" class="aligncenter size-full wp-image-111" /></p>
<p>I will assume that it is a linear potentiometer (a pretty good assumption), which means that the resistance at any given angle <img src='http://www.brickengineer.com/pages/latexrender/pictures/53d147e7f3fe6e47ee05b88b166bd3f6.gif' title='$A$' alt='$A$' align=absmiddle> is given by</p>
<p>(2)     <img src='http://www.brickengineer.com/pages/latexrender/pictures/9b17fb6a4e23964da4aa54b217d99d7e.gif' title='$R = \frac{A}{A_{max}} R_{max} = \frac{A}{270} \times 1 k\Omega}$' alt='$R = \frac{A}{A_{max}} R_{max} = \frac{A}{270} \times 1 k\Omega}$' align=absmiddle></p>
<p>where <img src='http://www.brickengineer.com/pages/latexrender/pictures/db89de390ca9a572d5f3db56a7d989e5.gif' title='$A_{max}$' alt='$A_{max}$' align=absmiddle> is the maximum angle of the potentiometer and <img src='http://www.brickengineer.com/pages/latexrender/pictures/ea449f9e9a48e2959872aac8fa65e1ca.gif' title='$R_{max}$' alt='$R_{max}$' align=absmiddle> is the <img src='http://www.brickengineer.com/pages/latexrender/pictures/5e0f22e358604402c3a03443068c077c.gif' title='$1k\Omega$' alt='$1k\Omega$' align=absmiddle> maximum resistance.</p>
<p>Equation (2) says that if the angle <img src='http://www.brickengineer.com/pages/latexrender/pictures/d1b9d96e40897ca243ff281f5aee7ce0.gif' title='$A = 0^{\circ}$' alt='$A = 0^{\circ}$' align=absmiddle> then the resistance of the potentiometer  <img src='http://www.brickengineer.com/pages/latexrender/pictures/8a8aab1169d4020852d8d06a8a3e1e24.gif' title='$R_{max} = 0 \Omega$' alt='$R_{max} = 0 \Omega$' align=absmiddle>, and if the angle  <img src='http://www.brickengineer.com/pages/latexrender/pictures/deb17e4443c1eb6e6c679a8913933bd7.gif' title='$A = 270^{\circ}$' alt='$A = 270^{\circ}$' align=absmiddle> then the resistance of the potentiometer is maximum <img src='http://www.brickengineer.com/pages/latexrender/pictures/dd63154537d0661b80239a820feece0e.gif' title='$R_{max} = 1 k\Omega$' alt='$R_{max} = 1 k\Omega$' align=absmiddle>.</p>
<p>Looking at the circuit diagram for the A/D converter, the potential drop across our potentiometer (represented by resistor <img src='http://www.brickengineer.com/pages/latexrender/pictures/1e438235ef9ec72fc51ac5025516017c.gif' title='$R$' alt='$R$' align=absmiddle>) is given by the typical voltage divider relation</p>
<p>(3)     <img src='http://www.brickengineer.com/pages/latexrender/pictures/2bac90d7a171d06bd46e916b0780ff0b.gif' title='$V_R = \frac{R}{R+R_{int}} V_{max} = \frac{R}{R+10k\Omega} \times 5V$' alt='$V_R = \frac{R}{R+R_{int}} V_{max} = \frac{R}{R+10k\Omega} \times 5V$' align=absmiddle></p>
<p>We can now substitute (2) into (3) so that the voltage between the black and white wires is determined by the angle of the potentiometer rather than its resistance.  Then we can substitute the result into (1) to get an equation for the RAW value</p>
<p>(4)     <img src='http://www.brickengineer.com/pages/latexrender/pictures/761c502e47967e1b8673cdaa66330032.gif' title='$RAW = RAW_{max} \frac{A R_{max}}{A R_{max} + A_{max} R_{int}}$' alt='$RAW = RAW_{max} \frac{A R_{max}}{A R_{max} + A_{max} R_{int}}$' align=absmiddle></p>
<p>with my particular values, this is</p>
<p><img src='http://www.brickengineer.com/pages/latexrender/pictures/7780912834bf8933662f2c391d669f62.gif' title='$RAW  = 1023 \frac{A \times 1 k\Omega}{(A \times 1 k\Omega) + (270 \times 10 k\Omega)}$' alt='$RAW  = 1023 \frac{A \times 1 k\Omega}{(A \times 1 k\Omega) + (270 \times 10 k\Omega)}$' align=absmiddle></p>
<p>This formula will let us predict the NXT RAW value based on the angle of the potentiometer.</p>
<p>For my potentiometer, I find that a maximum angle of <img src='http://www.brickengineer.com/pages/latexrender/pictures/0bd080041b349b48631cfa8cadce5cd8.gif' title='$270^{\circ}$' alt='$270^{\circ}$' align=absmiddle> gives me a maximum value of 93.  This is less than 7 bits of information, and each RAW value corresponds to <img src='http://www.brickengineer.com/pages/latexrender/pictures/e22be5d833d32b48854ad4fdf237aff7.gif' title='$2.9^{\circ}$' alt='$2.9^{\circ}$' align=absmiddle>.  If you want a nice angle detector, you will probably need a <img src='http://www.brickengineer.com/pages/latexrender/pictures/070c47ad71d57ef2eacf1d64186ccd3a.gif' title='$10 k\Omega$' alt='$10 k\Omega$' align=absmiddle> potentiometer!</p>
<p><strong>TRY IT</strong></p>
<p>1. Before beginning, you need to cut and strip one of the NXT cables so that you can interface with the wires directly.  I have placed a layer of solder on mine, so they can be inserted into a breadboard for easy connecting.</p>
<p>2. Next connect the center and right pins of the potentiometer together with a wire</p>
<p>3. Plug the other end of the NXT cable into the NXT brick.</p>
<p>I wrote a simple NXT-G program to read the sensor and display the RAW value.  Notice that the Touch Sensor actually reads the resistance between the wires.  So we are just replacing the Touch Sensor with a potentiometer.  We will use the raw number output of the Touch Sensor Block, which is represented by the 1010 0101 symbol.  We then need to convert it to text so it can be displayed on the NXT LCD panel.</p>
<p><img src="http://www.brickengineer.com/pages/wp-content/uploads/2009/10/potentio-01.jpg" alt="potentio-01.rbt Screenshot" title="potentio-01.rbt Screenshot" width="470" height="389" class="aligncenter size-full wp-image-114" /></p>
<p>You may download it here,<br />
<a href="http://www.brickengineer.com/pages/downloads/code/Potentio-01.rbt">Potentio-01.rbt</a><br />
or write your own.</p>
<p>When I try my potentiometer, I find that the RAW value goes from 0 to 95, pretty close to my predicted range of 0 to 93.  So it works! Not bad considering I guessed that the potentiometer sweeps through and angle of <img src='http://www.brickengineer.com/pages/latexrender/pictures/0bd080041b349b48631cfa8cadce5cd8.gif' title='$270^{\circ}$' alt='$270^{\circ}$' align=absmiddle>.</p>
<p><strong><br />
Determining the Angle of the Potentiometer</strong></p>
<p>Now, let&#8217;s convert this RAW value to an angle.<br />
In Extreme NXT, the authors worry about the fact that the resulting relationship is nonlinear with respect to the RAW value.  As far as I can see, this isn&#8217;t a problem.  We simply solve (4) above for the angle <img src='http://www.brickengineer.com/pages/latexrender/pictures/53d147e7f3fe6e47ee05b88b166bd3f6.gif' title='$A$' alt='$A$' align=absmiddle> in terms of RAW.  We can output the angle if we wish, but here I&#8217;ll take it a step further and demonstrate the resulting equation by controlling a motor so that it maintains an angle equal to the angle through which I have rotated the potentiometer.</p>
<p>I will leave out the algebra. Try it yourself.  Solve (4) for angle A:</p>
<p>(5)     <img src='http://www.brickengineer.com/pages/latexrender/pictures/67c4dab90b1bc204c427800a89470354.gif' title='$A = \frac{RAW A_{max} R_{int}}{R_{max} (RAW_{max} &amp;#8211; RAW)}$' alt='$A = \frac{RAW A_{max} R_{int}}{R_{max} (RAW_{max} &amp;#8211; RAW)}$' align=absmiddle></p>
<p>for my potentiometer, this is simply</p>
<p><img src='http://www.brickengineer.com/pages/latexrender/pictures/2dc5e0f8c1957bd00d73303eedad972f.gif' title='$A = \frac{2700 RAW}{(1023 &amp;#8211; RAW)}$' alt='$A = \frac{2700 RAW}{(1023 &amp;#8211; RAW)}$' align=absmiddle></p>
<p>which is easy to code in NXT-G.<br />
You can download my code here:<br />
<a href="http://www.brickengineer.com/pages/downloads/code/Potentio-03.rbt">Potentio-03.rbt</a></p>
<p>The motor control is a bit crude, but it works well enough for the demonstration.<br />
Check out the YouTube video to see it in action!</p>
<p><object width="350" height="283"><param name="movie" value="http://www.youtube.com/v/HpFQX-aM6-c&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HpFQX-aM6-c&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="283"></embed></object></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2009/10/05/interface-a-potentiometer-to-the-nxt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

