So I am new to XNA and 3D Modelling. I tried Blender but it was way too daunting for my little brain to get into. So I have started out with Google SketchUp (version 8) and using the xExporter into X Files. For very simply models (and color textures) this seemed to work for me in my XNA phone App. So I have a basic 3D model of a ship and Sprites all looking OK. - But I wanted to work on a more sophisticated 3D model, so worked up a nice model in SketchUp.
Then I started getting into deeper SketchUp Models, using Groupings, different color textures. - But it then all starts to go wrong when I view in my XNA game. Parts of the models components are displaced, or don't show, some faces are missing etc.
My searches to resolve this discovered two aspects
- I need to explode all Groups in Google Skectflow prior to Export - But this made no difference
- As I am using 2D Sprites as well, I should be using SpriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.deferred, SaveStateMode.SaveState) - However this method is no longer seems available in XNA 4.0
Instead on xExporter I have also tried 3DRad which seems a bit more robust and clear in its export options.
I have used DirectX 3D Viewers, and my model seems look geometrically OK in that, albeit it is not clear how Textures are displayed
I have also downloaded various SkecthUp Models, and tried to export these into .X format with mixed results. Some look OK DirectX Viewer, but when displyed in XNA, some faces and components also become missing.
So the GoogleSketchUp exports I have been trying do not seem very robust. What methods are others using, and what are your experiences and most methods to getting into a XNA compatible .X format ?
It is Looking as though I may have to export via Blender or end up having to get top grips with Blender.
** Edit: So I have Downloaded Blender and Python etc. => Export from Sketchup in DAE format, import into Blender - Seems to look OK in Blender.
Export to DirectX - Exports to .X file, but Notice various errors in console Mesh XXX without vertices, out or range errors.
Jeez Really Microsoft would do well to develop and put out a basic X Modelling Tool to help us in the XNA community generate our models (Like Google seem willing to do) I would have thought that was obvious to help the community and help the Indie XBox and WM7 platforms - I am on the verge of giving up: I will see if I can really learn Blender.
For what its worth here is my Draw method (but as I said it seems ok on very basic models of Sketchup exports using xExporter):-
Matrix transforms = new Matrix[myModel.Bones.Count];
foreach (ModelMesh mesh in myModel.Meshes)
foreach (BasicEffect effect in mesh.Effects)
effect.World = transforms[mesh.ParentBone.Index] *Matrix.CreateRotationX(modelRotation)* Matrix.CreateTranslation(ShipPosition *Matrix.CreateScale(50.0f);
effect.View = TheCameraView;
effect.Projection = TheViewProjection;
// Draw the Head Up Display
spriteBatch.Draw(StartButton, StartButtonRectPos, Color.White);
spriteBatch.DrawString(DebugStringFont, DebugString, DebugPosVector, Color.Red);
Cheers for Any help