<?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>DX Creations</title>
	<atom:link href="http://www.dxcreations.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dxcreations.com</link>
	<description>Bring your ideas to life</description>
	<lastBuildDate>Wed, 25 Nov 2009 05:00:50 +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>Faster Javascript loops</title>
		<link>http://www.dxcreations.com/?p=111</link>
		<comments>http://www.dxcreations.com/?p=111#comments</comments>
		<pubDate>Wed, 25 Nov 2009 05:00:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Tricks]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=111</guid>
		<description><![CDATA[Consider this very standard construct:

//assume arr is an array
for (var i = 0, i < arr.length; i++)
{
    ...
}

This is extemely inefficient because the "length" property needs to be looked up on each pass through the loop.  One easy fix is to first define a variable for the length, like this:

var l [...]]]></description>
			<content:encoded><![CDATA[<p>Consider this very standard construct:<br />
<code><br />
//assume arr is an array<br />
for (var i = 0, i < arr.length; i++)<br />
{<br />
    ...<br />
}<br />
</code><br />
This is extemely inefficient because the "length" property needs to be looked up on each pass through the loop.  One easy fix is to first define a variable for the length, like this:<br />
<code><br />
var l = arr.length;<br />
for (var i = 0; i < l; i++)<br />
</code><br />
This is an improvement, but this particular loop is so simple that it could be further simplified into a while loop, which will run much faster again.  Since we don't really care whether we go through the array from its beginning to end or vice versa:<br />
<code><br />
var i = arr.length;<br />
while (i--)<br />
{<br />
    ...<br />
}<br />
</code></p>
<p>This little tip applies to <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">Javascript</a> in general but will be highly effective with <a href="http://www.dxstudio.com/buy.aspx?affiliate=4f7e3885-20ec-42f7-9f64-5ddb67f939d1">DXStudio</a> scripting.  Also, I cannot take credit for this discovery.  I read it on <a href="http://www.sitepoint.com">Sitepoint</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=111</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debug Print [with no lingering effects]</title>
		<link>http://www.dxcreations.com/?p=94</link>
		<comments>http://www.dxcreations.com/?p=94#comments</comments>
		<pubDate>Sun, 08 Nov 2009 23:08:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Tricks]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=94</guid>
		<description><![CDATA[The "print()" command is extremely useful in DXStudio.  But when you want to temporarily mask your debug output, it is tedious to modify every occurance of "print()" in your code.
By substituting the internal "print()" command in DXStudio with a simple function, you can toggle the debug display by modifying ONE value in ONE place in your code!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dxstudio.com/buy.aspx?affiliate=4f7e3885-20ec-42f7-9f64-5ddb67f939d1">DXStudio</a> has implemented Javascript as its control language.  Of course there are a few departures from the pure <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA Javascript</a> implementation.  Many are to directly control the 2D and 3D assets in your project.  A few were added to aid in development.</p>
<p>The &#8220;print()&#8221; command is extremely useful.  If you have <span title="Actually, you need to NOT disable it">properly enabled it</span> in your Document Properties (see image), the &#8216;console&#8217; can display useful debug information. <div id="attachment_95" class="wp-caption alignright" style="width: 310px"><img src="http://www.dxcreations.com/wp-content/uploads/2009/11/documentproperties-300x251.png" alt="DX Document Properties" title="DX Document Properties" width="300" height="251" class="size-medium wp-image-95" /><p class="wp-caption-text">DX Document Properties</p></div><br />
In the scripting code you can reveal the value of variables (and objects) by sending output to the console with the &#8220;print()&#8221; command.  The trouble comes when you wish to release your work to the public.  Even if you are testing or sharing with a small group of fellow developers, numerous print commands can produce a very annoying result by displaying lots of superfluous information.  The console obscures part of the display, often times when you are trying to SEE something important.<br />
Removing, or adding remarks to disable, the many &#8220;print()&#8221; commands is tedious and troublesome.  Remembering <b>where</b> they all exist can be a tremendous task in itself on a large project that includes many scenes and/or objects with script in them.<br />
By substituting the internal &#8220;print()&#8221; command in DXStudio with a simple function, you can toggle the debug display by modifying ONE value in ONE place in your code!  Here&#8217;s how to do it.<br />
In the Document script add the lines shown.  The DEBUG constant is the key to this.  Changing it will affect <b>all instances of a console print command</b> at once.</p>
<div id="attachment_101" class="wp-caption alignright" style="width: 310px"><img src="http://www.dxcreations.com/wp-content/uploads/2009/11/documentscript-300x127.png" alt="Document Script commands" title="Document Level Script commands" width="300" height="127" class="size-full wp-image-101" /><p class="wp-caption-text">Document Script commands</p></div>
<p>Then anywhere in your scripts that you wish to output DEBUG information to the console display.<br />
<div id="attachment_104" class="wp-caption alignright" style="width: 559px"><img src="http://www.dxcreations.com/wp-content/uploads/2009/11/scenescript.png" alt="Example of DEBUG output - in place of a simple &#039;print()&#039; command" title="Scene Script" width="549" height="181" class="size-full wp-image-104" /><p class="wp-caption-text">Example of DEBUG output - in place of a simple 'print()' command</p></div></p>
<p>But, whenever you wish to suppress the DEBUG output, simply change the value of the constant &#8220;DEBUG&#8221; to false!</p>
<p>There are many enhancements that could be made to this simple idea.  Even an independent class could be created that adds some other useful &#8220;debug&#8221; operations.  I will leave those enhancements up to the creative and adventuresome reader.  But PLEASE send me your favorite changes and they will appear here in an update to this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=94</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handy Conversion Functions</title>
		<link>http://www.dxcreations.com/?p=81</link>
		<comments>http://www.dxcreations.com/?p=81#comments</comments>
		<pubDate>Tue, 20 Oct 2009 00:41:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=81</guid>
		<description><![CDATA[Here is a small set of handy utilities from David Shute.


// ******************************************************************* 

function vecToStr(vect, dp)
{
    //returns the given vector as a string in the form "(x, y, z)"
    //Also accepts an optional parameter representing the number of
    //decimal places to display the results to (int) 

 [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a small set of handy utilities from David Shute.</p>
<div><code>
<pre>
// ******************************************************************* 

function vecToStr(vect, dp)
{
    //returns the given vector as a string in the form "(x, y, z)"
    //Also accepts an optional parameter representing the number of
    //decimal places to display the results to (int) 

    if (dp != null)
        return "(" + vect.x.toFixed(dp) + ", " + vect.y.toFixed(dp) + ", "
                                                               + vect.z.toFixed(dp) + ")";
    else
        return "(" + vect.x + ", " + vect.y + ", " + vect.z + ")";
} 

// ******************************************* 

function rotToStr(rot, dp)
{
    //returns the given rotation as a string in the quaternion form "(x, y, z, w)"
    //Also accepts an optional parameter representing the number of
    //decimal places to display the results to (int).
    //To create a string using the Euler values, please use rotToStrEuler() 

    if (isNaN(dp))
        return "(" + rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w + ")";
    else
        return "(" + rot.x.toFixed(dp) + ", " + rot.y.toFixed(dp) + ", "
                          + rot.z.toFixed(dp)  + ", " + rot.w.toFixed(dp)+ ")";
}     

// ******************************************* 

function rotToStrEuler(rot, dp)
{
    //returns the given rotation as a string in the Euler form "(x, y, z)"
    //Also accepts an optional parameter representing the number of
    //decimal places to display the results to (int).
    //To create a string using the quaternion values, please use rotToStr() 

    if (dp != null)
        return "(" + rot.eulerX.toFixed(dp) + ", " + rot.eulerY.toFixed(dp)
                                                   + ", " + rot.eulerZ.toFixed(dp) + ")";
    else
        return "(" + rot.eulerX + ", " + rot.eulerY + ", " + rot.eulerZ + ")";
}     

// *******************************************

function clamp(value, min, max)
{
    //returns a number representing the given value clamped
    //between the specified high and low bounds. 

    return Math.min(Math.max(value, min), max);
} 

// *******************************************
</pre>
<p></code><br />
Special thanks to <a href="http://www.dxstudio.com/user.aspx?id=8575393a-fc6a-44b1-9ddf-d7bde8467ee6">David</a> for sharing these useful tidbits.
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3ds Max to DXStudio Perfect scale export</title>
		<link>http://www.dxcreations.com/?p=68</link>
		<comments>http://www.dxcreations.com/?p=68#comments</comments>
		<pubDate>Fri, 16 Oct 2009 01:21:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3D Model & Export]]></category>
		<category><![CDATA[3DS Max]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=68</guid>
		<description><![CDATA[There has been a lot of discussion and experimentation surrounding the conversion factor from 3DS Max to DXStudio.
Here is a visual tutorial that solves the problem.
In our case we using the .DXMesh exporter with a ratio of 1 Max unit to 10 centimeters.
Exporting under these conditions provides a 1:1 import into DXStudio.
]]></description>
			<content:encoded><![CDATA[<p>There has been a lot of discussion and experimentation surrounding the conversion factor from 3DS Max to DXStudio.<br />
Here is a visual tutorial that solves the problem.<br />
<div id="attachment_70" class="wp-caption alignright" style="width: 310px"><a href="http://www.dxcreations.com/wp-content/uploads/2009/10/3dsMax1to1Export.jpg" target="_blank"><img src="http://www.dxcreations.com/wp-content/uploads/2009/10/3dsMax1to1Export-300x225.jpg" alt="3DS Max 1:1 Export" title="3ds Max 1:1 Export - Click for full size image" width="300" height="225" class="size-medium wp-image-70" /></a><p class="wp-caption-text">3DS Max 1:1 Export</p></div><br />
In our case we using the .DXMesh exporter with a ratio of 1 Max unit to 10 centimeters.<br />
Exporting under these conditions provides a 1:1 import into DXStudio.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=68</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Computer Game of Life</title>
		<link>http://www.dxcreations.com/?p=48</link>
		<comments>http://www.dxcreations.com/?p=48#comments</comments>
		<pubDate>Tue, 06 Oct 2009 23:26:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=48</guid>
		<description><![CDATA[The standard by which most computer languages are measured by the simplest of functions, &#8220;Hello World&#8221;.
In the 1960&#8217;s a mathematician name John Horton Conway devised a computer simulation to mimic the essence of Life.  Three simple rules control the health or demise of each &#8216;cell&#8217;.
As the power and capabilities of modern computers grew, this became another [...]]]></description>
			<content:encoded><![CDATA[<p>The standard by which most computer languages are measured by the simplest of functions, &#8220;Hello World&#8221;.</p>
<p>In the 1960&#8217;s a mathematician name John Horton Conway devised a <a title="Computer Simulation of Life" href="http://www.abc.net.au/science/holo/lablife.htm" target="_blank">computer simulation </a>to mimic the essence of Life.  <a href="#threerules">Three simple rules</a> control the health or demise of each &#8216;cell&#8217;.</p>
<p>As the power and capabilities of modern computers grew, this became another staple of software comparison.</p>
<p><a title="DXStudio - ideas to life" href="http://www.dxstudio.com/buy.aspx?affiliate=4f7e3885-20ec-42f7-9f64-5ddb67f939d1" target="_blank">DXStudio</a> provides incredible tools to create any 3D world.  <a href="projects/Life/play.php" title="Life - A 3D Computer Simulation">This version of Life</a> takes the simple rules and extends them  into the 3rd dimension.</p>
<p><a name="threerules"></a>
<p>Life takes place on a grid.  Each cell is evaluated to live or die by these three simple rules:</p>
<ul>
<li>If a cell has one or no living neighbours, it will die of loneliness</li>
<li>If it has too many neighbours &#8211; four or more &#8211; it will die from overcrowding</li>
<li>New cells are &#8220;born&#8221; whenever an empty square has exactly three living neighbors</li>
</ul>
<p><a href="projects/Life/play.php">Play 3D Life now</a></p>
<hr />
<div class="designernotes">
<h1>Designer Notes</h1>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=48</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aman &#8216;Rah &#8211; Mystery of Egypt</title>
		<link>http://www.dxcreations.com/?p=14</link>
		<comments>http://www.dxcreations.com/?p=14#comments</comments>
		<pubDate>Tue, 06 Oct 2009 22:35:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[DXStudio]]></category>
		<category><![CDATA[Thom Parkin]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=14</guid>
		<description><![CDATA[The people of Ancient Egypt have a reputation for devising very complex puzzles to keep would-be robbers out of their elaborate tombs.  Afterall, the Pharoh must be kept safe until his meeting with the gods!
I created Aman &#8216;Rah  in that vein.  You are faced with a complex array of heiroglyphs.  The key to unlocking the [...]]]></description>
			<content:encoded><![CDATA[<p>The people of Ancient Egypt have a reputation for devising very complex puzzles to keep would-be robbers out of their elaborate tombs.  Afterall, the Pharoh must be kept safe until his meeting with the gods!</p>
<p>I created <a title="Aman 'Rah - Mystery of Egypt" href="projects/AmanRah/play.php" target="_blank">Aman &#8216;Rah</a>  in that vein.  You are faced with a complex array of heiroglyphs.  The key to unlocking the secret (a high score) lies in how cleverly you combine matching glyphs.</p>
<p><a style="padding:10px 5px;" href="projects/AmanRah/play.php"><img title="Aman Rah - Tile Matching Game" src="projects/AmanRah/thumbnail.bmp" alt="Aman Rah - Tile Matching Game" style="width: 220px; height:auto;"  /></a></p>
<p><a title="Aman 'Rah - Mystery of Egypt" href="http://www.dxcreations.com/projects/AmanRah/play.php" target="_blank">Aman &#8216;Rah</a> is a game of matching. You must match two tiles that share either a Glyph or Color (or both) by clicking on one and then the other with the mouse. The amount of score you receive is related to what type of match you make:</p>
<ul>
<li>Match Color and Glyph &#8211; <em>Maximum</em></li>
<li>Match only Glyph or only Color</li>
</ul>
<p>The four tiles across the bottom are called the tray.  Using a tile from the tray for a match incurs a penalty to your score.</p>
<p>The other tiles are the board. Notice they are arranged in a pyramid. You cannot access a tile unless it is completely uncovered. It requires skill and careful planning to successfully match all the tiles on the board. There is a bonus awarded for clearing the board.</p>
<p>Can you achieve a high score and protect the King?</p>
<p><a title="Aman 'Rah - Mystery of Egypt" href="projects/AmanRah/play.php" target="_blank">Play Aman &#8216;Rah now</a>.</p>
<hr />
<h1>Designer Notes</h1>
<div class="designernotes">
<p>I have been developing software for more than 30 years.  DXStudio provides wonderful GUI tools for creating 3D (and 2D) environments.  But, as a software developer, I created Aman &#8216;Rah entirely from code.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The best 3D Game Engine</title>
		<link>http://www.dxcreations.com/?p=1</link>
		<comments>http://www.dxcreations.com/?p=1#comments</comments>
		<pubDate>Tue, 06 Oct 2009 00:40:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.dxcreations.com/?p=1</guid>
		<description><![CDATA[Yes.  I am prejudiced.  And perhaps you don&#8217;t really care about my opinion.  That&#8217;s fine.  Stop reading.
Good.  You are (at least a little) interested.  Or maybe just curious.
I spent many months doing what I believe was diligent research, in search of the best 3D game development system.  There are many choices.  And the list grows [...]]]></description>
			<content:encoded><![CDATA[<p>Yes.  I am prejudiced.  And perhaps you don&#8217;t really care about <strong>my</strong> opinion.  That&#8217;s fine.  Stop reading.</p>
<p>Good.  You are (at least a little) interested.  Or maybe just curious.</p>
<p>I spent many months doing what I believe was diligent research, in search of the best 3D game development system.  There are many choices.  And the list grows everyday.  When considering all features, and the price, there is no match for <a class="dxstudiodownload" title="DXStudio - ideas to life" href="http://www.dxstudio.com/buy.aspx?affiliate=4f7e3885-20ec-42f7-9f64-5ddb67f939d1" target="_blank">DXStudio</a>.</p>
<p>Some other systems, with comparable features, lack decent support.  The DXStudio community is outstanding.</p>
<p>The feature list grows almost every week.  The support group is unrivalled.</p>
<p>(to be continued)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxcreations.com/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
