<?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>A Party to the World &#187; graphics</title>
	<atom:link href="http://dan.lecocq.us/wordpress/tag/graphics/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.lecocq.us/wordpress</link>
	<description>Life, love, and computer science</description>
	<lastBuildDate>Fri, 06 Jan 2012 17:21:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Triangle Strip for Grids &#8211; A Construction</title>
		<link>http://dan.lecocq.us/wordpress/2009/12/25/triangle-strip-for-grids-a-construction/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/12/25/triangle-strip-for-grids-a-construction/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 09:02:36 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[mesh]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[triangle strip]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=791</guid>
		<description><![CDATA[I&#8217;m working with WebGL and as such, I&#8217;m discovering some quirks about OpenGL ES 2.0. I have been using display lists as long as I&#8217;ve been using OpenGL, but WebGL doesn&#8217;t have support for them. So, I&#8217;m buckled down and familiarized myself with vertex buffer objects, the (perhaps better) alternative. At any rate, I need [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working with WebGL and as such, I&#8217;m discovering some quirks about OpenGL ES 2.0.  I have been using display lists as long as I&#8217;ve been using OpenGL, but WebGL doesn&#8217;t have support for them.  So, I&#8217;m buckled down and familiarized myself with vertex buffer objects, the (perhaps better) alternative.</p>
<p>At any rate, I need to render a regular 2D grid, and as it doesn&#8217;t support quads, either, I was forced to use triangles.  In the interest of getting things running, I just provided a wasteful list of discrete triangles.  This is wasteful because it references many more vertices than necessary &#8211; I ended up declaring $$6n^2$$ vertices when in reality there are only $$n^2 + n + 1$$ unique vertices.  This worked fine, until I wanted to increase the resolution.  It turns out, JavaScript doesn&#8217;t like large arrays.</p>
<p>That&#8217;s fair, because the implementation was pretty wasteful.  A triangle strip was the best choice anyway.  <strong><em>A triangle strip is a highly compact form of representing a mesh.  For $$n$$ triangles, it requires only $$n + 2$$ vertices defined.</em></strong>  Well, that&#8217;s roughly true.  We&#8217;ll see another case in a minute.  It&#8217;s useful when many triangles share vertices, and perhaps I&#8217;ll let <a href="http://en.wikipedia.org/wiki/Triangle_strip">Wikipedia&#8217;s explanation</a> stand.</p>
<p>It wasn&#8217;t immediately obvious how to define a grid out of a single triangle strip and so I got out a pen and paper.  I kept in mind a neat trick: <strong><em>if in a triangle strip, you need to skip the use of a vertex, a vertex can be introduced twice in a row.</em></strong>  That is, if I need triangles (6, 3, 7) and (7, 11, 6) in that order, you can just make your strip with 6, 3, 7, 7, 11, 6.  You can think of it as if there are two triangles created (3, 7, 7) and (7, 7, 11), but they have no area and a degenerate case &#8211; a line.  Furthermore, these lines lie on triangles already defined.</p>
<p>Perhaps the obvious choice doesn&#8217;t yield any results, and in fact in this layout, it can&#8217;t be easily done (you have to have vertices appear three times in a row):</p>
<div id="attachment_792" class="wp-caption aligncenter" style="width: 217px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_bad.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_bad.png" alt="" title="mesh_bad" width="207" height="193" class="size-full wp-image-792" /></a><p class="wp-caption-text">This is a bad idea for a topology if you want to use a single triangle strip.</p></div>
<p>To better convince yourself, try to come up with a good way to put this in a triangle strip.  I&#8217;ll make the case that it is pretty difficult with a claim from graph theory.  In order for a triangle mesh to be turned into a triangle strip, each consecutive triangle must share an edge.  We can then think of the mesh as a connectivity graph (the <a href="http://en.wikipedia.org/wiki/Dual_graph">dual</a> of the mesh) and then the problem will emerge more clearly:</p>
<div id="attachment_794" class="wp-caption aligncenter" style="width: 217px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_bad_dual.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_bad_dual.png" alt="" title="mesh_bad_dual" width="207" height="193" class="size-full wp-image-794" /></a><p class="wp-caption-text">The dual graph of the bad idea.</p></div>
<p>To make the triangle strip &#8220;nice,&#8221; we ought to be able to visit each node once and exactly once.  There&#8217;s good and bad news in this &#8211; it&#8217;s the same problem as finding a <a href="http://en.wikipedia.org/wiki/Hamiltonian_path">Hamlitonian path</a> which is NP complete.  The good news is that if we find a solution to our small problem, we&#8217;ve found a solution to all such grids (with arbitrarily many triangles).  Note that we don&#8217;t need an Eulerian path.</p>
<p>If you stare long enough at the above connectivity graph, you&#8217;ll hopefully convince yourself that there&#8217;s no way to traverse it visiting each node once and exactly once.  Go ahead and try &#8211; it&#8217;s pretty infuriating.</p>
<p>Looking at how we would traverse one strip (triangles a, b, c, d, e and f) actually gives us a clue.  A triangular strip for that case would be 0, 4, 1, 5, 2, 6, 3, 7, and happiness ensues and we should move onto the next row.  Unfortunately, in the context of this new row, we&#8217;re starting in a different place (topologically) than we started with the first strip.  Vertex 0 has two connected neighbors in its row &#8211; 1 and 4.  Vertex 7 has three in its row: 6, 10 and 11.  It turns out we can change up the topology to remedy this simply:</p>
<div id="attachment_795" class="wp-caption aligncenter" style="width: 217px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_good.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_good.png" alt="A much better topology for drawing this with a single triangle strip." title="mesh_good" width="207" height="193" class="size-full wp-image-795" /></a><p class="wp-caption-text">A much better topology for drawing this with a single triangle strip.</p></div>
<p>We can also see that this is a much better solution by looking at this new graph&#8217;s dual:</p>
<div id="attachment_796" class="wp-caption aligncenter" style="width: 217px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_good_dual.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/mesh_good_dual.png" alt="" title="mesh_good_dual" width="207" height="193" class="size-full wp-image-796" /></a><p class="wp-caption-text">The dual of the better topological choice.</p></div>
<p>You can probably easily find a Hamlitonian path in this case.  But this still leaves us with how to determine the vertex orderings.  We decided that the first row ought to be 0, 4, 1, 5, 2, 6, 3, 7, but moving on from there we need a bit of &#8220;glue&#8221; to move onto the next row.  We insert 7 again, and then continue on from there: 7, 11, 6, 10, 5, 9, 4, 8.  A bit more glue for the third row: 8, 12, 9, 13, 10, 14, 11, and 15:</p>
<div id="attachment_797" class="wp-caption aligncenter" style="width: 261px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/strip.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/strip.png" alt="" title="strip" width="251" height="193" class="size-full wp-image-797" /></a><p class="wp-caption-text">An alternative representation of the vertex ordering</p></div>
<p>Looking at the indices from the first row, starting at 0, we can get the next index by alternately adding 4 and then subtracting 3.  On the next row, we&#8217;ll continue to add 4, but then alternately subtract 5.  The 4 is derived as being the number of vertices on a side (if there are $$n$$ divisions, then there are $$n+1$$ vertices), and the 3 and 5 are explained by the fact that we need to change columns in the mesh, by one step at a time.</p>
<p>An clean implementation is not trivial, but not extremely difficult.  In terms of results, I can fit more than 4 times as many vertices into the mesh than with a per-triangle implementation.  And to boot, it has cut the work of the vertex shader a great deal.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/12/25/triangle-strip-for-grids-a-construction/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>webGLot &#8211; A Preview</title>
		<link>http://dan.lecocq.us/wordpress/2009/12/24/webglot-a-preview/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/12/24/webglot-a-preview/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:14:40 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[openglot]]></category>
		<category><![CDATA[plotting]]></category>
		<category><![CDATA[webgl]]></category>
		<category><![CDATA[webglot]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=787</guid>
		<description><![CDATA[I&#8217;ve mentioned WebGL before, and I think it could be very important. There is a competitor from Google, but like OpenGL and OpenCL, this API is managed by the Khronos Group and that fact appeals to me. Perhaps it&#8217;s that I&#8217;ve used it fairly extensively, but I really like OpenGL. Despite its quirks, it&#8217;s quite [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://dan.lecocq.us/wordpress/2009/09/22/the-future-of-the-internet/">mentioned WebGL before</a>, and I think it could be very important.  There is a <a href="http://code.google.com/apis/o3d/">competitor from Google</a>, but like OpenGL and OpenCL, this API is managed by the <a href="http://www.khronos.org/">Khronos Group</a> and that fact appeals to me.  Perhaps it&#8217;s that I&#8217;ve used it fairly extensively, but I really like OpenGL.  Despite its quirks, it&#8217;s quite powerful.</p>
<p>The big &#8220;get&#8221; is that it gives programmers access to hardware-accelerated graphics from directly within the browser.  There&#8217;s a lot of interest in this arena for game development as it would obviate much of the need for separate distributions based on operating system.  (Skip to the end for more of an opinion on this subject.)</p>
<p>As such, I&#8217;ve been working with WebGL as opposed to the Google-proposed O3D.  (I have every intention to explore O3D, time permitting, as there are some jagged edges to the current specification.)  The result of this recent toil is a budding WebGL implementation of my OpenGLot project.  It&#8217;s still in early stages, but in the coming weeks, it should develop even further.  To whet appetites, I have a few pictures.</p>
<div id="attachment_788" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/Picture-105.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/Picture-105-300x182.png" alt="A scalar field, my persistent test function." title="Picture 105" width="300" height="182" class="size-medium wp-image-788" /></a><p class="wp-caption-text">A scalar field, my persistent test function.</p></div>
<div id="attachment_789" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/Picture-111.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/12/Picture-111-300x215.png" alt="A 3D surface, again one of my usual test functions." title="Picture 111" width="300" height="215" class="size-medium wp-image-789" /></a><p class="wp-caption-text">A 3D surface, again one of my usual test functions.</p></div>
<p>I seriously doubt that WebGL will every match the performance of OpenGL.  Even though JavaScript interpreters are getting faster at a somewhat alarming rate, they won&#8217;t match the speed of C or C++.  That said, if one can appropriately offload work onto the GPU, it won&#8217;t matter as much, but there will always be that overhead.</p>
<p>It won&#8217;t so much be a matter of having the same performance, but <em>enough</em> performance.  If a person can go to a single webpage and get 60 frames per second performance in a game or tool without having to install software, that&#8217;s tremendous.  Currently I&#8217;ve been getting between 60 and 90 frames per second with WebGLot, and I&#8217;m sure I can keep that number up as more features are added.</p>
<p>My hope is that this will be a tool and library that has a wide-enough feature set by the time WebGL is widely adopted that becomes often-used.  But that&#8217;s just ego.  The purer motivation is that if you&#8217;re a math teacher, and you want to have interactive demonstrations of Newton&#8217;s method, or parametric surfaces, or even flow fields, you can write an application in 20 minutes that does all the heavy lifting of graphing it for you.  As long as you can describe the mathematical primitives, you should be able to render it.  Of course there will be a general-purpose grapher available for any calculus student who&#8217;s having trouble visualizing this or that, too.  Or a resourceful PDE student who need to solve his homework (the GPU-based PDE solver will take a little bit more time, but it&#8217;s very nearly complete).</p>
<p>In short, the strength of WebGL is that is has respectable performance, and in a year&#8217;s time, half the browsers (well maybe not half) on computers will support it, giving the average internet-user access to a wealth of media.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/12/24/webglot-a-preview/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OpenGLot3D Video</title>
		<link>http://dan.lecocq.us/wordpress/2009/11/30/openglot3d-video/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/11/30/openglot3d-video/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 16:32:14 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[openglot]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=758</guid>
		<description><![CDATA[I gave ScreenFlow a shot, and it was definitely the best screencasting tool I found. Thanks to it, I can now share a more dynamic sense of the capabilities of this plotting library. OpenGLot3D from Dan Lecocq on Vimeo.]]></description>
			<content:encoded><![CDATA[<p>I gave ScreenFlow a shot, and it was definitely the best screencasting tool I found.  Thanks to it, I can now share a more dynamic sense of the capabilities of this plotting library.</p>
<p><object width="600" height="375"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7897262&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7897262&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="375"></embed></object>
<p><a href="http://vimeo.com/7897262">OpenGLot3D</a> from <a href="http://vimeo.com/user2344862">Dan Lecocq</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/11/30/openglot3d-video/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenGLot Release</title>
		<link>http://dan.lecocq.us/wordpress/2009/11/30/openglot-release/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/11/30/openglot-release/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 07:31:59 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[KAUST]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[openglot]]></category>
		<category><![CDATA[plotting]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=746</guid>
		<description><![CDATA[A short while ago I posted a new release of OpenGLot, which featured parametric curves, scalar fields, contour lines and flow fields all implemented in GLSL shaders. And they support time dependence. It can plot virtually any function in x, y and t, and on my MacBook with its NVIDIA GeForce 9400M it has been [...]]]></description>
			<content:encoded><![CDATA[<p>A short while ago I posted a new release of OpenGLot, which featured parametric curves, scalar fields, contour lines and flow fields all implemented in GLSL shaders.</p>
<p>And they support time dependence.</p>
<p>It can plot virtually any function in x, y and t, and on my MacBook with its NVIDIA GeForce 9400M it has been getting 10k+ fps.  I&#8217;m still a little surprised by this number, but it seems to be running at that speed.</p>
<div id="attachment_747" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/flow.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/flow-300x281.png" alt="Flow (vector) fields appear as advected dye. They&#039;re currently streamlines, but in the near future I hope to support streaklines and particle flow as well." title="flow" width="300" height="281" class="size-medium wp-image-747" /></a><p class="wp-caption-text">Flow (vector) fields appear as advected dye. They're currently streamlines, but in the near future I hope to support streaklines and particle flow as well.</p></div>
<div id="attachment_748" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/scalar.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/scalar-300x281.png" alt="Scalar fields appear as a mapping of height onto color.  If this function were to be plotted in 3D, it would like a sheet rippling, but sometimes it&#039;s more useful to see it in 2D." title="scalar" width="300" height="281" class="size-medium wp-image-748" /></a><p class="wp-caption-text">Scalar fields appear as a mapping of height onto color.  If this function were to be plotted in 3D, it would like a sheet rippling, but sometimes it's more useful to see it in 2D.</p></div>
<p>On of the great thing about implementing this on the graphics card is that it doesn&#8217;t require much CPU time on the machine running it.  Even at 10k frames per second, my MacBook never uses more than 30% of a single core&#8217;s time.  A place where this particularly shines is on tiled displays &#8211; a bunch of HDTVs tiled together to run as if it were one large screen.  In such setups, a computer will control 2-4 screens, and each computer&#8217;s graphics card has enough power to run the animation for its portion of the screen.  There are still some bugs to be worked out, but I ran a proof-of-concept on one of the tiled displays at KAUST.</p>
<div id="attachment_752" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/IMG_0014.JPG"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/IMG_0014-300x225.jpg" alt="Running a demo of OpenGLot on a KAUST tiled display" title="IMG_0014" width="300" height="225" class="size-medium wp-image-752" /></a><p class="wp-caption-text">Running a demo of OpenGLot on a KAUST tiled display</p></div>
<p>Lately I&#8217;ve been working on getting the 3D analogs of the various 2D primitives working, again all with time dependence (it&#8217;s the support for animation that really makes this shine in my mind).  So far it&#8217;s surfaces, parametric curves and surfaces and flow fields, but the flow fields have some work yet.  It turns out that while modern hardware is definitely capable of handling 3D flow fields, it doesn&#8217;t actually make much sense when you see the result &#8211; it&#8217;s just too busy.  To be able to easily visualize flow in 3D is very much an open problem.</p>
<div id="attachment_753" class="wp-caption aligncenter" style="width: 302px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/3d-flow.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/3d-flow-292x300.png" alt="3D streamlines end up just becoming confusing more than they are helpful." title="3d-flow" width="292" height="300" class="size-medium wp-image-753" /></a><p class="wp-caption-text">3D streamlines end up just becoming confusing more than they are helpful.</p></div>
<p>In order to get some interesting shapes working, I had to add support for cylindrical and spherical coordinates which is actually providing an interesting challenge &#8211; how best to generate the shaders.  The shader source code (that runs on the graphics card) is generated and compiled when you run OpenGLot, and I&#8217;ve not found an altogether easy and intuitive interface for adding simple coordinate transformations to it.  Still, it works, but the programatic interface will likely change.</p>
<div id="attachment_750" class="wp-caption aligncenter" style="width: 302px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/torus.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/torus-292x300.png" alt="This is a torus of sorts, which I got as an example from Grapher.app" title="torus" width="292" height="300" class="size-medium wp-image-750" /></a><p class="wp-caption-text">This is a torus of sorts, which I got as an example from Grapher.app</p></div><br />
<div id="attachment_751" class="wp-caption aligncenter" style="width: 302px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/torus_normals.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/torus_normals-292x300.png" alt="This is the same torus, just colored by using its surface normals as RGB values" title="torus_normals" width="292" height="300" class="size-medium wp-image-751" /></a><p class="wp-caption-text">This is the same torus, just colored by using its surface normals as RGB values</p></div>
<p>In order to determine surface normals (which are something usually determined when one defines the geometry of an object), the vertex shader approximates various derivatives numerically.  So far, the shading results have been pretty decent.</p>
<div id="attachment_749" class="wp-caption aligncenter" style="width: 302px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/surface_normals.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/surface_normals-292x300.png" alt="A trigonometric function, colored by mapping the surface normals to colors" title="surface_normals" width="292" height="300" class="size-medium wp-image-749" /></a><p class="wp-caption-text">A trigonometric function, colored by mapping the surface normals to colors</p></div><br />
<div id="attachment_755" class="wp-caption aligncenter" style="width: 302px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/surface2_texture.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/surface2_texture-292x300.png" alt="The superimposition of two trigonometric functions, lit based on their surface normals and a texture to give visual clues about distortion" title="surface2_texture" width="292" height="300" class="size-medium wp-image-755" /></a><p class="wp-caption-text">The superimposition of two trigonometric functions, lit based on their surface normals and a texture to give visual clues about distortion</p></div>
<p>I&#8217;m still working on making video of this in action available, but so far a number of the tools I would usually use have come up short.  I&#8217;ve been trying to integrate a video encoder into a utility library for OpenGLot so it can record video straight out of the box, but the framerate is still too low.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/11/30/openglot-release/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Art of Failure</title>
		<link>http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 19:48:26 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[failure]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=719</guid>
		<description><![CDATA[I&#8217;ve failed before, at many things, and it is a habit I can&#8217;t seem to break. It&#8217;s inevitable that things won&#8217;t work (especially not the first time) and in fact programmers know that it&#8217;s a beautiful thing when code compiles the first time, let alone works correctly the first time. With graphics, the results are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve failed before, at many things, and it is a habit I can&#8217;t seem to break.  It&#8217;s inevitable that things won&#8217;t work (especially not the first time) and in fact programmers know that it&#8217;s a beautiful thing when code compiles the first time, let alone works correctly the first time.</p>
<p>With graphics, the results are sometimes cool, sometimes horrifying and sometimes beautiful.  I make a habit of documenting the results of broken code as much as I can, and after a recent one, I thought I&#8217;d share some of the more interesting ones.</p>

<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/nest/' title='nest'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/nest-150x150.png" class="attachment-thumbnail" alt="My most recent muck-up, using a geometry shader to implement marching squares.  It reminds me of an Andy Goldsworthy piece.  Also, birds." title="nest" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/butterfly/' title='butterfly'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/butterfly-150x150.png" class="attachment-thumbnail" alt="At the right zoom, this so-called isocurve appears as a butterfly" title="butterfly" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/cells/' title='cells'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/cells-150x150.png" class="attachment-thumbnail" alt="There appears to be some sort of cellular structure here" title="cells" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/curves/' title='curves'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/curves-150x150.png" class="attachment-thumbnail" alt="At any other zoom level, these apparent curves are invisible." title="curves" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/fern/' title='fern'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/fern-150x150.png" class="attachment-thumbnail" alt="This reminds me of the underwater fern in the Aquanauts" title="fern" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/psychedelia/' title='psychedelia'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/psychedelia-150x150.png" class="attachment-thumbnail" alt="You should see this animating at 10k frames per second.  If only they had this in the seventies - forget the lava lamp." title="psychedelia" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/vector-field/' title='vector field'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/vector-field-150x150.png" class="attachment-thumbnail" alt="Some confusion with vector field implementations." title="vector field" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/isocurve/' title='isocurve'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/isocurve-150x150.png" class="attachment-thumbnail" alt="A breakdown in identifying cases in marching squares." title="isocurve" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/stanford3/' title='stanford3'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/stanford3-150x150.png" class="attachment-thumbnail" alt="It&#039;s like the Stanford bunny is half-trapped in an 8-bit world." title="stanford3" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/stanford1/' title='stanford1'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/stanford1-150x150.png" class="attachment-thumbnail" alt="The Stanford bunny looks sort of demonic here to me." title="stanford1" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/voronoi-2/' title='voronoi'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/voronoi-150x150.png" class="attachment-thumbnail" alt="I never actually quite solved this one, but it was supposed to draw Voronoi diagrams." title="voronoi" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/sine2/' title='sine2'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/sine2-150x150.png" class="attachment-thumbnail" alt="Refraction was broken in my ray tracer for a while." title="sine2" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/loglathe/' title='loglathe'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/loglathe-150x150.png" class="attachment-thumbnail" alt="Is it there? Is it not? Nobody knows!" title="loglathe" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/lathe3/' title='lathe3'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/lathe3-150x150.png" class="attachment-thumbnail" alt="The old disappearing lathe trick." title="lathe3" /></a>

]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/11/13/the-art-of-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VTK and Volume Visualization</title>
		<link>http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 18:40:25 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[chest]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[CT]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[pvm]]></category>
		<category><![CDATA[raw]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[volume]]></category>
		<category><![CDATA[vtk]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=705</guid>
		<description><![CDATA[This week for Scientific Visualization, we&#8217;re talking about volume rendering and using VTK to explore some data. I got some datasets from The Volume Library and after a little tinkering, got VTK to render them. (And now a quick aside on how to do this as I didn&#8217;t find much information on the subject). I [...]]]></description>
			<content:encoded><![CDATA[<p>This week for Scientific Visualization, we&#8217;re talking about volume rendering and using VTK to explore some data.  I got some datasets from <a href="http://www9.informatik.uni-erlangen.de/External/vollib/">The Volume Library</a> and after a little tinkering, got VTK to render them. (And now a quick aside on how to do this as I didn&#8217;t find much information on the subject).</p>
<p>I used a tool (pvm2raw) available as part of the <a href="http://www.stereofx.org/volume.html">V^3</a> library to convert the pvm files to raw, but VTK requires its own simple <a href="http://www.eichberger.de/2005/10/how-to-convert-raw-file-to-vtk.html">header</a>.  I actually found that this particular header didn&#8217;t work (perhaps a VTK versioning problem?) and so taking guidance from this, checked the header of one of the VTK-included volumes:<br />
<code><br />
bash $> head VTKData/ironProt.vk<br />
</code></p>
<p>This header more or less included a little information on the grid size, spacing and representation of the data:<br />
<code><br />
# vtk DataFile Version 1.0<br />
&lt;Name of File&gt;</p>
<p>BINARY</p>
<p>DATASET STRUCTURED_POINTS</p>
<p>DIMENSIONS &lt;x&gt; &lt;y&gt; &lt;z&gt;<br />
ASPECT_RATIO 1 &lt;y/x&gt; &lt;z/x&gt;<br />
ORIGIN 0 0 0</p>
<p>POINT_DATA &lt;x * y * z&gt;<br />
SCALARS scalars &lt;unsigned_char|unsigned_short&gt;<br />
LOOKUP_TABLE default<br />
&lt;remember to include a newline here&gt;<br />
</code></p>
<p>Concatenating the header with the raw:<br />
<code><br />
bash $> cat header CT-Head.raw > CT-Head.vtk<br />
</code></p>
<p>At that point, I was in business and was able to move on to generating pretty pictures.  Granted, these datasets are pretty sparse, but still VTK did a pretty reasonable job.  <strong>Update:</strong> a comment asked for a little bit more detail on this assignment, and so I&#8217;m including <a href='http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/report.pdf'>my report</a> for the project.</p>

<a href='http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/bruce/' title='Bruce'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Bruce-150x150.png" class="attachment-thumbnail" alt="Bruce Gooch&#039;s Head" title="Bruce" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/chest/' title='chest'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/chest-150x150.png" class="attachment-thumbnail" alt="A CT-scan of a human chest" title="chest" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/chest2/' title='chest2'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/chest2-150x150.png" class="attachment-thumbnail" alt="The same chest, from a different direction" title="chest2" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/engine/' title='engine'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/engine-150x150.png" class="attachment-thumbnail" alt="An engine of some type" title="engine" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/foot/' title='foot'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/foot-150x150.png" class="attachment-thumbnail" alt="A foot. &#039;Nuff said." title="foot" /></a>
<a href='http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/orange/' title='orange'><img width="150" height="150" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/orange-150x150.png" class="attachment-thumbnail" alt="A delicious orange" title="orange" /></a>

<p>I was amazed today that we can see inside of things&#8230; without taking them apart.  What an age to live in.  Especially the <a href="http://www.visualiseringscenter.se/1/1.0.1.0/230/1/">virtual autopsy table</a> I read about recently.  In 20 years, we&#8217;ll have Firefly-style real-time holographic body scans (ignore music, skip to 0:45):</p>
<p><object width="480" height="385" class="aligncenter"><param name="movie" value="http://www.youtube.com/v/Kgq_Psl9N6Q&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Kgq_Psl9N6Q&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/11/09/vtk-and-volume-visualization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenGLot &#8211; Scalar Fields</title>
		<link>http://dan.lecocq.us/wordpress/2009/11/08/openglot-scalar-fields/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/11/08/openglot-scalar-fields/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 14:22:05 +0000</pubDate>
		<dc:creator>dan.lecocq</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[fragment shader]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[openglot]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=694</guid>
		<description><![CDATA[I&#8217;m working on OpenGLot (my OpenGL plotting library) for a class project, and two of the features I decided to implement were contour lines and scalar fields in 2D. A few days ago I got decent-looking contour lines working and today I got scalar fields implemented with a fragment shader. The programmer using the library [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on OpenGLot (my OpenGL plotting library) for a class project, and two of the features I decided to implement were contour lines and scalar fields in 2D.</p>
<p>A few days ago I got decent-looking contour lines working and today I got scalar fields implemented with a fragment shader.  The programmer using the library can specify a function in the form of a string and have it plotted as a scalar field.  Quickly.  Really quickly.</p>
<p>Modern graphics cards support shaders, which are programs that get run on the graphics card, and in parallel. This is great for algorithms that can be run in isolation (one pixel doesn&#8217;t need to know what the others are doing), which is the case here. OpenGLot generates a fragment shader that colors a single pixel based on the value of the function.  Each of the dozens or hundreds of cores on a GPU runs the same code in parallel for their particular pixel.</p>
<div id="attachment_696" class="wp-caption aligncenter" style="width: 299px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-16.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-16-289x300.png" alt="Contouring for a sinusoidal function with the isovalue 0." title="Picture 16" width="289" height="300" class="size-medium wp-image-696" /></a><p class="wp-caption-text">Contouring for a sinusoidal function with the isovalue 0.</p></div>
<div id="attachment_703" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-19.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-19-300x281.png" alt="Here&#039;s a first look at the results (taken moments after this first worked for me).  It&#039;s the same sinusoidal function, and I will be improving upon the color mapping in the coming hours." title="Picture 19" width="300" height="281" class="size-medium wp-image-703" /></a><p class="wp-caption-text">Here's a first look at the results (taken moments after this first worked for me).  It's the same sinusoidal function, and I will be improving upon the color mapping in the coming hours.</p></div>
<p>The graphing program I use, Grapher.app is rapidly showing its age.  The results it gives for the same function (though using a much better coloring scheme) are either grainy or extremely slow (10 or more seconds).  OpenGLot is generating these in less than 0.1 seconds.  (Grapher.app implements its scalar fields on the CPU, so comparing times is a little like comparing apples and oranges.  Still, responsiveness in this type of matter is important.)</p>
<div id="attachment_697" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-17.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-17-300x174.png" alt="The quick (and grainy) plot in Grapher.app" title="Picture 17" width="300" height="174" class="size-medium wp-image-697" /></a><p class="wp-caption-text">The quick (and grainy) plot in Grapher.app</p></div>
<div id="attachment_698" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-18.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/11/Picture-18-300x174.png" alt="The slow (but smooth) plot in Grapher.app" title="Picture 18" width="300" height="174" class="size-medium wp-image-698" /></a><p class="wp-caption-text">The slow (but smooth) plot in Grapher.app</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/11/08/openglot-scalar-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book Review: Tufte&#8217;s &#8220;The Visual Display of Quantitative Information&#8221;</title>
		<link>http://dan.lecocq.us/wordpress/2009/10/26/book-review-tuftes-the-visual-display-of-quantitative-information/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/10/26/book-review-tuftes-the-visual-display-of-quantitative-information/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 19:52:54 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=649</guid>
		<description><![CDATA[A professor of mine recently criticized some graphs I submitted on a paper and handed me a book by Edward Tufte called The Visual Display of Quantitative Information. It shreds on graphs made in order to show four numbers, or obvious flaws in design giving misleading impressions of numbers. He talks about the misconception that [...]]]></description>
			<content:encoded><![CDATA[<p>A professor of mine recently criticized some graphs I submitted on a paper and handed me a book by <a href="http://www.edwardtufte.com/">Edward Tufte</a> called <a href="http://www.amazon.com/gp/product/0961392142?ie=UTF8&#038;tag=dan.lecocq-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0961392142">The Visual Display of Quantitative Information</a><img src="http://www.assoc-amazon.com/e/ir?t=dan.lecocq-20&#038;l=as2&#038;o=1&#038;a=0961392142" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.  It shreds on graphs made in order to show four numbers, or obvious flaws in design giving misleading impressions of numbers.</p>
<p>He talks about the misconception that graphics lie.  Of course <em>some</em> do, but his attitude encapsulates well what I think is great about visualization &#8211; good representations convey understanding. Graphics <em>can</em> be the most effective way to get a handle on data, or a trend, and they should reveal what underlies the numbers.  But in a world of Excel and every insignificant and meaningless piece interrelationship being plotted in an impressive-looking format, it&#8217;s easy to forget this.</p>
<p>A quote I heard recently in my Scientific Visualization course (thanks, Thomas!) puts it well:</p>
<blockquote><p>
Visualize to inform, not to impress. If you really inform, you will impress. &#8211; Fred Brooks. SIGGRAPH 2003
</p></blockquote>
<p>Although a child can understand a time series, it wasn&#8217;t until a couple hundred years ago that they were actually used, as Tufte points out, but its power to convey is obvious.  Similarly, just from glancing at a map like this one from the <a href="http://memory.loc.gov/cgi-bin/map_item.pl?data=/home/www/data/gmd//gmd370m/g3701m/g3701gm/gct00013/ca000192.jp2&#038;itemLink=r?ammem/gmd:@field(NUMBER+@band(g3701gm+gct00013))&#038;title=The+national+atlas+of+the+United+States+of+America.++-+Family+Income&#038;style=setlmap&#038;legend=">census bureau</a>, one can almost instantly understand the distribution of income across the United States &#8211; literally tens of thousands of pieces of data.</p>
<div id="attachment_657" class="wp-caption aligncenter" style="width: 241px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/income.jpg"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/income-231x300.jpg" alt="A US Census Bureau graphic depicting the income of the 3000+ counties of the United States." title="income" width="231" height="300" class="size-medium wp-image-657" /></a><p class="wp-caption-text">A US Census Bureau graphic depicting the income of the 3000+ counties of the United States.</p></div>
<p>In this vein of conveying understanding, I remember several years ago now watching a TED Talk that immediately captivated me with visualization. Hans Rosling talks about how often when we see the rows about rows and tables upon tables of the massive amounts of census data, not only do our eyes glaze over but it becomes very difficult to keep it all in one&#8217;s head at any one time.  Visualizing the data is thus a key tool for gaining the insight we seek.</p>
<p><object width="446" height="326" class="aligncenter"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param><param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/HansRosling_2007-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/HansRosling-2007.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=140&#038;introDuration=16500&#038;adDuration=4000&#038;postAdDuration=2000&#038;adKeys=talk=hans_rosling_reveals_new_insights_on_poverty;year=2007;theme=spectacular_performance;theme=numbers_at_play;theme=what_s_next_in_tech;theme=rethinking_poverty;theme=presentation_innovation;event=TED2007;&#038;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" flashvars="vu=http://video.ted.com/talks/dynamic/HansRosling_2007-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/HansRosling-2007.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=140&#038;introDuration=16500&#038;adDuration=4000&#038;postAdDuration=2000&#038;adKeys=talk=hans_rosling_reveals_new_insights_on_poverty;year=2007;theme=spectacular_performance;theme=numbers_at_play;theme=what_s_next_in_tech;theme=rethinking_poverty;theme=presentation_innovation;event=TED2007;"></embed></object></p>
<p>The book is full of tremendous insight about how ink should be used as efficiently as possible (within reason &#8211; Tufte is quick to emphasize this point) and that the human eye has a great capacity for handling dense data sets if presented efficiently.  It is an entirely necessary resource for anyone who intends to pursue any science, nay, anyone intends to pursue any discipline dealing with numbers.</p>
<p>He has several other books, all of which I intend to read as I was virtually unable to put down the book; I was constantly floored by the myriad examples of strong and weak graphics alike.  He also published a <a href="http://www.amazon.com/exec/obidos/ASIN/0961392185/ref=nosim/kkorg-20">book by his mother</a> that I happened to encounter recently via <a href="http://www.kk.org/cooltools/archives/003977.php">Cool Tools</a>.</p>
<p>I&#8217;ll close with a brief excerpt from his book with which I was taken:</p>
<blockquote><p>
Words and pictures belong together.  Viewers need the help that words can provide.  Words on graphics are data-ink, making effective use of the space freed up by erasing redundant and non-data-ink.  It is nearly always helpful to write little messages on the plotting field to explain the data, to label outliers and interesting data points, to write equations and sometimes table son the graphic itself, and to integrate the caption and legend into the design so that the eye is not required to dart back and fort between textual material and the graphic.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/10/26/book-review-tuftes-the-visual-display-of-quantitative-information/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Projection Mapping</title>
		<link>http://dan.lecocq.us/wordpress/2009/10/23/projection-mapping/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/10/23/projection-mapping/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 21:16:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[projection mapping]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=640</guid>
		<description><![CDATA[Projectors these days are not uncommon. People are buying projectors for their own homes, schools have projectors to plug computers into &#8211; they&#8217;re pretty widespread. An application for them I hadn&#8217;t seen until a few weeks ago was projection mapping. I&#8217;ve run across a couple of posts about them on MAKE. Where traditionally you project [...]]]></description>
			<content:encoded><![CDATA[<p>Projectors these days are not uncommon.  People are buying projectors for their own homes, schools have projectors to plug computers into &#8211; they&#8217;re pretty widespread.</p>
<p>An application for them I hadn&#8217;t seen until a few weeks ago was projection mapping.  I&#8217;ve run across a couple of posts about them on <a href="http://blog.makezine.com/">MAKE</a>. Where traditionally you project onto a flat screen or wall, you can equally project onto any other geometry.  If you have a representation of that geometry, one can create all manner of optical illusions.  Perhaps some videos will make this clear:</p>
<p><object width="480" height="295" class="aligncenter"><param name="movie" value="http://www.youtube.com/v/I8-kqovVjss&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/I8-kqovVjss&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
<p><object width="500" height="281" class="aligncenter"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7001138&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7001138&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object></p>
<p>The amazing thing about these is that something so impressive is going on that you don&#8217;t even notice it.  You might think that the same illusion can be accomplished on a flat screen, but making use of the fact that your brain uses context to build a picture means that this can be much more impressive.</p>
<p>Beau Lotto talks about this in a really interesting TED Talk I saw recently. What I have in mind particularly is when he talks about the tiles in light and shadow and how we perceive their color.  The buildings the above videos project onto are the tiles in this analogy, and by projecting varying levels of light onto them, we perceive a different situation from what&#8217;s actually happening, and what&#8217;s so amazing to me is that it&#8217;s so compelling and convincing, you don&#8217;t it didn&#8217;t quite soak in at first just how impressive it is.</p>
<p><object width="500" height="365"  class="aligncenter"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param><param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/BeauLotto_2009G-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/BeauLotto-2009G.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=653&#038;introDuration=16500&#038;adDuration=4000&#038;postAdDuration=2000&#038;adKeys=talk=beau_lotto_optical_illusions_show_how_we_see;year=2009;theme=evolution_s_genius;theme=new_on_ted_com;theme=art_unusual;theme=speaking_at_tedglobal2009;theme=how_the_mind_works;event=TEDGlobal+2009;&#038;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" flashvars="vu=http://video.ted.com/talks/dynamic/BeauLotto_2009G-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/BeauLotto-2009G.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=653&#038;introDuration=16500&#038;adDuration=4000&#038;postAdDuration=2000&#038;adKeys=talk=beau_lotto_optical_illusions_show_how_we_see;year=2009;theme=evolution_s_genius;theme=new_on_ted_com;theme=art_unusual;theme=speaking_at_tedglobal2009;theme=how_the_mind_works;event=TEDGlobal+2009;"></embed></object></p>
<p>I hope to be able to have a project like one of these projection mappings at KAUST.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/10/23/projection-mapping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Future of the Internet</title>
		<link>http://dan.lecocq.us/wordpress/2009/09/22/the-future-of-the-internet/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/09/22/the-future-of-the-internet/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 15:38:50 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=581</guid>
		<description><![CDATA[In the far-off year of 2009, there will be a series of tubes that connects people over great distances at tremendous speeds. You&#8217;ll interact with it with a browser &#8211; a veritable portal to the world. And it will be able to render 3D graphics efficiently. WebGL is the future of the internet. I&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[<p>In the far-off year of 2009, there will be a series of tubes that connects people over great distances at tremendous speeds.  You&#8217;ll interact with it with a browser &#8211; a veritable portal to the world.  And it will be able to render 3D graphics efficiently.</p>
<p>WebGL is the future of the internet.  I&#8217;ve been hoping for something like this to come out for a while, and in Firefox&#8217;s latest nightly builds, it&#8217;s included.  You should read more about it <a href="http://blog.vlad1.com/2009/09/18/webgl-in-firefox-nightly-builds/">straight from the horse&#8217;s mouth</a>, but this is going to be amazing.</p>
<p>I love OpenGL, and to have a framework from which to call these commands I know and love for the web will be fantastic.  No need to worry about system requirements beyond whether or not WebKit runs on your computer&#8230; no need to download the latest versions of some piece of software&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/09/22/the-future-of-the-internet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SIGGRAPH</title>
		<link>http://dan.lecocq.us/wordpress/2009/08/01/siggraph/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/08/01/siggraph/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 17:47:40 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[new orleans]]></category>
		<category><![CDATA[siggraph]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=564</guid>
		<description><![CDATA[I arrived in New Orleans yesterday, showed up on the doorstep of the wrong hotel and then promptly found the right one. Today sees the start of the co-located events (I&#8217;m going to NPAR &#8211; Non-Photorealistic Animation and Rendering), and I&#8217;m so psyched! If you&#8217;re at SIGGRAPH or in New Orleans and want to hang [...]]]></description>
			<content:encoded><![CDATA[<p>I arrived in New Orleans yesterday, showed up on the doorstep of the wrong hotel and then promptly found the right one.</p>
<p>Today sees the start of the co-located events (I&#8217;m going to NPAR &#8211; Non-Photorealistic Animation and Rendering), and I&#8217;m so psyched!  If you&#8217;re at SIGGRAPH or in New Orleans and want to hang out and network, drop me an email / comment!</p>
<p>Woohoo! SIGGRAPH!</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/08/01/siggraph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stanford Dragon and Gouraud Shading</title>
		<link>http://dan.lecocq.us/wordpress/2009/05/12/stanford-dragon-and-gouraud-shading/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/05/12/stanford-dragon-and-gouraud-shading/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:57:38 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[gouraud shading]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[octtrees]]></category>
		<category><![CDATA[ray tracing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=540</guid>
		<description><![CDATA[I recently finished up school, and part of that was finishing up my ray tracing project. At the last minute, I implemented Gouraud shading which is a technique to try to smooth out a triangulated surface. What it really does is just linearly interpolate the normal vectors, where the normal of a vertex is calculated [...]]]></description>
			<content:encoded><![CDATA[<p>I recently finished up school, and part of that was finishing up my ray tracing project.  At the last minute, I implemented Gouraud shading which is a technique to try to smooth out a triangulated surface.  What it really does is just linearly interpolate the normal vectors, where the normal of a vertex is calculated as a weighted average of the normals of the triangles using that vertex.</p>
<p>Long story short:<br />
<div id="attachment_542" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny1.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny1-300x300.png" alt="A render of the Stanford bunny with my raytracer without Gouraud shading." title="bunny_flat" width="300" height="300" class="size-medium wp-image-542" /></a><p class="wp-caption-text">A render of the Stanford bunny with my raytracer without Gouraud shading.</p></div></p>
<div id="attachment_543" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunnysmooth.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunnysmooth-300x300.png" alt="A render of the Stanford bunny with smooth Gouraud shading." title="bunnysmooth" width="300" height="300" class="size-medium wp-image-543" /></a><p class="wp-caption-text">A render of the Stanford bunny with smooth Gouraud shading.</p></div>
<p>Also, thanks to an improvement in my parallelization of the problem and a speedup in octtree traversal, I was able to render the Stanford dragon model (~1 million triangles):</p>
<div id="attachment_544" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/dragon.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/dragon-300x168.png" alt="The Stanford dragon model." title="dragon" width="300" height="168" class="size-medium wp-image-544" /></a><p class="wp-caption-text">The Stanford dragon model.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/05/12/stanford-dragon-and-gouraud-shading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stanford Bunny</title>
		<link>http://dan.lecocq.us/wordpress/2009/05/03/stanford-bunny/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/05/03/stanford-bunny/#comments</comments>
		<pubDate>Mon, 04 May 2009 06:16:52 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[scan]]></category>
		<category><![CDATA[stanford bunny]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=534</guid>
		<description><![CDATA[The Stanford Bunny is a graphics benchmark of sorts. It was a high-resolution scan that the imaging lab there did of a ceramic bunny, and the triangulation is a popular model to test systems on. It contains a little under 70,000 triangles which makes brute-force ray tracing intractable. I mentioned octtrees earlier, and so having [...]]]></description>
			<content:encoded><![CDATA[<p>The Stanford Bunny is a graphics benchmark of sorts.  It was a high-resolution scan that the imaging lab there did of a ceramic bunny, and the triangulation is a popular model to test systems on.</p>
<p>It contains a little under 70,000 triangles which makes brute-force ray tracing intractable.  I mentioned octtrees earlier, and so having built octtrees into my ray tracer, I was able to render the Stanford Bunny in about 40 minutes on one core.  Granted, that&#8217;s with only 1-pass anti-aliasing, but I feel pretty good about this.  I don&#8217;t think I&#8217;ll have a chance to implement Gouraud shading (or normal interpolation for that matter), but as soon as I do, it will look a lot less blocky.</p>
<div id="attachment_535" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny-300x168.png" alt="The Stanford Bunny rendered with my ray tracer." title="bunny" width="300" height="168" class="size-medium wp-image-535" /></a><p class="wp-caption-text">The Stanford Bunny rendered with my ray tracer.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/05/03/stanford-bunny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Octtrees For Space Rasterization</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/30/octtrees-for-space-rasterization/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/30/octtrees-for-space-rasterization/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 21:49:09 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[computational geometry]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[octtree]]></category>
		<category><![CDATA[ray tracing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=525</guid>
		<description><![CDATA[Raytracing is slow. Incredibly slow. Painfully slow. That&#8217;s because you&#8217;ve got to check a lot of things to accurately determine what you&#8217;re seeing, if it&#8217;s in shadow, if it reflects off of something, etc., so it helps quite a bit to be able to get an idea beforehand of where everything is. Enter octtrees. We&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Raytracing is slow.  Incredibly slow.  <em>Painfully</em> slow.  That&#8217;s because you&#8217;ve got to check a lot of things to accurately determine what you&#8217;re seeing, if it&#8217;s in shadow, if it reflects off of something, etc., so it helps quite a bit to be able to get an idea beforehand of where everything is.  Enter octtrees.</p>
<p>We&#8217;ve got a picture of a model (in this case, the Stanford bunny model).  It consists of thousands of tiny triangles that make a surface.  Then, imagine a cube surrounding the entire model.  If there are two many triangles in that cube, you cut the cube in to eight smaller cubes, and repeat.  What this build is a tree where &#8220;busy&#8221; portions of the space get divided more.</p>
<p>And now for pretty pictures:<br />
<div id="attachment_526" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunny.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunny-300x291.png" alt="The bunny on its own.  There are tricks to smooth it out, but I left it highly triangulated to better represent the idea." title="bunny" width="300" height="291" class="size-medium wp-image-526" /></a><p class="wp-caption-text">The bunny on its own.  There are tricks to smooth it out, but I left it highly triangulated to better represent the idea.</p></div><br />
<div id="attachment_527" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytree.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytree-300x291.png" alt="Bunny with balanced wireframe octtree around it." title="bunnytree" width="300" height="291" class="size-medium wp-image-527" /></a><p class="wp-caption-text">Bunny with balanced wireframe octtree around it.</p></div><br />
<div id="attachment_528" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytreeside.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytreeside-300x291.png" alt="Profile of the bunny with a very deep octtree." title="bunnytreeside" width="300" height="291" class="size-medium wp-image-528" /></a><p class="wp-caption-text">Profile of the bunny with a very deep octtree.</p></div></p>
<p>I&#8217;m finishing up the implementation, and then I&#8217;ll be using it as part of my octtree as a intersection speedup.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/30/octtrees-for-space-rasterization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Orbits</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/30/orbits/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/30/orbits/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 21:29:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planets]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[ray tracing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=523</guid>
		<description><![CDATA[Orbiting planets. The days are about twice as along as they normally are relative to each planet&#8217;s year, but that&#8217;s an aesthetic preference. Enjoy.]]></description>
			<content:encoded><![CDATA[<p>Orbiting planets.  The days are about twice as along as they normally are relative to each planet&#8217;s year, but that&#8217;s an aesthetic preference.  Enjoy.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/w3F_1HiCYs8&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/w3F_1HiCYs8&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/30/orbits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Render</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/26/new-render/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/26/new-render/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 04:56:54 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[clips]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planets]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[texturing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=508</guid>
		<description><![CDATA[I got a new render up from my ray tracer that applies planetary textures to spheres and makes them spin on their respective axes (none of the planets in our solar system spin on a &#8220;vertical&#8221; axis). I hope to do one with their orbits, but I haven&#8217;t had a chance to get to it; [...]]]></description>
			<content:encoded><![CDATA[<p>I got a new render up from my ray tracer that applies planetary textures to spheres and makes them spin on their respective axes (none of the planets in our solar system spin on a &#8220;vertical&#8221; axis).  I hope to do one with their orbits, but I haven&#8217;t had a chance to get to it; though, the nice thing is, I just have to define their paths and rotations as a function of time, and where I want the viewpoint to be.  It took about 15 minutes to render in full HD 1080&#215;1920 on 18 processors:</p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/z56qL2bHqNo&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/z56qL2bHqNo&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/26/new-render/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ray Tracer &#8211; Texturing Support</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/24/ray-tracer-texturing-support/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/24/ray-tracer-texturing-support/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 18:26:51 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[earth]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[raytracing]]></category>
		<category><![CDATA[texturing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=501</guid>
		<description><![CDATA[It&#8217;s all well and good to be able to render shapes in space in a photorealistic way, but at some point you&#8217;d like to draw something that doesn&#8217;t have just one surface color. After all, a billboard isn&#8217;t just a bunch of shapes each of which has one color &#8211; it&#8217;s one object with paint [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s all well and good to be able to render shapes in space in a photorealistic way, but at some point you&#8217;d like to draw something that doesn&#8217;t have just one surface color.  After all, a billboard isn&#8217;t just a bunch of shapes each of which has one color &#8211; it&#8217;s one object with paint / ink placed on it in an ordered way.</p>
<p>Texturing accomplishes by taking a primitive shape (like a sphere, triangle, surface of revolution, etc.) and wrapping an image onto and over it.  Let&#8217;s consider a sphere in space:<br />
<div id="attachment_502" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output4.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output4-300x168.png" alt="A white sphere in space." title="sphere" width="300" height="168" class="size-medium wp-image-502" /></a><p class="wp-caption-text">A white sphere in space.</p></div></p>
<p>Now let&#8217;s say we mean it to be Earth.  Then we can take a picture of Earth that&#8217;s flat:<br />
<div id="attachment_503" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/texturesmall.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/texturesmall-300x150.png" alt="Flattened map of Earth" title="texturesmall" width="300" height="150" class="size-medium wp-image-503" /></a><p class="wp-caption-text">Flattened map of Earth</p></div></p>
<p>and then map it onto a sphere to get a picture of what we all know Earth to look like:<br />
<div id="attachment_504" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/earth.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/earth-300x168.png" alt="Behold!" title="Planet Earth" width="300" height="168" class="size-medium wp-image-504" /></a><p class="wp-caption-text">Behold!</p></div><br />
<div id="attachment_506" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/mars-twin.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/mars-twin-300x168.png" alt="Two Mars globes where the left is what is seen with the eye, and the right is a topographic map." title="mars" width="300" height="168" class="size-medium wp-image-506" /></a><p class="wp-caption-text">Two Mars globes where the left is what is seen with the eye, and the right is a topographic map.</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/24/ray-tracer-texturing-support/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ray Tracer &#8211; Now With Animation</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/06/ray-tracer-now-with-animation/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/06/ray-tracer-now-with-animation/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 03:16:04 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[render]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=495</guid>
		<description><![CDATA[It occurred to me today that I could render a scene several times with slight perturbations and then mesh them together into a movie. It took about 15 minutes to render on a cluster at Mines, and then about a minute to stitch together with Mencoder. At 18 frames per second, here is the result. [...]]]></description>
			<content:encoded><![CDATA[<p>It occurred to me today that I could render a scene several times with slight perturbations and then mesh them together into a movie.  It took about 15 minutes to render on a cluster at Mines, and then about a minute to stitch together with Mencoder.  At 18 frames per second, here is the result.  Enjoy!</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/mWT0UOBTT5Y&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mWT0UOBTT5Y&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/06/ray-tracer-now-with-animation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Parallel Ray Tracer</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/04/parallel-ray-tracer/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/04/parallel-ray-tracer/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 21:54:05 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[raytracer]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=480</guid>
		<description><![CDATA[This afternoon I was able to successfully parallelize the ray tracer I wrote for Graphics II to run on the Alamode cluster at Mines. Using 17 machines, I was able to render a 4,096 x 4,096 pixel image with 25 passes and up to 5 reflections. It took only 1 minute and 20 seconds. For [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon I was able to successfully parallelize the ray tracer I wrote for Graphics II to run on the Alamode cluster at Mines.  Using 17 machines, I was able to render a 4,096 x 4,096 pixel image with 25 passes and up to 5 reflections.  It took only 1 minute and 20 seconds.<br />
<div id="attachment_481" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output-300x300.png" alt="Reflective spheres rendered at high resolution on a small cluster." title="Spheres" width="300" height="300" class="size-medium wp-image-481" /></a><p class="wp-caption-text">Reflective spheres rendered at high resolution on a small cluster.</p></div><br />
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output1.png"><img alt="Another image rendered on the same cluster" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output8-300x300.png" title="Sphere and Triangles" width="300" height="300" /></a><p class="wp-caption-text">Another image rendered on the same cluster</p></div></p>
<p>For the benefit of those who are not computer scientists, this is what the input file looks like:<br />
<code><br />
8192 8192<br />
0 0 20<br />
-1 -1 1<br />
2 0 0<br />
0 2 0<br />
3 10 10 0.8<br />
0.2<br />
9<br />
# These next few lines will define a triangle<br />
T<br />
# With one of the points at (1, 1, 1)<br />
1 1 1<br />
# and the next point here:<br />
0.12321 0.12321 -1<br />
# and the last point here:<br />
-1 1 1<br />
# and with this color setting<br />
1 1 1 1 1 1 0 1 0.7<br />
T<br />
-1 1 1<br />
-0.12321 0.12321 -1<br />
0.12321 0.12321 -1<br />
1 1 1 1 1 1 0 1 0<br />
T<br />
1 -1 1<br />
0.12321 -0.12321 -1<br />
-1 -1 1<br />
1 1 1 1 1 1 0 1 0<br />
T<br />
-1 -1 1<br />
-0.12321 -0.12321 -1<br />
0.12321 -0.12321 -1<br />
1 1 1 1 1 1 0 1 0<br />
T<br />
1 1 1<br />
0.12321 0.12321 -1<br />
1 -1 1<br />
1 0 0 1 0 0 0 1 0<br />
T<br />
1 -1 1<br />
0.12321 -0.12321 -1<br />
0.12321 0.12321 -1<br />
1 0 0 1 0 0 0 1 0<br />
T<br />
-1 1 1<br />
-0.12321 0.12321 -1<br />
-1 -1 1<br />
1 1 0 1 1 0 0 1 0<br />
T<br />
-1 -1 1<br />
-0.12321 -0.12321 -1<br />
-0.12321 0.12321 -1<br />
1 1 0 1 1 0 0 1 0<br />
S<br />
0 0 0 0.5<br />
1 0 1 1 0 1 0 1 0.3<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/04/parallel-ray-tracer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raytracer with Anti-aliasing and Reflection</title>
		<link>http://dan.lecocq.us/wordpress/2009/03/04/raytracer-with-anti-aliasing-and-reflection/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/03/04/raytracer-with-anti-aliasing-and-reflection/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 22:28:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[raytracer]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=458</guid>
		<description><![CDATA[For Graphics II, we had to implement a raytracer, and then add anti-aliasing and a feature of our choice. I selected mirrored surfaces. First, anti-aliasing. Here are a few pictures of the same image rendered with a different number of passes to change the smoothness. And lastly, here&#8217;s a scene of several spheres, some of [...]]]></description>
			<content:encoded><![CDATA[<p>For Graphics II, we had to implement a raytracer, and then add anti-aliasing and a feature of our choice.  I selected mirrored surfaces.</p>
<p>First, anti-aliasing.  Here are a few pictures of the same image rendered with a different number of passes to change the smoothness.</p>
<div id="attachment_459" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/anti-alias-1.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/anti-alias-1-300x300.png" alt="Using one pass" title="anti-alias-1" width="300" height="300" class="size-medium wp-image-459" /></a><p class="wp-caption-text">Using one pass</p></div><br />
<div id="attachment_460" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/anti-alias-5.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/anti-alias-5-300x300.png" alt="Using 5 passes." title="anti-alias-5" width="300" height="300" class="size-medium wp-image-460" /></a><p class="wp-caption-text">Using 5 passes.</p></div><br />
<div id="attachment_461" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/anti-alias-50.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/anti-alias-50-300x300.png" alt="Using 50 passes." title="anti-alias-50" width="300" height="300" class="size-medium wp-image-461" /></a><p class="wp-caption-text">Using 50 passes.</p></div>
<p>And lastly, here&#8217;s a scene of several spheres, some of which are reflective.<br />
<div id="attachment_462" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/output.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/output-300x300.png" alt="A set of spheres, some of which are mirror-like." title="Spheres" width="300" height="300" class="size-medium wp-image-462" /></a><p class="wp-caption-text">A set of spheres, some of which are mirror-like.</p></div><br />
<div id="attachment_467" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/input8r.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/input8r-300x300.png" alt="A reflective sphere next to some triangles." title="input8r" width="300" height="300" class="size-medium wp-image-467" /></a><p class="wp-caption-text">A reflective sphere next to some triangles.</p></div><br />
<div id="attachment_469" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/input12r.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/input12r-300x300.png" alt="A mirrored sphere in the center of four other sphere." title="input12r" width="300" height="300" class="size-medium wp-image-469" /></a><p class="wp-caption-text">A mirrored sphere in the center of four other sphere.</p></div><br />
<div id="attachment_470" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/input16r.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/03/input16r-300x300.png" alt="More spheres!" title="input16r" width="300" height="300" class="size-medium wp-image-470" /></a><p class="wp-caption-text">More spheres!</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/03/04/raytracer-with-anti-aliasing-and-reflection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

