<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>http://forums.xna.com/forums/32.aspx</link><description>Don't know where to post your question? Post it here!</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/26943.aspx</link><pubDate>Thu, 04 Oct 2007 12:10:07 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:26943</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/26943.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=26943</wfw:commentRss><description>&lt;P&gt;Glad to hear you got this working!&lt;/P&gt;
&lt;P&gt;And thanks for the great feedback: I'll make sure this gets to our doc guys.&lt;/P&gt;</description></item><item><title>Re: Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/26759.aspx</link><pubDate>Wed, 03 Oct 2007 06:52:35 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:26759</guid><dc:creator>Claus Topholt</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/26759.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=26759</wfw:commentRss><description>&lt;P&gt;Now I've (finally) completed a custom model class, using the Custom Model sample to lean on. I have a few observations I'd like to share:&lt;/P&gt;
&lt;P&gt;- How über cool! Now I can do anything I want with models, and the code doesn't feel ugly with things stuck in a Tag object.&lt;/P&gt;
&lt;P&gt;- Looking back on it, I would recommend anyone with C# skills writing their own custom model class at least once instead of just using Model, because it makes a lot of pieces of the XNA puzzle fall into place - even if Model is the hammer you need.&lt;/P&gt;
&lt;P&gt;- The documentation is &lt;STRONG&gt;far from complete on this and related subjects &lt;/STRONG&gt;and it would have taken me weeks to figure out all of the logic that goes on behind the scenes using Reflector + trial-and-error, if it hadn't been for the Custom Model sample. Even with that, a lot of questions needed to be answered.&amp;nbsp;For instance, the difference between the data types used in a ContentProcessor and the GPU-ready data types used in a finished model class isn't really something that the documentation explains. Or how the Processor -&amp;gt; ContentWriter -&amp;gt; CustomModel"Content" side of the equation works with the ContentReader -&amp;gt; CustomModel -&amp;gt; Game side.&lt;/P&gt;
&lt;P&gt;- I understand why you, Shawn, think that creating a custom model class is easy. It's&amp;nbsp;because you know the intricacies of the XNA framework and have been through it all before :-)&amp;nbsp;But the documentation isn't thorough&amp;nbsp;enough for us outside the XNA team. Maybe it's because the XNA environment is only a year old, but really this was also a problem with the MDX documentation. Example code snippets on "deep subjects" and&amp;nbsp;some more thoroughly explained&amp;nbsp;diagrams would go a long way.&lt;/P&gt;
&lt;P&gt;- Maybe someone has asked this before and there is a good explanation to the current situation, but I'll stick my head out anyways: Why not create some sort of wiki on this site, like what's being used with great success on &lt;A href="http://www.ogre3d.org"&gt;www.ogre3d.org&lt;/A&gt; ?&lt;/P&gt;
&lt;P&gt;Just my $0.02 :-)&lt;/P&gt;</description></item><item><title>Re: Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/25756.aspx</link><pubDate>Mon, 24 Sep 2007 02:10:17 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25756</guid><dc:creator>Claus Topholt</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25756.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=25756</wfw:commentRss><description>&lt;P&gt;I didn't realize that the index and vertex buffer data was stored in GPU memory, I sort of thought that XNA made a copy for that internally - cool! It makes sense :-)&lt;/P&gt;
&lt;P&gt;I think I should get started on some more content pipeline experimenting and make that custom model class now.&lt;/P&gt;
&lt;P&gt;Thanks for the replies!&lt;/P&gt;</description></item><item><title>Re: Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/25739.aspx</link><pubDate>Sun, 23 Sep 2007 18:49:20 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25739</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25739.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=25739</wfw:commentRss><description>There is no way other than duplicating the data. This isn't actually a bad thing, though! There are some extremely good reasons why having two copies makes sense:&lt;br&gt;&lt;ul&gt;&lt;li&gt;The CPU and GPU are not the same thing! To render, the data must live on the GPU, but to test for collisions, it must live on the CPU. This means you fundamentally need two copies, one in video memory accessible to the GPU, and another on the manged heap accessible to your C# CPU code.&lt;/li&gt;&lt;li&gt;The CPU and GPU do not work well with the same kind of input data. For efficient rendering, the GPU wants an indexed triangle list, sorted for efficient vertex cache reuse. But for efficient collision detection, the CPU certainly doesn't want indexed geometry data! Instead, you will need some kind of hierarchical system like an octree to make your code run efficiently. The only way to make both rendering and collision detection fast is to store two copies of the data, each in a structure that is optimized for a different purpose. Every 3D game does this.&lt;/li&gt;&lt;li&gt;Most games do not want to render the exact same geometry that they collide against! To make things look good, they often want lots of fine detail triangles that would just cause unwanted bouncing around if they were tested as part of the collision. Also, you may want invisible triangles to close small gaps so the collision detection cannot fall through a space even though visually you may be able to see through it. Finally, most games use lower detail versions of their meshes for collision, because that doesn't need such curvy outlines as you might want for rendering.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;</description></item><item><title>Re: Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/25734.aspx</link><pubDate>Sun, 23 Sep 2007 18:29:00 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25734</guid><dc:creator>Kyle W</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25734.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=25734</wfw:commentRss><description>I believe the reason you need a separate copy of the vertex data for your collision detection algorithms is because the actual vertex buffers of the model are stored on the GPU in video RAM instead of system RAM, and trying to read the vertices directly from the GPU would incur a serious performance hit.</description></item><item><title>Re: Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/25700.aspx</link><pubDate>Sun, 23 Sep 2007 12:47:35 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25700</guid><dc:creator>Lord Ikon</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25700.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=25700</wfw:commentRss><description>&lt;FONT size=4&gt;&lt;B&gt;
&lt;DIV style="BACKGROUND-COLOR:white;"&gt;
&lt;DIV style="PADDING-RIGHT:2px;OVERFLOW-Y:hidden;PADDING-LEFT:8px;PADDING-BOTTOM:2px;MARGIN:0px;OVERFLOW:scroll;WIDTH:505px;PADDING-TOP:2px;BACKGROUND-COLOR:white;"&gt;&lt;PRE&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;foreach&lt;/SPAN&gt; (ModelMesh mesh &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;in&lt;/SPAN&gt; this.Model.Meshes)&lt;BR&gt;{&lt;BR&gt;       .... &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; mesh.IndexBuffer;&lt;BR&gt;       .... &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; mesh.VertexBuffer;    &lt;BR&gt;}    &lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;You can cycle through the meshes in any model, and access them&amp;nbsp;per mesh.&lt;/P&gt;
&lt;P&gt;Edit: I guess I should've read your whole post :op. I don't think there is any way other than the buffers or setting up a custom content reader. It is one of the biggest hurdles I've found with XNA.....vertices and physics/collisions.&lt;/P&gt;</description></item><item><title>Model - access to vertex and index buffer data</title><link>http://forums.xna.com/forums/thread/25698.aspx</link><pubDate>Sun, 23 Sep 2007 12:22:58 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25698</guid><dc:creator>Claus Topholt</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25698.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=25698</wfw:commentRss><description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;Is there a way to access the vertex and index buffer data on a Model other than to either use a custom content pipeline processor to extract the data and store it in a Tag object for later access or to copy it out using ModelMesh.Index/VertexBuffer.GetData() ? It seems a waste of space that eg. triangle manipulation (picking, collision) requires all this extra data when it's already present in the Model?&lt;/P&gt;
&lt;P&gt;I know, the Model class is just an example of what you can do if you roll your own model class. I get the Model = Hammer analogy. I'm just wondering :-)&lt;/P&gt;</description></item></channel></rss>