<?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>The Mediocre Coder</title>
	<atom:link href="http://www.digitasj.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.digitasj.com/blog</link>
	<description>A blog, a blog! A blog of exploration, conclusions, and following your dreams. xD</description>
	<lastBuildDate>Tue, 17 Apr 2012 09:27:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Coordinate Systems and Cross Products</title>
		<link>http://www.digitasj.com/blog/?p=54</link>
		<comments>http://www.digitasj.com/blog/?p=54#comments</comments>
		<pubDate>Wed, 26 Oct 2011 00:32:24 +0000</pubDate>
		<dc:creator>nattchan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://www.digitasj.com/blog/?p=54</guid>
		<description><![CDATA[OpenGL &#8211; uses right-hand coordinate system and column vectors. Since column vectors are being used, the matrices have to be multiplied backwards, i.e. the vector you want to transform will be at the end of the equation. Therefore, if you want your vector to apply a translation and then a rotation, you first multiply the [...]]]></description>
			<content:encoded><![CDATA[<p>OpenGL &#8211; uses right-hand coordinate system and column vectors. Since column vectors are being used, the matrices have to be multiplied backwards, i.e. the vector you want to transform will be at the end of the equation.<br />
Therefore, if you want your vector to apply a translation and then a rotation, you first multiply the rotation, then translation, then apply it to your column vector, RTv (R=rotation matrix, T=translation matrix, v=vector).</p>
<p>DirectX &#8211; uses the left-hand coordinate system and row vectors. With row vectors, calculations are done in order. So if you want your vector to apply a translation and then a rotation (as in the above), your equation becomes vTR.</p>
<p>Y u so different? They are complete opposites, it seems. I know DirectX chooses row vectors for some optimization reason (row faster to access in memory, etc), and there are texts that I will probably read up more on regarding the matter. But as of now, going through these can get a bit confusing.</p>
<p><strong>Cross Product</strong></p>
<p>So when it comes to cross products how do you figure out the direction of the resultant vector when there are two coordinate systems?</p>
<p>If you are trying to get the cross product of axb (a &#038; b are vectors) trace the angle going from a to b. If the direction of the traced angle is clockwise, on a left-hand system, the resultant vector will be pointing towards you.</p>
<p>Now, on a right hand system, if you trace the angle from a to b and it is counter-clockwise the resultant vector will be pointing&#8230;towards you!</p>
<p><s>Aughh! Lol. It&#8217;s much easier to draw it and/or use hand motions. I should update this with images.</s><br />
<div id="attachment_60" class="wp-caption aligncenter" style="width: 435px"><a href="http://www.digitasj.com/blog/wp-content/uploads/2011/10/cpcoord.jpg"><img src="http://www.digitasj.com/blog/wp-content/uploads/2011/10/cpcoord.jpg" alt="" title="cpcoord" width="425" height="215" class="size-full wp-image-60" /></a><p class="wp-caption-text">Huzzah, first image! (LHCS on left, RHCS on right)</p></div></p>
<p>Long story short, there are possible combinations. What are the answers? Dun dun dun&#8230;</p>
<table border="1">
<tr>
<td></td>
<td><b>coordinate system</b></td>
<td><b>angle traced</b></td>
<td><b>resultant direction</b></td>
</tr>
<tr>
<td>axb</td>
<td>right-handed</td>
<td>clockwise</td>
<td>away from you <font color="#FFFFFF">?</font></td>
</tr>
<tr>
<td>axb</td>
<td>left-handed</td>
<td>clockwise</td>
<td>towards you <font color="#FFFFFF">?</font></td>
</tr>
<tr>
<td>axb</td>
<td>right-handed</td>
<td>counter-clockwise</td>
<td>towards you <font color="#FFFFFF">?</font></td>
</tr>
<tr>
<td>axb</td>
<td>left-handed</td>
<td>counter-clockwise</td>
<td>away from you <font color="#FFFFFF">?</font></td>
</tr>
<tr>
<td>bxa</td>
<td>right-handed</td>
<td>clockwise</td>
<td>? <font color="#FFFFFF"></font></td>
</tr>
<tr>
<td>bxa</td>
<td>left-handed</td>
<td>clockwise</td>
<td>? <font color="#FFFFFF"></font></td>
</tr>
<tr>
<td>bxa</td>
<td>right-handed</td>
<td>counter-clockwise</td>
<td>? <font color="#FFFFFF"></font></td>
</tr>
<tr>
<td>bxa</td>
<td>left-handed</td>
<td>counter-clockwise</td>
<td>? <font color="#FFFFFF"></font></td>
</tr>
</table>
<p>Well that&#8217;s some basic learning for today. If any of this sounds wrong please let me know, otherwise I will be very sad. :C</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitasj.com/blog/?feed=rss2&#038;p=54</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

