<?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: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/18290.aspx</link><pubDate>Fri, 27 Jul 2007 23:33:11 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:18290</guid><dc:creator>Bapa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/18290.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=18290</wfw:commentRss><description>&lt;P&gt;Hehe, well, in the DirectX (C++) API, in the D3DX library, there is actually a function called "D3DXCreateTeapot" or, D3DXCreateSphere".&lt;/P&gt;
&lt;P&gt;All you have to do is create a mesh, use that function with a couple parameters, and tell it to draw a subset.&lt;/P&gt;
&lt;P&gt;That's prolly no help, but oh well :P&lt;/P&gt;
&lt;P&gt;I've also made my own algorithms to make cubes and pyramids fer me as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/18092.aspx</link><pubDate>Thu, 26 Jul 2007 02:18:56 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:18092</guid><dc:creator>WakeZero</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/18092.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=18092</wfw:commentRss><description>Thanks dteviot, with the sphere object I am able to render and texture a sphere. That's exactly what I wanted =)&lt;br&gt;&lt;br&gt;Thanks cannontrodder for all the pointers, bottom-line is that I just suck at Blender. I'll keep an eye out for your blog though ;-)&lt;br&gt;&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/18086.aspx</link><pubDate>Thu, 26 Jul 2007 01:13:37 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:18086</guid><dc:creator>dteviot</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/18086.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=18086</wfw:commentRss><description>Try &lt;a href="http://svn.projectxenocide.com/xenocide/xna/trunk/Xenocide/Source/UI/Scenes/Geoscape"&gt;here&lt;/a&gt;: &lt;br&gt;The SphereMesh class generates a spherical mesh.&lt;br&gt;The EarthGloble class wraps a texture onto it.&lt;br&gt;enjoy.&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/18062.aspx</link><pubDate>Wed, 25 Jul 2007 19:01:05 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:18062</guid><dc:creator>bowyerte</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/18062.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=18062</wfw:commentRss><description>Blender's .X exporter has many faults, but it does export Texture coordinates. However, in your model there does not seem to be any. My guess is that you either used procedural texture or texture mapping in the material setting. This does not do anything once the model is exported :-).&lt;br&gt;&lt;br&gt;You have to edit the UV (texture coordinates) map to properly texture your sphere. My advice is that you follow this tutorial : &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics"&gt;http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics&lt;/a&gt;&lt;br&gt;to learn more about how it works (plus it seems they're doing exactly what you want to do).&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/17991.aspx</link><pubDate>Wed, 25 Jul 2007 04:11:47 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:17991</guid><dc:creator>cannontrodder</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/17991.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=17991</wfw:commentRss><description>It's not exporting any texture coordinates. I was kinda hoping it would, perhaps anyone else has some ideas as I haven't had the chance to really play with Blender exporting yet.&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/17979.aspx</link><pubDate>Wed, 25 Jul 2007 00:09:17 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:17979</guid><dc:creator>WakeZero</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/17979.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=17979</wfw:commentRss><description>Well, I can't even get blender to texture the sphere correctly... I do however get some colors in a wierd funky pattern though. Help!&lt;br&gt;&lt;br&gt;Here is my blender file:&lt;br&gt;&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/earth.blend"&gt;http://www.wakezero.com/csharp/earth.blend&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/earthmap.jpg"&gt;http://www.wakezero.com/csharp/earthmap.jpg&lt;/a&gt;&lt;br&gt;&lt;br&gt;If you put the blender file and the earthmap.jpg in the same place, and then render the file it appears to be working... then I export it as a directx file and I lose it. Here's the directx file:&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/earth.x"&gt;&lt;br&gt;http://www.wakezero.com/csharp/earth.x&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/17945.aspx</link><pubDate>Tue, 24 Jul 2007 17:42:19 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:17945</guid><dc:creator>cannontrodder</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/17945.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=17945</wfw:commentRss><description>You should be able to change the texture at run time by changing the texture parameter you pass to the shader providing it is the same size. May even work if it is just the same proportions/aspect ratio.&lt;br&gt;&lt;br&gt;Just to clarify my point, I am suggesting Blender as it will export the models with texture coordinates. In other words, for each vertex on the model, it will provide a coordinate for the texture and effectively *pin* that texture coordinate to that vertex on the sphere. The shader should interpolate the rest resulting in a map stretched properly over the sphere. The texture coordinates are hopefully set in the model file when exported so you should be able to replace the texture with a map of Mars if you wished.&lt;br&gt;&lt;br&gt;I'll try to get that sphere generation code up tomorrow. In summary though, I create an array of vertices and and array of indices to link those vertices together. I then generate the normals for each vertex so the lighting works properly.&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/17904.aspx</link><pubDate>Tue, 24 Jul 2007 10:27:57 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:17904</guid><dc:creator>WakeZero</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/17904.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=17904</wfw:commentRss><description>That would be great. As for the blender texturing, I will give it a shot... although the whole point of texturing at runtime was so I could change the textures freely.&lt;br&gt;</description></item><item><title>Re: Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/17888.aspx</link><pubDate>Tue, 24 Jul 2007 03:58:53 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:17888</guid><dc:creator>cannontrodder</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/17888.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=17888</wfw:commentRss><description>I could be wrong but I think the issue is that you need to tell XNA which points on your model correspond to points in the texture so it knows *how* to texture it. In this &lt;a href="http://efron-xna.blogspot.com/2006/11/rendering-textured-cube.html"&gt;example&lt;/a&gt;, Efron does pretty much exactly what you are doing (in terms of assigning the texture) but he isn't importing a model to do it. Instead he creates the model vertex by vertex setting the normals and, crucially, setting the texture coordinates too. Now this could be solved by you wrapping the texture to the sphere in blender and exporting the model again. I know blender internally defines the texture coords and hopefully during the export, these are preserved.&lt;br&gt;&lt;br&gt;This is one reason why I created my own Model class so I could dynamically create vertices at runtime. That way I could create my own sphere and know for 100% certainty whether the normals and texture coords were set to what they should be.&lt;br&gt;&lt;br&gt;As for creating a sphere, I have already done some code to accomplish this and I'll put something over the next day or two on my &lt;a href="http://www.cannontrodder.net/"&gt;blog&lt;/a&gt; that you can use. I just need to strip it down a bit so the concept is not lost somewhere in my growing engine code.&lt;br&gt;</description></item><item><title>Adding texture to a sphere?</title><link>http://forums.xna.com/forums/thread/17882.aspx</link><pubDate>Tue, 24 Jul 2007 01:58:05 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:17882</guid><dc:creator>WakeZero</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/17882.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=17882</wfw:commentRss><description>Ok, I have searched tirelessly the past few days on how to display and texture a sphere. After realizing there is no easy way to create a sphere primitive (which is very sad/surprising) I caved and fiddled around with blender until I made one. You can find it here:&lt;br&gt;&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/sphere.x"&gt;http://www.wakezero.com/csharp/sphere.x&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/sphere.xnb"&gt;http://www.wakezero.com/csharp/sphere.xnb&lt;/a&gt;&lt;br&gt;&lt;br&gt;Rendering the sphere itself was easy, and I have a first person camera that I can use to move around it which is Pretty cool... but I can't for the life of me get a texture on the darn thing =(&lt;br&gt;&lt;br&gt;Here is the texture I am trying to apply:&lt;br&gt;&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/earthmap.jpg"&gt;http://www.wakezero.com/csharp/earthmap.jpg&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.wakezero.com/csharp/earthmap.xnb"&gt;http://www.wakezero.com/csharp/earthmap.xnb&lt;/a&gt;&lt;br&gt;&lt;br&gt;...and below is the code to load and draw the model. Any help to get this to work would be much appreciated =/&lt;br&gt;&lt;br&gt;&lt;div style="background-color:White;"&gt;&lt;div style="margin:0px;padding:2px 2px 2px 8px;background-color:White;overflow-x:scroll;overflow-y:hidden;width:505px;"&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;        Model model;&lt;br&gt;        Texture2D surface;&lt;br&gt;&lt;br&gt;        &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;void&lt;/span&gt; LoadGraphicsContent(&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;bool&lt;/span&gt; loadAllContent)&lt;br&gt;        {&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;if&lt;/span&gt; (loadAllContent)&lt;br&gt;            {&lt;br&gt;                model &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; content.Load&amp;lt;Model&amp;gt;(&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"sphere"&lt;/span&gt;);&lt;br&gt;                surface &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; content.Load&amp;lt;Texture2D&amp;gt;(&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"earthmap"&lt;/span&gt;);&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;void&lt;/span&gt; Draw(GameTime gameTime)&lt;br&gt;        {&lt;br&gt;            device.Clear(Color.DarkSlateBlue);&lt;br&gt;&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;foreach&lt;/span&gt; (ModelMesh mesh &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;in&lt;/span&gt; model.Meshes)&lt;br&gt;            {&lt;br&gt;                &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;foreach&lt;/span&gt; (BasicEffect beffect &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;in&lt;/span&gt; mesh.Effects)&lt;br&gt;                {&lt;br&gt;                    beffect.EnableDefaultLighting();&lt;br&gt;                    beffect.TextureEnabled &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;true&lt;/span&gt;;&lt;br&gt;                    beffect.Texture &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; surface;&lt;br&gt;                    beffect.World &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; Matrix.CreateScale(10, 10, 10) &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;*&lt;/span&gt; Matrix.CreateRotationY(modelRotation) &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;*&lt;/span&gt; Matrix.CreateTranslation(modelPosition);&lt;br&gt;                    beffect.View &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; camera.viewMatrix;&lt;br&gt;                    beffect.Projection &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; camera.projectionMatrix;&lt;br&gt;                }&lt;br&gt;                mesh.Draw();&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;base&lt;/span&gt;.Draw(gameTime);&lt;br&gt;        }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item></channel></rss>