<?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>Newpixel</title>
	<atom:link href="http://www.newpixel.com/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.newpixel.com/wordpress</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 30 Jun 2011 02:33:02 +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>Getting a bounding box in Away3D Lite</title>
		<link>http://www.newpixel.com/wordpress/2011/06/29/getting-a-bounding-box-in-away3d-lite/</link>
		<comments>http://www.newpixel.com/wordpress/2011/06/29/getting-a-bounding-box-in-away3d-lite/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 02:33:02 +0000</pubDate>
		<dc:creator>newpixel</dc:creator>
				<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Flash Development]]></category>

		<guid isPermaLink="false">http://www.newpixel.com/wordpress/?p=334</guid>
		<description><![CDATA[A quick code drop here to fill in a minor missing piece of functionality in away3d lite- a function to compute an axis-aligned bounding box on a Mesh. The code, which I&#8217;ve included as a member function of Mesh.as, simply runs through all the vertices to find the bounding box. This operates on the raw [...]]]></description>
			<content:encoded><![CDATA[<p>A quick code drop here to fill in a minor missing piece of functionality in away3d lite- a function to compute an axis-aligned bounding box on a Mesh. The code, which I&#8217;ve included as a member function of Mesh.as, simply runs through all the vertices to find the bounding box. This operates on the raw geometry, and does not apply to transformed objects.</p>
<pre class="code-block"><code>
/*
 * Returns an axis-aligned bounding box
 *
 * Added by richpixel, 6/27/11, code is from Papervision, modified for away3d vertex format
 */
public function get AABB():Object
{
	var minX :Number = Number.MAX_VALUE;
	var minY :Number = Number.MAX_VALUE;
	var minZ :Number = Number.MAX_VALUE;
	var maxX :Number = -minX;
	var maxY :Number = -minY;
	var maxZ :Number = -minZ;

	var k:int = _vertices.length/3;
	while (k--)
	{
		var vx:Number = _vertices[k*3];
		var vy:Number = _vertices[k*3+1];
		var vz:Number = _vertices[k*3+2];

		minX = Math.min(minX, vx);
		minY = Math.min(minY, vy);
		minZ = Math.min(minZ, vz);
		maxX = Math.max(maxX, vx);
		maxY = Math.max(maxY, vy);
		maxZ = Math.max(maxZ, vz);
	}

	return {minX: minX, minY: minY, minZ: minZ, maxX: maxX, maxY: maxY, maxZ: maxZ};
}

</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.newpixel.com/wordpress/2011/06/29/getting-a-bounding-box-in-away3d-lite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Shadowbox in Wordpress</title>
		<link>http://www.newpixel.com/wordpress/2011/06/29/using-shadowbox-in-wordpress/</link>
		<comments>http://www.newpixel.com/wordpress/2011/06/29/using-shadowbox-in-wordpress/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 23:17:56 +0000</pubDate>
		<dc:creator>newpixel</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[shadowbox]]></category>

		<guid isPermaLink="false">http://www.newpixel.com/wordpress/?p=305</guid>
		<description><![CDATA[Our blog is still running WordPress 2.8.4 as we don&#8217;t really have time to make all the upgrades on the plugins and such. So we are stuck in the WP backwaters for now. Just one of the downsides of running an older version is not having access to all the latest and greatest plugins. For [...]]]></description>
			<content:encoded><![CDATA[<p style="padding-bottom: 10px;">Our blog is still running WordPress 2.8.4 as we don&#8217;t really have time to make all the upgrades on the plugins and such. So we are stuck in the WP backwaters for now. Just one of the downsides of running an older version is not having access to all the latest and greatest plugins. For example we wanted to add a simple lightbox to our site to show off projects. Sounds easy enough &#8211; there is no shortage of free lightbox plugins, and a lot of them seemed to be a perfect fit for us. Unfortunately, none of them worked. Many had 3.0 or above as a minimum req. and others just simply didn&#8217;t work, look good, or generally failed for whatever reason. Shadowbox was one of the plugins I was really interested in because it was built on top of a very well regarded javascript lightbox solution&#8230;. but it requires WP 3.1. So what could we do? After checking out Shadowbox it seemed like it would be easy enough to add it directly to the page (with a little coding), thus bypassing the need for a clunky, broken plugin- I won&#8217;t name names on these, and I should add it&#8217;s possible I didn&#8217;t really take the time to simply get them to work!</p>
<p style="padding-bottom: 10px;">If you don&#8217;t have <a href="http://www.shadowbox-js.com/" target="_blank">Shadowbox</a>, they make it super simple to download a light-weight package customized for your deployment situation, with plenty of documentation and support available.</p>
<p style="padding-bottom: 10px;">First, download a custom version of shadowbox from their site, using jQuery as the adapter. (The others would work too, but I chose jQuery because WordPress comes with jQuery installed). It will custom create a zip file with only the code you need to display the desired content.</p>
<p style="padding-bottom: 10px;">Unpack the zip file and upload the shadowbox folder to your server. I put &#8217;shadowbox-3.0.3&#8242; inside &#8216;wp-includes/js&#8217; in my wordpress site.</p>
<p style="padding-bottom: 10px;">In order to register the javascript and css for shadowbox, you could add a hook for the &#8216;init&#8217; action which would ensure the script is placed on all your pages. In that case you would &#8216;wp_enqueue_script()&#8217; and &#8216;wp_enqueue_style()&#8217; inside the hook function to include shadowbox. In my case, I just wanted to include shadowbox on a single page, so I added a hook for &#8216;wp_head&#8217; on my page template php. This code needs to be put on your page before the call to <code>get_header()</code>.</p>
<p style="padding-bottom: 20px;">
<pre class="code-block"><code>/**
* Adds javascript shadowbox options
*/
function add_shadwobox_head()
{
echo "&lt;link rel='stylesheet' type='text/css' href='".get_bloginfo('url')."/wp-includes/js/shadowbox-3.0.3/shadowbox.css'&gt;\n";
echo "&lt;script type='text/javascript' src='".get_bloginfo('url')."/wp-includes/js/shadowbox-3.0.3/shadowbox.js'&gt;&lt;/script&gt;\n";
echo "&lt;script type='text/javascript'&gt;\n";
echo "Shadowbox.init();\n";
echo "&lt;/script&gt;\n\n";
}
add_action( 'wp_head', 'add_shadwobox_head');
</code></pre>
</p>
<p style="padding-top: 10px; padding-bottom: 10px;">Now, to trigger the shadowbox, all you have to do is add special code to the &#8216;rel&#8217; attribute on your links. There are more options besides width and height of the lightbox, but all you really need is rel=&#8221;shadowbox&#8221; to bring it up:</p>
<pre id="line112" class="code-block"><code>&lt;<span>a</span><span> rel</span>=<span>"shadowbox;width=800;height=600" </span><span>href</span><span>="</span>http://www.google.com<span>"</span>&gt;Google Test&lt;/<span>a</span>&gt;</code></pre>
<p style="padding-bottom: 10px;"><a href="&lt;/p"></a></p>
<p style="padding-bottom: 10px;">Try it out: <a rel="shadowbox;width=800;height=600" href="http://www.google.com">Google Test</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newpixel.com/wordpress/2011/06/29/using-shadowbox-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

