<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Virtual Realm</title><link>http://www.virtualrealm.com.au/</link><description>XNA and Game Development from Down Under</description><generator>Graffiti CMS 1.2 (build 1.2.0.1451)</generator><lastBuildDate>Mon, 04 Jan 2010 05:42:11 GMT</lastBuildDate><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mykre" /><feedburner:info uri="mykre" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><image><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url></image><item><title>XNA Rotated PerPixel Collision</title><link>http://feedproxy.google.com/~r/mykre/~3/1aoahQQtt5o/</link><pubDate>Mon, 04 Jan 2010 21:42:11 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/xna-rotated-perpixel-collision/</guid><dc:creator>Mykre</dc:creator><slash:comments>1</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;Yesterday I posted a quick post on a small project I was playing with (&lt;a href="http://www.virtualrealm.com.au/blogs/playing-with-sprites-and-collision-detection/"&gt;Link&lt;/a&gt;), and today I saw a post on the XNA Forums where a user was having problems with rotated rectangles and collision. So to help here is the ruff code that i have been playing with, hopefully it will help some one with their project, ATM it is not really complete and i am not fully happy with it. Currently the system slows down the game when I am doing the check on over 300 objects.&lt;/p&gt;  &lt;p&gt;A lot of this code is based on the Samples from the Creators Site.&lt;/p&gt;  &lt;p&gt;Code for Rotated PerPixel Collision.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; width: 650px; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #fbfbfb"&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Xna.Framework;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Graphics;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; TranslatedSpriteCollisions
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;{
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GameObject
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;    {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Texture2D texture;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Color[] colorData;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Matrix transform;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Vector2 Position;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Vector2 Origin;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Vector2 Velocity;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;float&lt;/span&gt; Rotation;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;float&lt;/span&gt; Scale = 1.0f;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Texture2D Texture
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; texture; }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                texture = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                colorData = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Color[texture.Width * texture.Height];
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                texture.GetData(colorData);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Origin = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Vector2(texture.Width / 2, texture.Height / 2);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Matrix Transform
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; transform; }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; UpdateTransform()
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            transform = Matrix.CreateTranslation(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Vector3(-Origin, 0.0f)) *
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Matrix.CreateScale(Scale) *
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Matrix.CreateRotationZ(Rotation) *
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Matrix.CreateTranslation(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Vector3(Position, 0.0f));
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Draw(SpriteBatch spriteBatch)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            spriteBatch.Draw(Texture, Position, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, Color.White, Rotation, Origin,
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                Scale, SpriteEffects.None, 0.0f);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IntersectPixels(GameObject b)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; IntersectPixels(transform, texture.Width, texture.Height, colorData,
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                           b.transform, b.texture.Width, b.texture.Height, b.colorData);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// Determines if there is overlap of the non-transparent pixels between two&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// sprites.&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;transformA&amp;quot;&amp;gt;World transform of the first sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;widthA&amp;quot;&amp;gt;Width of the first sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;heightA&amp;quot;&amp;gt;Height of the first sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;dataA&amp;quot;&amp;gt;Pixel color data of the first sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;transformB&amp;quot;&amp;gt;World transform of the second sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;widthB&amp;quot;&amp;gt;Width of the second sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;heightB&amp;quot;&amp;gt;Height of the second sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;dataB&amp;quot;&amp;gt;Pixel color data of the second sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;returns&amp;gt;True if non-transparent pixels overlap; false otherwise&amp;lt;/returns&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IntersectPixelsSlow(
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Matrix transformA, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; widthA, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; heightA, Color[] dataA,
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Matrix transformB, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; widthB, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; heightB, Color[] dataB)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// Calculate a matrix which transforms from A's local space into&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// world space and then into B's local space&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Matrix transformAToB = transformA * Matrix.Invert(transformB);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// For each row of pixels in A&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; yA = 0; yA &amp;lt; heightA; yA++)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #008000"&gt;// For each pixel in this row&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; xA = 0; xA &amp;lt; widthA; xA++)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #008000"&gt;// Calculate this pixel's location in B&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    Vector2 positionInB =
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Vector2.Transform(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Vector2(xA, yA), transformAToB);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #008000"&gt;// Round to the nearest pixel&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; xB = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)Math.Round(positionInB.X);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; yB = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)Math.Round(positionInB.Y);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #008000"&gt;// If the pixel lies within the bounds of B&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (0 &amp;lt;= xB &amp;amp;&amp;amp; xB &amp;lt; widthB &amp;amp;&amp;amp;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        0 &amp;lt;= yB &amp;amp;&amp;amp; yB &amp;lt; heightB)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        &lt;span style="color: #008000"&gt;// Get the colors of the overlapping pixels&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Color colorA = dataA[xA + yA * widthA];
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Color colorB = dataB[xB + yB * widthB];
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        &lt;span style="color: #008000"&gt;// If both pixels are not completely transparent,&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (colorA.A != 0 &amp;amp;&amp;amp; colorB.A != 0)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                            &lt;span style="color: #008000"&gt;// then an intersection has been found&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// No intersection found&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// Determines if there is overlap of the non-transparent pixels between two&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// sprites.&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;transformA&amp;quot;&amp;gt;World transform of the first sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;widthA&amp;quot;&amp;gt;Width of the first sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;heightA&amp;quot;&amp;gt;Height of the first sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;dataA&amp;quot;&amp;gt;Pixel color data of the first sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;transformB&amp;quot;&amp;gt;World transform of the second sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;widthB&amp;quot;&amp;gt;Width of the second sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;heightB&amp;quot;&amp;gt;Height of the second sprite's texture.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;dataB&amp;quot;&amp;gt;Pixel color data of the second sprite.&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #808080"&gt;/// &amp;lt;returns&amp;gt;True if non-transparent pixels overlap; false otherwise&amp;lt;/returns&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IntersectPixels(
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Matrix transformA, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; widthA, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; heightA, Color[] dataA,
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Matrix transformB, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; widthB, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; heightB, Color[] dataB)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// Calculate a matrix which transforms from A's local space into&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// world space and then into B's local space&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Matrix transformAToB = transformA * Matrix.Invert(transformB);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// When a point moves in A's local space, it moves in B's local space with a&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// fixed direction and distance proportional to the movement in A.&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// This algorithm steps through A one pixel at a time along A's X and Y axes&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// Calculate the analogous steps in B:&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Vector2 stepX = Vector2.TransformNormal(Vector2.UnitX, transformAToB);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Vector2 stepY = Vector2.TransformNormal(Vector2.UnitY, transformAToB);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// Calculate the top left corner of A in B's local space&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// This variable will be reused to keep track of the start of each row&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            Vector2 yPosInB = Vector2.Transform(Vector2.Zero, transformAToB);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// For each row of pixels in A&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; yA = 0; yA &amp;lt; heightA; yA++)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #008000"&gt;// Start at the beginning of the row&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                Vector2 posInB = yPosInB;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #008000"&gt;// For each pixel in this row&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; xA = 0; xA &amp;lt; widthA; xA++)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #008000"&gt;// Round to the nearest pixel&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; xB = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)Math.Round(posInB.X);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; yB = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)Math.Round(posInB.Y);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #008000"&gt;// If the pixel lies within the bounds of B&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (0 &amp;lt;= xB &amp;amp;&amp;amp; xB &amp;lt; widthB &amp;amp;&amp;amp;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        0 &amp;lt;= yB &amp;amp;&amp;amp; yB &amp;lt; heightB)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        &lt;span style="color: #008000"&gt;// Get the colors of the overlapping pixels&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Color colorA = dataA[xA + yA * widthA];
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        Color colorB = dataB[xB + yB * widthB];
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        &lt;span style="color: #008000"&gt;// If both pixels are not completely transparent,&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (colorA.A != 0 &amp;amp;&amp;amp; colorB.A != 0)
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        {
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                            &lt;span style="color: #008000"&gt;// then an intersection has been found&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    &lt;span style="color: #008000"&gt;// Move to the next pixel in the row&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                    posInB += stepX;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                &lt;span style="color: #008000"&gt;// Move to the next row&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;                yPosInB += stepY;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #008000"&gt;// No intersection found&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;        }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;    }
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;}
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1NP3uo8eroCpoKpgCHCM1Zt25cE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1NP3uo8eroCpoKpgCHCM1Zt25cE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1NP3uo8eroCpoKpgCHCM1Zt25cE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1NP3uo8eroCpoKpgCHCM1Zt25cE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/xna-rotated-perpixel-collision/</feedburner:origLink></item><item><title>Playing with Sprites and Collision Detection</title><link>http://feedproxy.google.com/~r/mykre/~3/rQ39gttZtLs/</link><pubDate>Mon, 04 Jan 2010 03:18:54 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/playing-with-sprites-and-collision-detection/</guid><dc:creator>Mykre</dc:creator><slash:comments>0</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;While on the XNA Game Camp I was playing with a simple 2d collision sample that did per pixel detection on translated sprites. Over this weekend and today I have picked the code back up and have started to play around with the internals to see if I can get it to run faster.&lt;/p&gt;  &lt;p&gt;So far it looks like I have it running well, but it still starts to slow down at about the 300 sprite mark. I think I still have some work to do with the code before I post what I have.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JRxeiTUPqeivInTu5tJCOasR8Ug/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JRxeiTUPqeivInTu5tJCOasR8Ug/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JRxeiTUPqeivInTu5tJCOasR8Ug/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JRxeiTUPqeivInTu5tJCOasR8Ug/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/playing-with-sprites-and-collision-detection/</feedburner:origLink></item><item><title>GraffitiCMS – Setting up Development Environment</title><link>http://feedproxy.google.com/~r/mykre/~3/dEPgaMCNYVQ/</link><pubDate>Tue, 29 Dec 2009 21:56:21 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/graffiticms-ndash-setting-up-development-environment/</guid><dc:creator>Mykre</dc:creator><slash:comments>0</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;Now that the GraffitiCMS Engine has gone Open Source, I now have the need to set up the development environment for the system. The first stage here is to download all that is needed and then get it running in the raw form from the latest version of the source code.&lt;/p&gt;  &lt;p&gt;Here are the steps that I went through to complete the task.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Downloaded and uncompressed that latest version of the source code from the &lt;a href="http://www.codeplex.com" target="_blank"&gt;Codeplex&lt;/a&gt; site. &lt;/li&gt;    &lt;li&gt;Downloaded the additional libraries from the &lt;a href="http://telligent.com/" target="_blank"&gt;telligent&lt;/a&gt; website as per the readme and notes on the front page of the Codeplex project site. &lt;/li&gt;    &lt;li&gt;Created a Directory just inside the first directory of the extracted source and then extracted the Telligent Assemblies to that directory. I called this Directory “Telligent Assemblies” &lt;/li&gt;    &lt;li&gt;Open the Visual Studio Project for the Graffiti Project &lt;/li&gt;    &lt;li&gt;Expand the Graffiti Core Project and then the References &lt;/li&gt;    &lt;li&gt;Add the references to the Telligent Assemblies that you have extracted, when done do the same for the Graffiti.Web Project. &lt;/li&gt;    &lt;li&gt;You should now be able to perform a build of each of the Projects &lt;/li&gt;    &lt;li&gt;In the Windows Explorer browse to the Graffiti.Web Project Directory and Delete the App_Data Directory &lt;/li&gt;    &lt;li&gt;In the Solution Explorer expand the Graffiti.Web Project and add a new ASP.Net Folder, select the App_Data Folder. &lt;/li&gt;    &lt;li&gt;Back in the Windows Explorer, copy the Graffiti.mdb file from the data directory and paste it into the App_Data directory inside the Graffiti.Web Project &lt;/li&gt;    &lt;li&gt;In the Solution Explorer right click on the App_Data Directory and select Add existing Item, select the Graffiti.mdb file &lt;/li&gt;    &lt;li&gt;In the Solution Explorer right click on the Graffiti.Web Project and set it as the Start up Project, you should see the project name is now highlighted or in Bold text. &lt;/li&gt;    &lt;li&gt;You should now be able to execute the application and start the development work. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;With that task now complete there are several things that I now wish to do to the raw system. Here is a small list.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Convert the Base code to run using SQL Express as this is my preferred method for development (My production system uses the full SQL Server Engine) &lt;/li&gt;    &lt;li&gt;As I will need some Test Data, run the scripts to add some test data to the site, the default install does not have this data. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Then the tasks grow….&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download my site and files to test the upgrade path &lt;/li&gt;    &lt;li&gt;Recompile all of my custom add-ons for the system to make sure that they still work, and if not work on upgrading them &lt;/li&gt;    &lt;li&gt;Start to work on the changes that I have had on hold while waiting for the system to have it’s new direction.&lt;/li&gt; &lt;/ol&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_Hs4S4ISXZ2eCUrnn7l-ibkop1M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Hs4S4ISXZ2eCUrnn7l-ibkop1M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_Hs4S4ISXZ2eCUrnn7l-ibkop1M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Hs4S4ISXZ2eCUrnn7l-ibkop1M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/graffiticms-ndash-setting-up-development-environment/</feedburner:origLink></item><item><title>GraffitiCMS Goes Open Source</title><link>http://feedproxy.google.com/~r/mykre/~3/F5knHkeoZrE/</link><pubDate>Sun, 27 Dec 2009 03:35:20 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/graffiticms-goes-open-source/</guid><dc:creator>Mykre</dc:creator><slash:comments>2</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;For a long while I have been using the GraffitiCMS Engine to run my Blog and my Website, now that the GraffitiCMS has finally been released to Open Source I think it is time that I started to look at upgrading the site and continuing to work on the engine.&lt;/p&gt;  &lt;p&gt;Here is the Direct link to the &lt;a href="http://www.codeplex.com" target="_blank"&gt;Codeplex&lt;/a&gt; site for the &lt;a href="http://graffiticms.codeplex.com/" target="_blank"&gt;GraffitiCMS&lt;/a&gt; Project. (&lt;a href="http://graffiticms.codeplex.com/" target="_blank"&gt;link&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;For those that are interested here is a collection of other projects for GraffitiCMS that are listed on Codeplex.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://chalkextensions.codeplex.com/" target="_blank"&gt;Graffiti CMS Chalk Extensions&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://graffitiextenders.codeplex.com/" target="_blank"&gt;Graffiti Extenders&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://graffiticalendar.codeplex.com/" target="_blank"&gt;Archive Calendar Widget&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://extendedrss.codeplex.com/" target="_blank"&gt;Extend RSS Widget&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://simpleimage.codeplex.com/" target="_blank"&gt;Simple Image Widget&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://graffitiextras.codeplex.com/" target="_blank"&gt;Graffiti Extras&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://extendedlinklist.codeplex.com/" target="_blank"&gt;Extended Link List&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://postsbymonthwidget.codeplex.com/" target="_blank"&gt;PostsByMonth Widget&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://postarchivelistings.codeplex.com/" target="_blank"&gt;PostArchiveListings Widget&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://dasblog301.codeplex.com/" target="_blank"&gt;DasBlog301 for Graffiti CMS&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4jZDM5glRJZfDjA6q1XZHFh_6Gs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4jZDM5glRJZfDjA6q1XZHFh_6Gs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4jZDM5glRJZfDjA6q1XZHFh_6Gs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4jZDM5glRJZfDjA6q1XZHFh_6Gs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/graffiticms-goes-open-source/</feedburner:origLink></item><item><title>Random Test Data for Applications</title><link>http://feedproxy.google.com/~r/mykre/~3/Lr-xTd4F-_A/</link><pubDate>Sun, 27 Dec 2009 02:39:38 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/random-test-data-for-applications/</guid><dc:creator>Mykre</dc:creator><slash:comments>1</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;I have been working on a couple of datasets over the last few weeks, as well as a couple of small LOB Applications for my own purposes. While developing these I have had to play with the data so that I have a quantity of data that will allow me to test the main functions.&lt;/p&gt;  &lt;p&gt;I know there are a couple of different options to create the data, but today I was told about &lt;a href="http://www.generatedata.com"&gt;www.generatedata.com&lt;/a&gt; and to be honest it does almost all that I need to create the test data.&lt;/p&gt;  &lt;p&gt;“Ever needed custom formatted sample / test data, like, &lt;i&gt;bad&lt;/i&gt;? Well, that's the idea of the Data Generator. It's a free, open source script written in JavaScript, PHP and MySQL that lets you quickly generate large volumes of custom data in a variety of formats for use in testing software, populating databases, and scoring with girls. “&lt;/p&gt;  &lt;p&gt;Features&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;(JS-enabled) browser-friendly. &lt;/li&gt;    &lt;li&gt;Many data types available: names, phone numbers, email addresses, cities, states, provinces, counties, dates, street addresses, number ranges, alphanumeric strings, lorem ipsum text and more. &lt;/li&gt;    &lt;li&gt;Option to generate data in XML, Excel, HTML, CSV or SQL. &lt;/li&gt;    &lt;li&gt;Country specific data (state / province / county) for Canada, US, Netherlands and UK. &lt;/li&gt;    &lt;li&gt;Does your laundry. &lt;/li&gt;    &lt;li&gt;Saves your data generation forms for later use (downloadable version &amp;amp; for donators only)&lt;/li&gt; &lt;/ul&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EBUbG3-Ss4yZezPQd1xz8xVIjtM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EBUbG3-Ss4yZezPQd1xz8xVIjtM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EBUbG3-Ss4yZezPQd1xz8xVIjtM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EBUbG3-Ss4yZezPQd1xz8xVIjtM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/random-test-data-for-applications/</feedburner:origLink></item><item><title>Blender Tutorials - BlenderCourse.com</title><link>http://feedproxy.google.com/~r/mykre/~3/UriWHSo_PnY/</link><pubDate>Sun, 27 Dec 2009 00:08:04 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/blender-tutorials-blendercourse-com/</guid><dc:creator>Mykre</dc:creator><slash:comments>0</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;&lt;a href="http://www.blendercourse.com/English.aspx" target="_blank"&gt;BlenderCourse.com&lt;/a&gt; has a good selection of &lt;a href="http://www.blender.org/" target="_blank"&gt;Blender&lt;/a&gt; tutorials for the beginner. All of the course material is in downloadable format and is easy to follow. The site also includes a small selection of free textures.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/BlenderTutorialsBlenderCourse.com_9CA7/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/BlenderTutorialsBlenderCourse.com_9CA7/image_thumb.png" width="116" height="109" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JHopq-CsXVA4i-3ox2-_yic35z0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JHopq-CsXVA4i-3ox2-_yic35z0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JHopq-CsXVA4i-3ox2-_yic35z0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JHopq-CsXVA4i-3ox2-_yic35z0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/blender-tutorials-blendercourse-com/</feedburner:origLink></item><item><title>Australian XNA Game Camp</title><link>http://feedproxy.google.com/~r/mykre/~3/IqtNlovZskY/</link><pubDate>Wed, 23 Dec 2009 21:16:16 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/australian-xna-game-camp/</guid><dc:creator>Mykre</dc:creator><slash:comments>1</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;Last week end I had the absolute pleasure of spending a couple of days with a large group made up of mainly University Students and a few others who all had the common goal of learning a little bit about XNA, the Imagine Cup and off course having some fun.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/16741_212150142919_563877919_2936925_8218437_n_4.jpg"&gt;&lt;img title="16741_212150142919_563877919_2936925_8218437_n" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="164" alt="16741_212150142919_563877919_2936925_8218437_n" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/16741_212150142919_563877919_2936925_8218437_n_thumb_1.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/17451_227442563720_20528438720_3203567_4917454_n_2.jpg"&gt;&lt;img title="17451_227442563720_20528438720_3203567_4917454_n" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="164" alt="17451_227442563720_20528438720_3203567_4917454_n" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/17451_227442563720_20528438720_3203567_4917454_n_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I just wanted to say thankyou to Microsoft (Andrew and Karo) for giving Luke and myself a chance to talk at the event and meet the group.&lt;/p&gt;  &lt;p&gt;During the event we took the guys through several introductory and some intermediate topics relating to XNA, some of these included looking at Avatars, Collision Detection, Audio, Particles and Game State. The good thing is that by the end of the event we had some time for the students to demonstrate some of the projects that they had been working on over the weekend. In the end we where shown about 10 games, with each of these showing promise and even a couple of them where almost in a complete state.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/50799193_2.jpg"&gt;&lt;img title="50799193" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="148" alt="50799193" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/50799193_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/50293659_2.jpg"&gt;&lt;img title="50293659" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="148" alt="50293659" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/50293659_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As this was the first XNA Game Camp to be held in Australia, I think that it was organised really well and was received by all those who attended in a positive manner. I am hoping this will not be the last, and once the Imagine Cup for this year is complete we can start to organise the next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/17451_227442578720_20528438720_3203569_6639970_n_2.jpg"&gt;&lt;img title="17451_227442578720_20528438720_3203569_6639970_n" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="164" alt="17451_227442578720_20528438720_3203569_6639970_n" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/17451_227442578720_20528438720_3203569_6639970_n_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/17451_227442673720_20528438720_3203581_2101117_n_2.jpg"&gt;&lt;img title="17451_227442673720_20528438720_3203581_2101117_n" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="164" alt="17451_227442673720_20528438720_3203581_2101117_n" src="http://www.virtualrealm.com.au/files/media/image/WindowsLiveWriter/AustralianXNAGameCamp_741F/17451_227442673720_20528438720_3203581_2101117_n_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Just to finish off, I would like to wish all the guys who are going to drop an entry into the Imagine Cup good luck and I hope you do well, but remember that there is also the Dream Build Play.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pjWCp5jQjyFlz9tTsdlXbna0uBI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pjWCp5jQjyFlz9tTsdlXbna0uBI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pjWCp5jQjyFlz9tTsdlXbna0uBI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pjWCp5jQjyFlz9tTsdlXbna0uBI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/australian-xna-game-camp/</feedburner:origLink></item><item><title>Turn your Webcam into a 3D Scanner</title><link>http://feedproxy.google.com/~r/mykre/~3/B6wtnBaX7Hs/</link><pubDate>Sat, 28 Nov 2009 20:29:27 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/turn-your-webcam-into-a-3d-scanner/</guid><dc:creator>Mykre</dc:creator><slash:comments>0</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;I came across this interesting article on &lt;a href="http://www.blendernation.com/" target="_blank"&gt;BlenderNation&lt;/a&gt; where there is information about a project that will allow you to construct a 3D Model from your Webcams video. The Video shows an example where they take a Model of a house and slowly turn it around in front of the Web Cam. In doing this the 3D Model gets slowly constructed. Having this type of tech would make it easier to take the step from your sample art straight into your &lt;a href="http://creators.xna.com/" target="_blank"&gt;XNA&lt;/a&gt; game.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:961b1194-0654-4199-bd7b-7d1832f46eb3" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/vEOmzjImsVc&amp;amp;hl=en"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/vEOmzjImsVc&amp;amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/div&gt;  &lt;blockquote&gt;   &lt;p&gt;Cambridge University Qi Pan is developing software that will reconstruct textured 3D models from webcam video. A Linux and later a Windows downloadable demo should be available in a couple of months. The results are already quite amazing – check out the video inside.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here is the link to the BlenderNation Article, As well as some Supporting Articles.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.blendernation.com/turn-your-webcam-into-a-3d-scanner/?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+Blendernation+%28BlenderNation%29" target="_blank"&gt;Source Article&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://mi.eng.cam.ac.uk/~qp202/my_papers/BMVC09/" target="_blank"&gt;ProFORMA&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.wired.com/gadgetlab/2009/11/amazing-software-turns-cheap-webcam-into-instant-3d-scanner/?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+wired%2Findex+%28Wired%3A+Index+3+%28Top+Stories+2%29%29" target="_blank"&gt;Wired&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://shapeways.com/blog/archives/332-Interview-with-Qi-Pan-about-his-Webcam-3D-scanner-proForma.html" target="_blank"&gt;Shapeways&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RWC3ROXXrN1uXei_w8z2vczhx-I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RWC3ROXXrN1uXei_w8z2vczhx-I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RWC3ROXXrN1uXei_w8z2vczhx-I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RWC3ROXXrN1uXei_w8z2vczhx-I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/turn-your-webcam-into-a-3d-scanner/</feedburner:origLink></item><item><title>Sgt Conker – Multi-threading your XNA</title><link>http://feedproxy.google.com/~r/mykre/~3/t-5Fs4S34EE/</link><pubDate>Fri, 27 Nov 2009 22:30:24 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/sgt-conker-ndash-multi-threading-your-xna/</guid><dc:creator>Mykre</dc:creator><slash:comments>0</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;&lt;a href="http://www.catalinzima.com/" target="_blank"&gt;Catalin Zima&lt;/a&gt; has posted a really good article on &lt;a href="http://www.sgtconker.com" target="_blank"&gt;Sgt Conker&lt;/a&gt; that will take you through the ins and outs of Multi-Threading you &lt;a href="http://creators.xna.com/" target="_blank"&gt;XNA&lt;/a&gt; Application.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;In this tutorial you will learn how to use multi-threading in your XNA games. The tutorial starts with a short introduction about multi-threading, the Xbox 360 architecture, and the advantages and disadvantages of using multi-threading for XNA games. This will be followed by a very brief look at the classes and primitives that we will use in the rest of the article. After this, the main part of this tutorial is focused on using multi-threading for the main game loop. You will learn how you can separate the code for drawing and updating you game and run the two tasks in parallel. There are other ways to use multi-threading in your games, but they will not be covered by this tutorial. As a closing word, we will draw some conclusions and look at future developments.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here is a link to the &lt;a href="http://www.sgtconker.com/2009/11/article-multi-threading-your-xna/" target="_blank"&gt;Complete Article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PHLoYkJO5YtjgNj4UPpWcwwWvCU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PHLoYkJO5YtjgNj4UPpWcwwWvCU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PHLoYkJO5YtjgNj4UPpWcwwWvCU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PHLoYkJO5YtjgNj4UPpWcwwWvCU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/sgt-conker-ndash-multi-threading-your-xna/</feedburner:origLink></item><item><title>First Steps with Softimage Mod Tool and XNA</title><link>http://feedproxy.google.com/~r/mykre/~3/I-tLUqUPalI/</link><pubDate>Fri, 27 Nov 2009 09:53:18 GMT</pubDate><guid isPermaLink="false">http://www.virtualrealm.com.au/blogs/first-steps-with-softimage-mod-tool-and-xna/</guid><dc:creator>Mykre</dc:creator><slash:comments>0</slash:comments><category domain="http://www.virtualrealm.com.au/blogs/">Blog</category><description>&lt;p&gt;For those who have chosen to use the &lt;a href="http://www.softimage.com/" target="_blank"&gt;Softimage&lt;/a&gt;&amp;#160;&lt;a href="http://www.softimage.com/products/modtool/" target="_blank"&gt;Mod Tool&lt;/a&gt; with &lt;a href="http://creators.xna.com/" target="_blank"&gt;XNA&lt;/a&gt;, here is a good Video that will take you through the basic process.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:133290b1-0689-4ed7-bbe5-1418aa054113" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/eRoEU2q1J_4&amp;amp;hl=en"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/eRoEU2q1J_4&amp;amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Mu7ecclWDwMLa_FoLANzKzgR7K4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Mu7ecclWDwMLa_FoLANzKzgR7K4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Mu7ecclWDwMLa_FoLANzKzgR7K4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Mu7ecclWDwMLa_FoLANzKzgR7K4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description><author>Virtual Realm &lt;graffiti@virtualrealm.com.au&gt;</author><feedburner:origLink>http://www.virtualrealm.com.au/blogs/first-steps-with-softimage-mod-tool-and-xna/</feedburner:origLink></item></channel></rss>
