<?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>Canvas 3d JS Library</title>
	<atom:link href="http://www.c3dl.org/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.c3dl.org</link>
	<description>WebGL made easy!</description>
	<lastBuildDate>Mon, 22 Feb 2010 06:05:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>C3DL 2.0-WebGL and beyond</title>
		<link>http://www.c3dl.org/index.php/c3dl-news/c3dl-2-0-webgl-and-beyond/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-news/c3dl-2-0-webgl-and-beyond/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 05:59:12 +0000</pubDate>
		<dc:creator>Cathy Leung</dc:creator>
				<category><![CDATA[C3DL News]]></category>
		<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2480</guid>
		<description><![CDATA[It has been a long time coming but we have now updated all the core features of C3DL to use WebGL.  You can dowload our 2.0 release here.  We have also updated all our demos to use WebGL.  Our tutorials have all been updated (tutorial 5 and 6 needs a better example [...]]]></description>
			<content:encoded><![CDATA[It has been a long time coming but we have now updated all the core features of C3DL to use<a href="http://en.wikipedia.org/wiki/WebGL"> WebGL.</a>  You can dowload our 2.0 release <a href="http://www.c3dl.org/index.php/download/">here.</a>  We have also updated all our <a href="http://www.c3dl.org/index.php/webgl-demos/">demos</a> to use WebGL.  Our <a href="http://www.c3dl.org/index.php/tutorials/">tutorials</a> have all been updated (tutorial 5 and 6 needs a better example but we&#8217;re getting to it).  Our <a href="http://www.c3dl.org/index.php/documentation/">documentation</a> has also been updated for release 2.0
<br /><br />

C3DL 2.0 includes the following features:
 
<ul>
	<li>uses WebGL (as opposed to Canvas 3D) &#8211; you will need a WebGL enabled browser to see demos (see <a href="http://www.c3dl.org/index.php/tutorials/tutorial-1-browsers/">tutorial #1</a> on how to do this)</li>

	<li>ports all c3dl features including:</li>

 <ul>
	<li> Collada model loading</li>
<li>Picking</li>
<li>Lighting System</li>
<li>camera system</li>
<li>Particle system</li>
<li>Effects system that allows a swappable shader to be applied to alter its look.  Currently we have the following effects implements:
<ul>
<li>cartoon (with or without outlines)</li>
<li>greyscale</li>
<li>solid colour</li>
<li>sepia</li>
<li>gooch</li>
</ul>
</ul>
<li>lines and dots</li>
</ul>

Many of these features can be observed in our <a href="http://www.c3dl.org/index.php/webgl-demos/asteroids-3d/">Asteroids-3D</a> demo.  (click on rocks to fire at them).

We have also moved our <a href="http://github.com/cathyatseneca/c3dl">repository onto github</a> and a <a href="http://c3dl.lighthouseapp.com/projects/42081-c3dl/overview">bug tracker at lighthouse</a>.

Try it out and give us some feedback! <img src='http://www.c3dl.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> 

If you are looking for our Canvas 3D related demos please check our Archive link.]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-news/c3dl-2-0-webgl-and-beyond/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Preliminary WebGL RTS Game</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/preliminary-webgl-rts-game/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/preliminary-webgl-rts-game/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 22:08:08 +0000</pubDate>
		<dc:creator>Andor Salga</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2329</guid>
		<description><![CDATA[Cathy asked me to make a cool demo using our library. After thinking about, I started getting many ideas, but creating a preliminary real-time strategy game made the most sense. It not only demonstrates a lot of C3DL features such as model loading, transformations, lighting, shaders, picking, cameras, textures, etc, but since animation is kept [...]]]></description>
			<content:encoded><![CDATA[<a href="http://cleung.wordpress.com/">Cathy</a> asked me to make a <a href="http://www.c3dl.org/wp-content/blog_demos/rts/rts/">cool demo</a> using our library. After thinking about, I started getting many ideas, but creating a preliminary real-time strategy game made the most sense. It not only demonstrates a lot of C3DL features such as model loading, transformations, lighting, shaders, picking, cameras, textures, etc, but since animation is kept to a minimum, the frame rate on slower machines shouldn&#8217;t be a big deal.<br />
<br />
You&#8217;ll need a <a href="http://www.khronos.org/webgl/">WebGL</a>-compatible browser to run it. You can either download <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/">Minefield</a>, <a href="http://nightly.webkit.org/">WebKit</a> or <a href="http://build.chromium.org/buildbot/snapshots/">Chromium</a>. Please let us know if it fails to load. Keep in mind I hacked this thing together in a day so the code isn&#8217;t pretty, but <a href="http://www.c3dl.org/wp-content/blog_demos/rts/rts/">here it is anyway</a>!

<a href="http://www.c3dl.org/wp-content/blog_demos/rts/rts/"><img src="http://asalga.files.wordpress.com/2010/02/snapshot-2010-02-15-15-15-391.jpg" alt="" title="Snapshot 2010-02-15 15-15-39" width="460" height="410" class="alignnone size-full wp-image-1182" /></a>]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/preliminary-webgl-rts-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asteroids in 3D&#8230; and a bit of 2D</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:12:55 +0000</pubDate>
		<dc:creator>Cathy Leung</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2271</guid>
		<description><![CDATA[So I&#8217;ve been working on this little demo in preparation for the upcoming (very very soon&#8230;docs left only) release of C3DL&#8217;s webGL release.  I adapted it from Peter Callaghan&#8217;s Asteroids game and the models were from an old demo made as part of our user testing last year.

This demo is kind of cool because [...]]]></description>
			<content:encoded><![CDATA[So I&#8217;ve been working on this little demo in preparation for the upcoming (very very soon&#8230;docs left only) release of C3DL&#8217;s webGL release.  I adapted it from Peter Callaghan&#8217;s Asteroids game and the models were from an old demo made as part of our user testing last year.

This demo is kind of cool because it demonstrates many of the features of C3DL and puts it all together in one.  Namely it uses:
<ul>
	<li>collada model loading &#8211; you can export to collada from a good number of modeling programs including blender, 3ds max and google sketchup</li>
	<li>particle systems &#8211; watch the rocks when they explode!</li>
	<li>lighting &#8211; ok&#8230; this is not featured well&#8230; I&#8217;ll try to see if I can do better with it</li>
	<li>picking &#8211; click on rock to identify which one</li>
</ul>
I will probably add something to that uses the effects system as that is one key component not highlighted.

Its not quite done yet but I figured I&#8217;d link it anyways since I won&#8217;t have time to finish it till probably Wednesday&#8230;. I still have to add scoring and end game functionalities, the keys should be changed to a and d instead of using arrows,  and I think my health bar is messed up when it drops below 25 but&#8230; its a start.  I also have not tested well on webkit (there was a bug of constantly rotating ship at one point but have not been able to reproduce it) and I can&#8217;t seem to run chrome on my desktop atm so no testing there.

This demo uses webGL in the main display and I painted the hud with 2D canvas.

Click on the asteroids to shoot them.  Use arrow keys to rotate the ship.

<a href="https://cs.senecac.on.ca/~catherine.leung/c3dl/Asteroids3/asteroids.html">https://cs.senecac.on.ca/~catherine.leung/c3dl/Asteroids3/asteroids.html
</a>
NOTE:  To see this demo you need a web browser that supports webGL and it must be enabled.]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Another demo updated</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/another-demo-updated/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/another-demo-updated/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 21:25:35 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2259</guid>
		<description><![CDATA[I&#8217;ve just finished updating the particle systems demo.  There wasn&#8217;t anything wrong with the demo itself, but there was an array in the particle system class that wasn&#8217;t being initialized properly that suddenly started causing Minefield to crash.  The strange thing is that until recently Minefield wasn&#8217;t complaining about it.  But as [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished updating the <a href="http://www.c3dl.org/index.php/webgl-demos/particle-systems-demo">particle systems demo</a>.  There wasn&#8217;t anything wrong with the demo itself, but there was an array in the particle system class that wasn&#8217;t being initialized properly that suddenly started causing Minefield to crash.  The strange thing is that until recently Minefield wasn&#8217;t complaining about it.  But as of the nightly build on the 23rd it didn&#8217;t just complain, it outright crashed.  By populating the array with 0s when it is initialized, I&#8217;ve got particles working again.  The misleading problem was that this happened at the same time I was fixing an issue with colours for Chromium was preventing it from displaying.  It started crashing one browser at the same time I fixed a problem for another.  It turns out that was caused because colour values were being read out of a file and split into an array, but they were never explicitly made into floating point values.  Minefield and Webkit understood them as such anyway, but Chromium didn&#8217;t like that.  A temporary solution was to multiply the values by 1 before using them, but that isn&#8217;t a very good solution.  Once I actually traced the problem to its source, a quick parseFloat took care of it.  Slightly slower, but more correct.<p>]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/another-demo-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simplifying the Interface</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/simplifying-the-interface/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/simplifying-the-interface/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 22:37:24 +0000</pubDate>
		<dc:creator>Andor Salga</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2156</guid>
		<description><![CDATA[Something we need to do is simplify the C3DL library interface. When approaching such tasks, one method I found extremely useful was to analyze the code in terms of the interface, or that is from the user&#8217;s perspective. To do this I first created a basic demo of a spinning cube by writing the necessary [...]]]></description>
			<content:encoded><![CDATA[Something we need to do is simplify the C3DL library interface. When approaching such tasks, one method I found extremely useful was to analyze the code in terms of the interface, or that is from the user&#8217;s perspective. To do this I first created a basic demo of a spinning cube by writing the necessary HTML and JavaScript files. As for the HTML, it will need to be something like this:<br />
(I emphasized the code which potentially could be changed)

<pre>&lt;html&gt;

  &lt;head&gt;
    &lt;title&gt;Cavas3D Demo&lt;/title&gt;
    <b>&lt;script&gt;var SCRIPT_PATH = '../../canvas3dapi/'&lt;/script&gt;</b>
    &lt;script src="../../canvas3dapi/c3dapi.js"&gt;&lt;/script&gt;
    <b>&lt;script src="basic_demo.js"&gt;&lt;/script&gt;</b>
  &lt;/head&gt;

  &lt;body&gt;
    <b>&lt;canvas id="demo" width="500" height="500"&gt;&lt;/canvas&gt;</b>
  &lt;/body&gt;

&lt;/html&gt;</pre>

It would be great if this could be simplified to something like this:

<pre>&lt;html&gt;

  &lt;head&gt;
    &lt;title&gt;Cavas3D Demo&lt;/title&gt;
    &lt;script src="../../canvas3dapi/c3dapi.js"&gt;&lt;/script&gt;
  &lt;/head&gt;

  &lt;body&gt;
    <b>&lt;canvas datasrc="basic_demo.js" id="demo" width="500" height="500"&gt;
    &lt;/canvas&gt;</b>
  &lt;/body&gt;

&lt;/html&gt;</pre>

I removed the somewhat unintuitive SCRIPT_PATH variable and moved the basic_demo.js resource into the canvas tag making it more obvious which .js file is associated to which canvas. These changes haven&#8217;t actually been made, I&#8217;m just playing with possible changes, brainstorming which parts <i>might</i> be able to be modified.<br />
<br />
Now, very few changes were made here and it will probably require a significant amount of effort to make it work. But this work is justified by the fact that the user&#8217;s experience and first impression will be more positive. If the user has to spend more than a few minutes trying to get a simple example to render, they&#8217;ll probably look for alternatives.<br />
<br />
Let&#8217;s see how the JavaScript could be changed. Right now, you need to write something like this:<br />
(Again, I emphasized the code which potentially could be changed)

<pre><b>c3dl.addModel('cube.dae');
c3dl.addMainCallBack(mainDemo, 'demo');</b>

function mainDemo(canvasName)
{
  var scn = new c3dl.Scene();		
  <b>scn.setCanvasTag(canvasName);
  var renderer = new c3dl.OpenGLES20();
  scn.setRenderer(renderer);
  scn.init();</b>
  
  var cam = new c3dl.FreeCamera();
  cam.setPosition([0,0,50]);
  cam.setLookAtPoint([0,0,-1]);

  var cube = new c3dl.Collada();
  cube.init('cube.dae');
  cube.setAngularVel([0.001,0.001,0.0]);

  scn.addObjectToScene(cube);
  scn.setCamera(cam);
  scn.startScene();
}</pre>

Some changes I had in mind involved getting rid of the global c3dl.addModel() and c3dl.addMainCallback() calls and changing OpenGLES20 to just Renderer. The Renderer is an interesting problem. When <a href="http://www.khronos.org/webgl/">WebGL</a> started out as <a href="https://wiki.mozilla.org/Canvas:3D">Canvas3D</a>, we called the renderer OpenGLES11, then later it became OpenGLES20 and now it <i>could probably</i> be WebGL. Considering how much it has changed and will change, we&#8217;ll have to invest some time to make this stop. One simple solution is to abstract the renderer.<br />
<br />
For example, if we change OpenGLES20 class to Renderer, the user will no longer need to be concerned what underlying rendering method is used. If a visitor loads the user&#8217;s demo, but visitor&#8217;s browser doesn&#8217;t support WebGL (i.e. it&#8217;s I.E.), the demo still loads. This of course only works if we accommodate for this case. So if the browser is IE, we use DirectX. If the browser supports WebGL, we use that. The end result is the user&#8217;s page will create the appropriate renderer without them needing to worry about the user&#8217;s browser. So let&#8217;s look at what lines changed:

<pre>function mainDemo(canvasName)
{
  var scn = new c3dl.Scene();
  <b>var renderer = new c3dl.Renderer();
  scn.init(renderer);</b>
  
  var cam = new c3dl.FreeCamera();
  cam.setPosition([0,0,50]);
  cam.setLookAtPoint([0,0,-1]);

  var cube = new c3dl.Collada();
  cube.init('cube.dae');
  cube.setAngularVel([0.001,0.001,0.001]);

  scn.addObjectToScene(cube);  
  scn.setCamera(cam);
  scn.startScene();
}</pre>

In terms of the lines trimmed, I&#8217;m not certain how much of it is viable. The reason some of the seemingly redundant code is required was because I couldn&#8217;t devise any alternative at the time. Looking at it from a different perspective, I should be able to come up with something. In the end we&#8217;ll have an interface which is more flexible, easier to understand and of course simple.]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/simplifying-the-interface/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updating Demos</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/updating-demos/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/updating-demos/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 15:40:09 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2146</guid>
		<description><![CDATA[I&#8217;m continuing to update the demos with the copy of the library that works cross-browser (and will continue to do so).  There was a slight delay in the motion capture demo due to the difference in how the browsers read xml files.  We had been using:

xmlDoc = document.implementation.createDocument("","",null);
xmlDoc.async = false;
xmlDoc.load(xmlFile);

but Safari and Chrome [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m continuing to update the demos with the copy of the library that works cross-browser (and will continue to do so).  There was a slight delay in the motion capture demo due to the difference in how the browsers read xml files.  We had been using:</p>
<pre>
xmlDoc = document.implementation.createDocument("","",null);
xmlDoc.async = false;
xmlDoc.load(xmlFile);
</pre>
<p>but Safari and Chrome don&#8217;t accept that.  After a quick search (ignoring the pages that make it sound more complicated than it is and want to sell you code to take care of it) I found the answer to be quite simple.</p>
<pre>
xmlDoc = document.implementation.createDocument("","",null);
xmlDoc.async = false;
var xmlReq = new XMLHttpRequest();
xmlReq.open("GET", xmlFile, false);
xmlReq.send(null);
xmlDoc=xmlReq.responseXML;
</pre>
<p>It ends up as a few extra lines, but it works for all three.  This was a problem with the code for that individual page, but it seems to be the kind of thing we can expect when trying to write complex code for multiple browsers.</p>

<p>I&#8217;ll be working on the particle systems demo next, as it also has a bit of code that is firefox only.</p>]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/updating-demos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cross-browser progress update</title>
		<link>http://www.c3dl.org/index.php/c3dl-news/cross-browser-progress-update/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-news/cross-browser-progress-update/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 18:28:33 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[C3DL News]]></category>
		<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2114</guid>
		<description><![CDATA[I finally have our library working properly on Firefox (Gecko/20100114 Minefield/3.7a1pre), Safari (Version 4.0.4 (5531.21.10, r53178)) and Chrome (Chromium 4.0.299.0 (36242))

I&#8217;ve updated the orbiter demo with the new code, and will shortly be updating some of the older demos.  There are still a few minor issues to deal with, such as the moon not [...]]]></description>
			<content:encoded><![CDATA[<p>I finally have our library working properly on Firefox (Gecko/20100114 Minefield/3.7a1pre), Safari (Version 4.0.4 (5531.21.10, r53178)) and Chrome (Chromium 4.0.299.0 (36242))</p>

<p>I&#8217;ve updated the <a href="http://www.c3dl.org/index.php/webgl-demos/cross-browser-orbiter/">orbiter demo</a> with the new code, and will shortly be updating some of the older demos.  There are still a few minor issues to deal with, such as the moon not showing up properly sometimes, but we&#8217;re not getting exceptions anymore.</p>

<p>Another of these issues (Chrome only) has to do with reading floating point values from collada files.  When we try to use the values, it throws an exception, but if I multiply the values by 1 before we use them, it works.  I&#8217;ll have to spend a little more time trying to figure out if this is caused by something I&#8217;m doing wrong, or if it might be a bug.<p>]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-news/cross-browser-progress-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>let there be vars</title>
		<link>http://www.c3dl.org/index.php/c3dl-news/let-there-be-vars/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-news/let-there-be-vars/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 15:30:45 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[C3DL News]]></category>
		<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2065</guid>
		<description><![CDATA[I now have a proof-of-concept working that demonstrates that our library will work for multiple browsers.  We had been having a problem where Safari doesn&#8217;t support the keyword const, so I took those out.  Then I found out that someone who had worked on the library before me had been using &#8216;let&#8217; to [...]]]></description>
			<content:encoded><![CDATA[<p>I now have a proof-of-concept working that demonstrates that our library will work for multiple browsers.  We had been having a problem where Safari doesn&#8217;t support the keyword const, so I took those out.  Then I found out that someone who had worked on the library before me had been using &#8216;let&#8217; to create variables.  This wasn&#8217;t a problem when we where only on Firefox, but other browsers don&#8217;t support it, so I had to find all the lets and convert them to vars.  Then I had to find all the spots where we used Canvas&#8230;Array and switch them to WebGL&#8230;Array, but only when running Safari (borrowing a bit of code from the lessons at <a href="http://learningwebgl.com/blog/">LearningWebGL</a> made that much simpler).</p>
<br />
<br />
<a href="http://www.c3dl.org/index.php/webgl-demos/cross-browser-orbiter/">
<img src="http://www.c3dl.org/wp-content/uploads/2009/12/earth_cross.png" alt="Screen shot" width="500" height="400" class="aligncenter size-full wp-image-2096" />
</a>
<br />
<a href="http://www.c3dl.org/index.php/webgl-demos/cross-browser-orbiter/">Cross-Browser Orbiter Demo</a>
<br />
<p>With all that done, we finally have the library working for both browsers (I&#8217;ll get to Chrome soon, I promise&#8230;), but there&#8217;s a fairly serious problem.  Our library works by putting a link in the header telling the page to include a js file (c3dapi.js to be precise), which then has some JavaScript code that adds more script tags linking to js files (the actual library) to the DOM.  This works fine on Firefox, but Safari doesn&#8217;t like it.  It knows the files are there (I got it to list all the script tags and they&#8217;re there and in the correct order), but it doesn&#8217;t actually read them.  I&#8217;ve temporarily fixed this problem by manually adding all the script tags to the html page, but this is ridiculous to have to do every time.</p>

<p>On Firefox we just put<br />
<pre>
&lt;script type="application/javascript" src="../../canvas3dapi/c3dapi.js" &gt;&lt;/script&gt;
</pre>
<br />
and the beginning of c3dapi.js looks like this<br />
<pre>
var scripts = document.getElementsByTagName("script");
var parts = scripts[scripts.length -1].src.split("/");
parts.pop();
var basePath = parts.join("/");
var head = document.getElementsByTagName("head")[0];

c3dl_require = function(path) {
    var includeResource=document.createElement('script');
    includeResource.setAttribute('type',"text/javascript;version=1.8");
    includeResource.setAttribute('src',basePath + "/" + path);
    var scripts = document.getElementsByTagName("script");
    head.insertBefore(includeResource,scripts[scripts.length]);
	
}

c3dl_require('c3dlnamespace.js');
c3dl_require('constants.js');
c3dl_require('effects/effect_docs.js');
</pre>
<br />
For Safari that doesn&#8217;t work, so we&#8217;ve had to put all those script tags into the page header  manually, which looks like this:<br />
<pre>
&lt;script type="application/javascript" src="../../canvas3dapi/c3dlnamespace.js" &gt;&lt;/script&gt;
&lt;script type="application/javascript" src="../../canvas3dapi/constants.js" &gt;&lt;/script&gt;
&lt;script type="application/javascript" src="../../canvas3dapi/effects/effect_docs.js" &gt;&lt;/script&gt;
</pre>
with about 50 more script tags.</p>

<p>In short, we&#8217;ve got a <a href="http://www.c3dl.org/index.php/webgl-demos/cross-browser-orbiter/">demo</a> that works for both Firefox and Safari, but it only works because of a temporary fix.  Fixing it permanently is the next thing on my to-do list.  I should also mention there is a known issue:  The moon is not being lit in Safari.  After I sort out this issue with including files, I&#8217;ll investigate that too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-news/let-there-be-vars/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Creating tester pages</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/creating-tester-pages/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/creating-tester-pages/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 22:19:10 +0000</pubDate>
		<dc:creator>Cathy Leung</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2068</guid>
		<description><![CDATA[Recently there has been a lot more interest in WebGL.  Our previous work on its predecessor (Canvas 3D) has led to more interest in our work as well.  When we were developing the library for Canvas 3D, we had really only one browser to test for.  Usually the video card/OS determined whether [...]]]></description>
			<content:encoded><![CDATA[Recently there has been a lot more interest in WebGL.  Our previous work on its predecessor (Canvas 3D) has led to more interest in our work as well.  When we were developing the library for Canvas 3D, we had really only one browser to test for.  Usually the video card/OS determined whether our library would work or not.  However, as we port to WebGL it became clear that we needed a better way to allow feedback from users.  Currently what we have are just comments&#8230; user says &#8220;doesn&#8217;t work on my system running&#8230;.&#8221; in the comments.  However, I do not feel that this is a good way to do this.  Two reasons for this:
<ol>
	<li>It is not simple.  I firmly believe the easier we make it for someone to give us feedback, the easier it would be for us</li>
	<li> It doesn&#8217;t give any positive feedback.  We know when things do not work but what we don&#8217;t know is when things do.</li>
</ol>
What we would like to do is create a series of tester pages (easy enough as we have tests for all our features) and allow the user to easily give us feedback on whether or not they see the expected result.  The results can then be placed on the tester page like a comment (possibly with the information analyzed so we don&#8217;t end up with multiple entries saying the same thing).

<p>We would like to put up something like this<strong>(NOTE: this page doesn&#8217;t work!  just shows you what we want to do)</strong>:  <a href="http://www.c3dl.org/wp-content/tester_template/">http://www.c3dl.org/wp-content/tester_template/</a>

<p>Our site is <a href="http://wordpress.org/">wordpress</a> driven and while wordpress has some very nice features, there are definitely downsides to it.  Often we find that if we want to do something out of the ordinary, we end up having to jump through hoops to get wordpress to play nice and not get in the way.

<p>For the past week or so, I have been trying to hunt down a plug-in that will allow us to create a form on a page and then let it display the results (pretty much a customizable comment form that is different from the comment forms on our other pages).  At first I thought I could do this with a contact form plug-in.  I have since discovered that a comment form is not exactly the same as a contact form.  BTW&#8230; I&#8217;ve just started doing research into this area so if I&#8217;m mistaken about this, please let me know.  Contact forms get mailed back to you while comment forms are shown in page.  I was hoping that I would be able to find a plug-in that would let me do this but no luck so far.  While there are lots of contact form plugins, I don&#8217;t think I see any that show the information right back to the page.  I think I can get what I want by doing some theme editing but I was hoping there would be a simpler solution.  In any case, hopefully I&#8217;ll be able to find something soon to solve this.]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/creating-tester-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problems with porting</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/problems-with-porting/</link>
		<comments>http://www.c3dl.org/index.php/c3dl-dev/problems-with-porting/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 21:28:19 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[c3dl development]]></category>

		<guid isPermaLink="false">http://www.c3dl.org/?p=2044</guid>
		<description><![CDATA[I&#8217;m currently in the process of trying to port over our library so that it works in Safari(WebKit) (and eventually Chrome too) and not just Firefox.  The first step of this was getting rid of our use of a &#8216;const&#8217; namespace, and I&#8217;ve accomplished that (I haven&#8217;t actually released it because I want to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently in the process of trying to port over our library so that it works in Safari(WebKit) (and eventually Chrome too) and not just Firefox.  The first step of this was getting rid of our use of a &#8216;const&#8217; namespace, and I&#8217;ve accomplished that (I haven&#8217;t actually released it because I want to make sure it works right before I release it and start letting people use something that&#8217;s broken), but now I&#8217;m having trouble with the differences between how Firefox handles including extra files in script tags, and how Safari does it. </p>

<p>The issue is that to use c3dl you have to tell the browser to include some extra files (normally using script tags) and instead of having to manually include each file (there are quite a few of them, it is a library after all), it is handy to include one file, which then gives instructions to include all the others.  Doing it this way means that you can make changes to the library (maybe add some now files or get rid of some obsolete ones) and you only have to change the file that says what files to include, which will cascade to all the pages that include it.  If we manually put all the includes in every web page, you&#8217;d have to update every one of them every time there was a change to the file structure of the library.</p>

<p>Firefox seems to accept this and when the first file you tell it to include (from now on we&#8217;ll refer to that as fileA), says to include some other files (we&#8217;ll call them fileC, fileD, and fileE) it reads them before it gets to the next file that the page tells it to include (we&#8217;ll call that one fileB).  To rephrase that:  The page says to include fileA and fileB.  FileA says include fileC, fileD and FileE.  FileB has some other code (in our model, this is the actual 3d app that you&#8217;re trying to display in the canvas).  Firefox includes fileA and based on what it says also includes FileC, FileD and FileE.  Then it includes fileB.  Safari includes fileA, then fileB and then gets around to what FileA told it to do and includes fileC, fileD and fileE (I think&#8230;it crashes before it can get here).  The problem is that files C,D and E are the library, while B is the code that needs the library to run.  So we have to get C,D and E before B, or to go back to the real code, we need the library before we read the code that uses the library.  So I need some way to force Safari to read the files in the library before it reads the file that says what the page does.</p>

<p>Now, I keep using the word &#8216;include&#8217; and I know JavaScript does not have an include statement, but I mean the general idea of reading code that is in some other file.  Here this is accomplished with a script tag such as:<p>

<pre>
&lt;script type="application/javascript" src="../../canvas3dapi/c3dapi.js"&gt; &lt;/script&gt;
&lt;script type="application/javascript" src="orbiter.js"&gt;&lt;/script&gt;
</pre> 

<p>So Firefox would include c3dapi.js, then everything c3dapi.js says to include (it just adds some more script tags like this to the DOM, each of which specifies some other .js file to use), then it would include orbiter.js.  Safari includes c3dapi.js, then orbiter.js, then all the other files that c3dapi.js added.  So I need some way to force Safari to include them in a specific order.  We have already received an email or two with suggestions (Thanks Tim) on how to make the code work on Safari, and they at least allow us to do away with the SCRIPT_PATH variable, but they still fall victim to the same problem about the order of the includes.  Right now I&#8217;m using appendChild on the head element to add the extra script tags, but I&#8217;m thinking there might be a way to sneak them into the middle of the head&#8217;s child tags so we can get them to be read before the next script tag that actually did appear on the page.  I&#8217;m thinking something like insertBefore or insertAfter, but I need a little more time to play with those.</p>

<p>I&#8217;m going to keep working on this, and if anyone has any suggestions, I&#8217;d be happy to listen.<p>]]></content:encoded>
			<wfw:commentRss>http://www.c3dl.org/index.php/c3dl-dev/problems-with-porting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
