<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: XNA Collision Detection for 3D models</title>
	<atom:link href="http://sharky.bluecog.co.nz/?feed=rss2&#038;page_id=113" rel="self" type="application/rss+xml" />
	<link>http://sharky.bluecog.co.nz</link>
	<description>Home of the Air Legends game for Xbox 360 and Windows, Bionic Shark Studios, XNA game development &#38; other madness</description>
	<lastBuildDate>Sun, 22 Apr 2012 22:22:43 +0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: M3hdi</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-142963</link>
		<dc:creator>M3hdi</dc:creator>
		<pubDate>Tue, 27 Apr 2010 12:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-142963</guid>
		<description>hey Sharky, that was it , the solution you gave me was just perfect. can&#039;t thank you enough for the solution and the quick response, you have made my day sir.
thanks again, and keep up the good work !!

M3hdi</description>
		<content:encoded><![CDATA[<p>hey Sharky, that was it , the solution you gave me was just perfect. can&#8217;t thank you enough for the solution and the quick response, you have made my day sir.<br />
thanks again, and keep up the good work !!</p>
<p>M3hdi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharky</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-142958</link>
		<dc:creator>Sharky</dc:creator>
		<pubDate>Tue, 27 Apr 2010 11:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-142958</guid>
		<description>&lt;p&gt;Hey M3hdi.&lt;/p&gt;
&lt;p&gt;Your english is great - I really wouldnt have known.&lt;/p&gt;
&lt;p&gt;I think I know what the problem might be.  The clue was that you said your IDE is set to french.  I remember Air Legends failing Peer Review once because when played on Xboxes in the France &amp; Italy regions it did weird things. Giant Models to be specific.
It turned out to be a problem with similar Parse/Convert code. If I remember correctly France &amp; Italy use a comma character (&quot;,&quot;) to delimit the fractional part of a number.  In most english language locales we use a period, or decimal point character (&quot;.&quot;).&lt;/p&gt;
&lt;p&gt;The solution was to add an extra parameter to &lt;strong&gt;all&lt;/strong&gt; the Parse &amp; Convert statements that dealt with numbers.&lt;/p&gt;
&lt;p&gt;for instance, I changed....&lt;/p&gt;
&lt;code&gt;float x0 = float.Parse(subdivisionNode.Attributes[&quot;x&quot;].Value);&lt;/code&gt;
&lt;p&gt;to...&lt;/p&gt;
&lt;code&gt;float x0 = float.Parse(subdivisionNode.Attributes[&quot;x&quot;].Value, CultureInfo.InvariantCulture.NumberFormat);&lt;/code&gt;
&lt;p&gt;(CultureInfo can be found in System.Globalization)&lt;/p&gt;
&lt;p&gt;I hope this solves it for you. Let me know how you go.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Sharky&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Hey M3hdi.</p>
<p>Your english is great &#8211; I really wouldnt have known.</p>
<p>I think I know what the problem might be.  The clue was that you said your IDE is set to french.  I remember Air Legends failing Peer Review once because when played on Xboxes in the France &#038; Italy regions it did weird things. Giant Models to be specific.<br />
It turned out to be a problem with similar Parse/Convert code. If I remember correctly France &#038; Italy use a comma character (&#8221;,&#8221;) to delimit the fractional part of a number.  In most english language locales we use a period, or decimal point character (&#8221;.&#8221;).</p>
<p>The solution was to add an extra parameter to <strong>all</strong> the Parse &#038; Convert statements that dealt with numbers.</p>
<p>for instance, I changed&#8230;.</p>
<p><code>float x0 = float.Parse(subdivisionNode.Attributes["x"].Value);</code></p>
<p>to&#8230;</p>
<p><code>float x0 = float.Parse(subdivisionNode.Attributes["x"].Value, CultureInfo.InvariantCulture.NumberFormat);</code></p>
<p>(CultureInfo can be found in System.Globalization)</p>
<p>I hope this solves it for you. Let me know how you go.</p>
<p>Cheers,</p>
<p>Sharky</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M3hdi</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-142954</link>
		<dc:creator>M3hdi</dc:creator>
		<pubDate>Tue, 27 Apr 2010 10:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-142954</guid>
		<description>Hi guys !!
this might be a dumb question (i&#039;m an XNA novice and i&#039;m trying to set up my first xna game as a project for my c++ class ) any way, i&#039;m having some issues concerning the building of the project you provided here :http://sharky.bluecog.co.nz/uploads/code/Sharky.3DCollisionDetection.Tutorial_v1.3.0.0.zip
whenever i try to run the project i get an exception in the MeshInfo.Load() method when it reaches this particular line:

 float x0 = float.Parse(subdivisionNode.Attributes[&quot;x&quot;].Value);

it says that &quot;the input string format is incorrect&quot; (i tried my best to translate the error text cause i&#039;m from france and the interface language of my IDE is set to french :p )

i&#039;ve tried to modify  the xml file, changed its location and its path, and several other code modification but without success.
so please sharky, can you help me fix this problem ?

Ps : sorry for my lame english, my command of it still not perfect yet :)</description>
		<content:encoded><![CDATA[<p>Hi guys !!<br />
this might be a dumb question (i&#8217;m an XNA novice and i&#8217;m trying to set up my first xna game as a project for my c++ class ) any way, i&#8217;m having some issues concerning the building of the project you provided here :http://sharky.bluecog.co.nz/uploads/code/Sharky.3DCollisionDetection.Tutorial_v1.3.0.0.zip<br />
whenever i try to run the project i get an exception in the MeshInfo.Load() method when it reaches this particular line:</p>
<p> float x0 = float.Parse(subdivisionNode.Attributes["x"].Value);</p>
<p>it says that &#8220;the input string format is incorrect&#8221; (i tried my best to translate the error text cause i&#8217;m from france and the interface language of my IDE is set to french :p )</p>
<p>i&#8217;ve tried to modify  the xml file, changed its location and its path, and several other code modification but without success.<br />
so please sharky, can you help me fix this problem ?</p>
<p>Ps : sorry for my lame english, my command of it still not perfect yet <img src='http://sharky.bluecog.co.nz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharky</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-130181</link>
		<dc:creator>Sharky</dc:creator>
		<pubDate>Wed, 07 Oct 2009 08:48:02 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-130181</guid>
		<description>Hi WiseOne.

I think you might be getting confused between your compiled output files and the actual source files.

If you&#039;re seeing .XNB files you must be looking at the compiled output, not the source Content.

When you compile Game Studio takes your source Content like your models (.FBX, .x, etc....), and textures (.jpg, .bmp, .tga, .dds, etc....) and puts them in a propriatory .XNB format along with your compiled application.

(I&#039;m pretty sure you can&#039;t take an .XNB file and put it in another games source.)

You must have already copied the p1_wedge.FBX model from the Microsoft sample into the viewer source Content\Meshes. This is the one you&#039;d edit as I described above. NOT, the compiled XNB file under \bin\x86\Debug\Content\Meshes.</description>
		<content:encoded><![CDATA[<p>Hi WiseOne.</p>
<p>I think you might be getting confused between your compiled output files and the actual source files.</p>
<p>If you&#8217;re seeing .XNB files you must be looking at the compiled output, not the source Content.</p>
<p>When you compile Game Studio takes your source Content like your models (.FBX, .x, etc&#8230;.), and textures (.jpg, .bmp, .tga, .dds, etc&#8230;.) and puts them in a propriatory .XNB format along with your compiled application.</p>
<p>(I&#8217;m pretty sure you can&#8217;t take an .XNB file and put it in another games source.)</p>
<p>You must have already copied the p1_wedge.FBX model from the Microsoft sample into the viewer source Content\Meshes. This is the one you&#8217;d edit as I described above. NOT, the compiled XNB file under \bin\x86\Debug\Content\Meshes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WiseOne</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-130161</link>
		<dc:creator>WiseOne</dc:creator>
		<pubDate>Wed, 07 Oct 2009 00:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-130161</guid>
		<description>ok well i never really figured out how to get it to work (although i did eventually get at least the spheres visible!) so i am just using your .xml for now..

thanks for your help though, even your quick version is a lot more effective than the singular sphere i was using before</description>
		<content:encoded><![CDATA[<p>ok well i never really figured out how to get it to work (although i did eventually get at least the spheres visible!) so i am just using your .xml for now..</p>
<p>thanks for your help though, even your quick version is a lot more effective than the singular sphere i was using before</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WiseOne</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-130158</link>
		<dc:creator>WiseOne</dc:creator>
		<pubDate>Tue, 06 Oct 2009 23:52:21 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-130158</guid>
		<description>Thanks a lot for the help...i understood most of what you said, and i did place the files thae way you had stated...however, i cant find any .FBX files..they are all .XNB(both models and textures)...i will try to copy your fbx and see what happens.

for now i am going to use your .xml and run with it to see how it goes.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for the help&#8230;i understood most of what you said, and i did place the files thae way you had stated&#8230;however, i cant find any .FBX files..they are all .XNB(both models and textures)&#8230;i will try to copy your fbx and see what happens.</p>
<p>for now i am going to use your .xml and run with it to see how it goes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharky</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-130120</link>
		<dc:creator>Sharky</dc:creator>
		<pubDate>Tue, 06 Oct 2009 07:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-130120</guid>
		<description>Hi WiseOne.  I&#039;m not sure how this reply will format in the blog but here goes...

So my viewer code makes a few assumptions:

I&#039;ll get onto the spheres later, but...

Assumption 1:
It loads a Texture file independent of any Texture files referenced inside the FBX model. Meaning, I load my texture in code, rather than rely on XNA loading it based on the content of the FBX model. (these would be loaded automatically by XNA as part of the Model load).
However, I like to keep my choice of texture separate from the model for flexibility in my games. i.e. I might want player selectable skins for a given model.

Now I see the RelativeFilename in the FBX file just happens to be correct for where you&#039;ll have placed the wedge_p1_diff_v1.tga file in the viewer source.  (Otherwise you&#039;d get an error compiling)

Assumption 2:
My viewer code assumes the texture file loaded will always match the model name, so besides changing that behaviour in the code you&#039;d want to rename the wedge_p1_diff_v1.tga file to p1_wedge.tga.

Here&#039;s are the steps I did to get it working in my viewer code.

- create a p1_wedge.xml file into the MeshInfo folder (copying one of the others).
- add the p1_wedge.fbx file to the Content\Meshes
- add the wedge_p1_diff_v1.tga texture into the Content\Textures
- BUT, then rename it to p1_wedge.tga (to match the model name).

Renaming it however will make the Model not compile because of the texture references inside the FBX file, so I comment those out as follows:

- Fortunately the Microsoft&#039;s FBX model has been exported in ASCII format so you can open the FBX file and search for any &quot;Filename:&quot; &amp; &quot;RelativeFilename:&quot; bits.  (There might be several)

- comment them out by putting a &quot;;&quot; at the beginning of the lines.

e.g.
 ;Filename: &quot;C:/Documents and Settings/a-mdudl/My Documents/maya/projects/default//textures/spacewars/tga/renamed/wedge_p1_diff_v1.tga&quot;
 ;RelativeFilename: &quot;..\textures\wedge_p1_diff_v1.tga&quot;

Now the model should render, with the texture.

Now to fix the BoundingSpheres edit the p1_wedge.xml file as follows.

- there needs to be a &quot;MeshPart&quot; element in the Xml file for each mesh you find in the FBX model and the id is used to find the right one, so these need to be named correctly.

To get the correct names of these MeshPart&#039;s search the FBX file for &quot;Model::&quot;

e.g. finds lines something like this...

    Model: &quot;Model::p1_wedge_geo1&quot;, &quot;Mesh&quot; {

so you&#039;d give your MeshPart id=&quot;p1_wedge_geo1&quot;

In that FBX file I can only see one &quot;Model::&quot; that seems to be some kind of Mesh. The others seem to be some kind of &quot;Camera&quot; type. (I&#039;m not familiar with the FBX format at all. Just a guess)

Here&#039;s my quick hack at an arrangement of spheres...
The blog wouldn&#039;t let me post the &lt;a href=&quot;http://sharky.bluecog.co.nz/uploads/code/p1_wedge.xml&quot; rel=&quot;nofollow&quot;&gt;p1_wedge.xml&lt;/a&gt; here as a comment, so download it instead from &lt;a href=&quot;http://sharky.bluecog.co.nz/uploads/code/p1_wedge.xml&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;

Like I said, I don&#039;t really know the FBX format at all, but it&#039;s interesting that for Microsoft&#039;s model seems to have 3 MeshParts if you break point in the DrawModel() method. Each with the same Name. Not sure why. Perhaps something to do with different Materials defined also in the FBX file?

Hope that works for you.
All that stuff about the textures is really for my viewer logic.  In your game you can do whatever you want, but the BoundingSpheres is what you&#039;re really after right?</description>
		<content:encoded><![CDATA[<p>Hi WiseOne.  I&#8217;m not sure how this reply will format in the blog but here goes&#8230;</p>
<p>So my viewer code makes a few assumptions:</p>
<p>I&#8217;ll get onto the spheres later, but&#8230;</p>
<p>Assumption 1:<br />
It loads a Texture file independent of any Texture files referenced inside the FBX model. Meaning, I load my texture in code, rather than rely on XNA loading it based on the content of the FBX model. (these would be loaded automatically by XNA as part of the Model load).<br />
However, I like to keep my choice of texture separate from the model for flexibility in my games. i.e. I might want player selectable skins for a given model.</p>
<p>Now I see the RelativeFilename in the FBX file just happens to be correct for where you&#8217;ll have placed the wedge_p1_diff_v1.tga file in the viewer source.  (Otherwise you&#8217;d get an error compiling)</p>
<p>Assumption 2:<br />
My viewer code assumes the texture file loaded will always match the model name, so besides changing that behaviour in the code you&#8217;d want to rename the wedge_p1_diff_v1.tga file to p1_wedge.tga.</p>
<p>Here&#8217;s are the steps I did to get it working in my viewer code.</p>
<p>- create a p1_wedge.xml file into the MeshInfo folder (copying one of the others).<br />
- add the p1_wedge.fbx file to the Content\Meshes<br />
- add the wedge_p1_diff_v1.tga texture into the Content\Textures<br />
- BUT, then rename it to p1_wedge.tga (to match the model name).</p>
<p>Renaming it however will make the Model not compile because of the texture references inside the FBX file, so I comment those out as follows:</p>
<p>- Fortunately the Microsoft&#8217;s FBX model has been exported in ASCII format so you can open the FBX file and search for any &#8220;Filename:&#8221; &#038; &#8220;RelativeFilename:&#8221; bits.  (There might be several)</p>
<p>- comment them out by putting a &#8220;;&#8221; at the beginning of the lines.</p>
<p>e.g.<br />
 ;Filename: &#8220;C:/Documents and Settings/a-mdudl/My Documents/maya/projects/default//textures/spacewars/tga/renamed/wedge_p1_diff_v1.tga&#8221;<br />
 ;RelativeFilename: &#8220;..\textures\wedge_p1_diff_v1.tga&#8221;</p>
<p>Now the model should render, with the texture.</p>
<p>Now to fix the BoundingSpheres edit the p1_wedge.xml file as follows.</p>
<p>- there needs to be a &#8220;MeshPart&#8221; element in the Xml file for each mesh you find in the FBX model and the id is used to find the right one, so these need to be named correctly.</p>
<p>To get the correct names of these MeshPart&#8217;s search the FBX file for &#8220;Model::&#8221;</p>
<p>e.g. finds lines something like this&#8230;</p>
<p>    Model: &#8220;Model::p1_wedge_geo1&#8243;, &#8220;Mesh&#8221; {</p>
<p>so you&#8217;d give your MeshPart id=&#8221;p1_wedge_geo1&#8243;</p>
<p>In that FBX file I can only see one &#8220;Model::&#8221; that seems to be some kind of Mesh. The others seem to be some kind of &#8220;Camera&#8221; type. (I&#8217;m not familiar with the FBX format at all. Just a guess)</p>
<p>Here&#8217;s my quick hack at an arrangement of spheres&#8230;<br />
The blog wouldn&#8217;t let me post the <a href="http://sharky.bluecog.co.nz/uploads/code/p1_wedge.xml" rel="nofollow">p1_wedge.xml</a> here as a comment, so download it instead from <a href="http://sharky.bluecog.co.nz/uploads/code/p1_wedge.xml" rel="nofollow">here</a></p>
<p>Like I said, I don&#8217;t really know the FBX format at all, but it&#8217;s interesting that for Microsoft&#8217;s model seems to have 3 MeshParts if you break point in the DrawModel() method. Each with the same Name. Not sure why. Perhaps something to do with different Materials defined also in the FBX file?</p>
<p>Hope that works for you.<br />
All that stuff about the textures is really for my viewer logic.  In your game you can do whatever you want, but the BoundingSpheres is what you&#8217;re really after right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WiseOne</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-130113</link>
		<dc:creator>WiseOne</dc:creator>
		<pubDate>Tue, 06 Oct 2009 05:45:59 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-130113</guid>
		<description>Hey Sharky...i had set up a simple game using the ship model provided in the XNA Tutorial here http://msdn.microsoft.com/en-us/library/bb203897.aspx, and was having trouble

i tried copying my files into the proper place, and because im inexperienced with XMLs, i just copied yours and renamed it. 

When i ran the program, i saw my ship, but no bounding spheres anywhere!

i tried commenting out the mesh.draw line in the model drawing code to see if my ship was covering up the boundingspheres, but they simply werent there. im not sure what i did wrong...

can anyone help me out? im looking to keep this ship model because it looks cool and i dont want to rework my game.</description>
		<content:encoded><![CDATA[<p>Hey Sharky&#8230;i had set up a simple game using the ship model provided in the XNA Tutorial here <a href="http://msdn.microsoft.com/en-us/library/bb203897.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb203897.aspx</a>, and was having trouble</p>
<p>i tried copying my files into the proper place, and because im inexperienced with XMLs, i just copied yours and renamed it. </p>
<p>When i ran the program, i saw my ship, but no bounding spheres anywhere!</p>
<p>i tried commenting out the mesh.draw line in the model drawing code to see if my ship was covering up the boundingspheres, but they simply werent there. im not sure what i did wrong&#8230;</p>
<p>can anyone help me out? im looking to keep this ship model because it looks cool and i dont want to rework my game.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sharky</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-114783</link>
		<dc:creator>Sharky</dc:creator>
		<pubDate>Fri, 17 Apr 2009 00:12:58 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-114783</guid>
		<description>Hi Stan.

I&#039;m not sure the exact problem, but you&#039;ve prompted me to finally update the sample to work with XNA v3.0.  Something I&#039;ve had mostly done, but unreleased for a while.

The code in this version will be quite out of synch with the tutorial, but the principal is the same.

Take another look at this page, as I have appended an update and link to the new source.</description>
		<content:encoded><![CDATA[<p>Hi Stan.</p>
<p>I&#8217;m not sure the exact problem, but you&#8217;ve prompted me to finally update the sample to work with XNA v3.0.  Something I&#8217;ve had mostly done, but unreleased for a while.</p>
<p>The code in this version will be quite out of synch with the tutorial, but the principal is the same.</p>
<p>Take another look at this page, as I have appended an update and link to the new source.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stan</title>
		<link>http://sharky.bluecog.co.nz/?page_id=113&#038;cpage=1#comment-114777</link>
		<dc:creator>Stan</dc:creator>
		<pubDate>Thu, 16 Apr 2009 23:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://sharky.bluecog.co.nz/?page_id=113#comment-114777</guid>
		<description>I have problem getting the code loaded on Visual Studio C# 2005 express edition.
I installed XNA 1.0, XNA 2.0, XNA 3.0 and still when i loaded, i got this error that says the project installation is not supported.

Any idea please?</description>
		<content:encoded><![CDATA[<p>I have problem getting the code loaded on Visual Studio C# 2005 express edition.<br />
I installed XNA 1.0, XNA 2.0, XNA 3.0 and still when i loaded, i got this error that says the project installation is not supported.</p>
<p>Any idea please?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
