<?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; plotting</title>
	<atom:link href="http://dan.lecocq.us/wordpress/tag/plotting/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.lecocq.us/wordpress</link>
	<description>Life, love, and computer science</description>
	<lastBuildDate>Sun, 25 Jul 2010 16:20:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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/" onclick="urchinTracker('/outgoing/code.google.com/apis/o3d/?referer=');">competitor from Google</a>, but like OpenGL and OpenCL, this API is managed by the <a href="http://www.khronos.org/" onclick="urchinTracker('/outgoing/www.khronos.org/?referer=');">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>6</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[KAUST]]></category>
		<category><![CDATA[computer science]]></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>OpenGLot</title>
		<link>http://dan.lecocq.us/wordpress/2009/10/09/openglot/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/10/09/openglot/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 18:52:10 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[graphing]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[openglot]]></category>
		<category><![CDATA[plotting]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=617</guid>
		<description><![CDATA[As a teaching tool for a course last semester, I put together an interactive plotter in openGL which I endearingly named &#8220;openGLot.&#8221; (For those who missed it, &#8220;openGL&#8221; + &#8220;plot&#8221; = &#8220;openGLot.&#8221;) See, I felt like I had to give it a very unsavory name so that if it ever became widely used, people would [...]]]></description>
			<content:encoded><![CDATA[<p>As a teaching tool for a course last semester, I put together an interactive plotter in openGL which I endearingly named &#8220;openGLot.&#8221; (For those who missed it, &#8220;openGL&#8221; + &#8220;plot&#8221; = &#8220;openGLot.&#8221;)  See, I felt like I had to give it a very unsavory name so that if it ever became widely used, people would be forced to use its ill-sounding moniker.</p>
<p>At any rate, I originally wrote in Ruby, but have been slowly porting it to C++ with high hopes for its use and applicability.  I still have a bunch of interactive demos for numerical methods (from Newton&#8217;s method to the trapezoidal rule for numerical integration) in the Ruby version, but I&#8217;ll be bringing those to the C++ version one of these days.  I started a <a href="https://sourceforge.net/projects/openglot/" onclick="urchinTracker('/outgoing/sourceforge.net/projects/openglot/?referer=');">sourceforge project</a> for it a while ago, which was kind of exciting.</p>
<p>At any rate, as a brief (albeit nerdy) respite from the academic onslaught today, I added a class for parameterized curves.<br />
<div id="attachment_618" class="wp-caption aligncenter" style="width: 299px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/parameterized_curves.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/parameterized_curves-289x300.png" alt="A demo of a parameterized curve in openGLot" title="parameterized_curves" width="289" height="300" class="size-medium wp-image-618" /></a><p class="wp-caption-text">A demo of a parameterized curve in openGLot</p></div></p>
<p>I&#8217;ve got a bunch more primitives to add to it (scalar and vector fields, for example), but those will surely come one of these days.  I&#8217;ve added adaptive mesh refinement (so that &#8220;busier&#8221; functions require more sampling to get a more accurate visual representation), but I&#8217;m still not quite happy with it.<br />
<div id="attachment_619" class="wp-caption aligncenter" style="width: 299px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/with-no-refinement.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/with-no-refinement-289x300.png" alt="A &quot;busy&quot; function with no adaptive refinement" title="with-no-refinement" width="289" height="300" class="size-medium wp-image-619" /></a><p class="wp-caption-text">A &quot;busy&quot; function with no adaptive refinement</p></div></p>
<div id="attachment_620" class="wp-caption aligncenter" style="width: 299px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/with-refinement.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/with-refinement-289x300.png" alt="The same &quot;busy&quot; function with recursive refinement." title="with-refinement" width="289" height="300" class="size-medium wp-image-620" /></a><p class="wp-caption-text">The same &quot;busy&quot; function with recursive refinement.</p></div>
<p>I&#8217;ve also got a 3D version, but that&#8217;s not been polished or formalized, but everyone loves a pretty graph:<br />
<a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/openGLot3D.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/10/openGLot3D-300x281.png" alt="openGLot3D" title="openGLot3D" width="300" height="281" class="aligncenter size-medium wp-image-621" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/10/09/openglot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
