<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Asteroids in 3D&#8230; and a bit of 2D</title>
	<atom:link href="http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/</link>
	<description>WebGL made easy!</description>
	<lastBuildDate>Tue, 16 Aug 2011 14:23:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Phreak Nation</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/comment-page-1/#comment-1329</link>
		<dc:creator>Phreak Nation</dc:creator>
		<pubDate>Sat, 11 Dec 2010 12:14:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.c3dl.org/?p=2271#comment-1329</guid>
		<description>I have fixed this issue. If you would like to view the source code please head over to http://www.phreak-nation.com/new_terra/

Was not working with the link.</description>
		<content:encoded><![CDATA[<p>I have fixed this issue. If you would like to view the source code please head over to <a href="http://www.phreak-nation.com/new_terra/" rel="nofollow">http://www.phreak-nation.com/new_terra/</a></p>
<p>Was not working with the link.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phreak Nation</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/comment-page-1/#comment-1324</link>
		<dc:creator>Phreak Nation</dc:creator>
		<pubDate>Thu, 02 Dec 2010 23:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.c3dl.org/?p=2271#comment-1324</guid>
		<description>This is a diablo styled game and the player moves based on where the mouse is clicked. I managed everything but the &quot;player&quot; spins based on the center[0,0,0] of the map and not himself relative to the location. He spins how he should, if it was based on the center of the map...lol

Heres an update to the code. As you can tell the lookpoint is the character, rather alittle above as to not give the effect of looking lower than him.
&lt;code&gt;
  function update() {
    var pos = player.getPosition();
    if (mouse_left) {
      // Grab mouse cords based on X,Y and translate them to 3d cords, X,Y,Z
      destinationX = worldCoords[0];
      destinationZ = worldCoords[2];
      if (speedCurrent  0.01) speedCurrent *= decay;
      else speedCurrent = 0;
    }
    playerX += (destinationX - pos[0]) * speedCurrent;
    playerZ += (destinationZ - pos[2]) * speedCurrent;
    var radians = Math.atan2(playerZ, playerX);
    //  var degrees = radians / (Math.PI / 180);
    if (radians!=oldyaw) {
      // Rotate player based on old position to new position
      player.yaw(radians-oldyaw);
      // Shows yaw in debug area
      $(&quot;#debug&quot;).html(radians-oldyaw);
      // remember old yaw
      oldyaw=radians;
    }
    // Move player
    player.setPosition([playerX,0,playerZ]);
    // Move camera based on players location and look relative to his position
    cam.setPosition([playerX+150,300,playerZ+150]);
    cam.setLookAtPoint([playerX, 50.0, playerZ]);
    // Move a light based on players position
    diffuse.setPosition([playerX+50,100,playerZ+50]);

    // Replenish stats based on game time
    statReplinish();
  }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This is a diablo styled game and the player moves based on where the mouse is clicked. I managed everything but the &#8220;player&#8221; spins based on the center[0,0,0] of the map and not himself relative to the location. He spins how he should, if it was based on the center of the map&#8230;lol</p>
<p>Heres an update to the code. As you can tell the lookpoint is the character, rather alittle above as to not give the effect of looking lower than him.<br />
<code><br />
  function update() {<br />
    var pos = player.getPosition();<br />
    if (mouse_left) {<br />
      // Grab mouse cords based on X,Y and translate them to 3d cords, X,Y,Z<br />
      destinationX = worldCoords[0];<br />
      destinationZ = worldCoords[2];<br />
      if (speedCurrent  0.01) speedCurrent *= decay;<br />
      else speedCurrent = 0;<br />
    }<br />
    playerX += (destinationX - pos[0]) * speedCurrent;<br />
    playerZ += (destinationZ - pos[2]) * speedCurrent;<br />
    var radians = Math.atan2(playerZ, playerX);<br />
    //  var degrees = radians / (Math.PI / 180);<br />
    if (radians!=oldyaw) {<br />
      // Rotate player based on old position to new position<br />
      player.yaw(radians-oldyaw);<br />
      // Shows yaw in debug area<br />
      $("#debug").html(radians-oldyaw);<br />
      // remember old yaw<br />
      oldyaw=radians;<br />
    }<br />
    // Move player<br />
    player.setPosition([playerX,0,playerZ]);<br />
    // Move camera based on players location and look relative to his position<br />
    cam.setPosition([playerX+150,300,playerZ+150]);<br />
    cam.setLookAtPoint([playerX, 50.0, playerZ]);<br />
    // Move a light based on players position<br />
    diffuse.setPosition([playerX+50,100,playerZ+50]);</p>
<p>    // Replenish stats based on game time<br />
    statReplinish();<br />
  }<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy Leung</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/comment-page-1/#comment-1323</link>
		<dc:creator>Cathy Leung</dc:creator>
		<pubDate>Thu, 02 Dec 2010 07:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.c3dl.org/?p=2271#comment-1323</guid>
		<description>We don&#039;t really have a forums, but if you post a comment generally we will try to see what we can do to help.

I&#039;m not sure as I have not tried this but perhaps you can set the lookatpoint of the camera to be directly in front of you?  Let me experiment with that and see if that works.</description>
		<content:encoded><![CDATA[<p>We don&#8217;t really have a forums, but if you post a comment generally we will try to see what we can do to help.</p>
<p>I&#8217;m not sure as I have not tried this but perhaps you can set the lookatpoint of the camera to be directly in front of you?  Let me experiment with that and see if that works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phreak Nation</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/comment-page-1/#comment-1322</link>
		<dc:creator>Phreak Nation</dc:creator>
		<pubDate>Thu, 02 Dec 2010 00:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.c3dl.org/?p=2271#comment-1322</guid>
		<description>I was wondering if there is a forum for C3DL  or something because I have a few questions I was needing to have a question answered. Below is my Q. There is not enough resources that is for sure. I love C3DL and would love to see a forum put up

I want to turn the player in the direction he is moving. Thus far all he does is rotate based on the center cords. Which is annoying to say the least. Thanks for any help.
&lt;code&gt;
    var pos = player.getPosition();
    playerX += (destinationX - pos[0]) * speedCurrent;
    playerZ += (destinationZ - pos[2]) * speedCurrent;
    var radians = Math.atan2(playerZ, playerX);
    if (radians!=oldyaw) {
      player.yaw((radians-oldyaw));
      oldyaw=radians;
    }
    player.setPosition([playerX,0,playerZ]);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I was wondering if there is a forum for C3DL  or something because I have a few questions I was needing to have a question answered. Below is my Q. There is not enough resources that is for sure. I love C3DL and would love to see a forum put up</p>
<p>I want to turn the player in the direction he is moving. Thus far all he does is rotate based on the center cords. Which is annoying to say the least. Thanks for any help.<br />
<code><br />
    var pos = player.getPosition();<br />
    playerX += (destinationX - pos[0]) * speedCurrent;<br />
    playerZ += (destinationZ - pos[2]) * speedCurrent;<br />
    var radians = Math.atan2(playerZ, playerX);<br />
    if (radians!=oldyaw) {<br />
      player.yaw((radians-oldyaw));<br />
      oldyaw=radians;<br />
    }<br />
    player.setPosition([playerX,0,playerZ]);<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/comment-page-1/#comment-1249</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Fri, 12 Feb 2010 22:23:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.c3dl.org/?p=2271#comment-1249</guid>
		<description>It&#039;s unbelievable how far browser technology has come! I&#039;m sure that your library will become ubiquitous as webgl adoption progresses.</description>
		<content:encoded><![CDATA[<p>It&#8217;s unbelievable how far browser technology has come! I&#8217;m sure that your library will become ubiquitous as webgl adoption progresses.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andor Salga</title>
		<link>http://www.c3dl.org/index.php/c3dl-dev/asteroids-in-3d-and-a-bit-of-2d/comment-page-1/#comment-1243</link>
		<dc:creator>Andor Salga</dc:creator>
		<pubDate>Mon, 01 Feb 2010 20:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.c3dl.org/?p=2271#comment-1243</guid>
		<description>Wow, now that&#039;s a cool demo! :D</description>
		<content:encoded><![CDATA[<p>Wow, now that&#8217;s a cool demo! <img src='http://www.c3dl.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

