Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (14 posts)

Creating 3D models for XNA Game Studio 4.0

Last post 10/24/2011 4:53 PM by Diggersworld. 13 replies.
  • 10/22/2011 3:42 PM

    Creating 3D models for XNA Game Studio 4.0

    I'm wanting to create a game using 3D models for the characters. To start with I'll probably just use cubes whilst I do most of the programming bits. Ideally I'd like to know what are the best programs to use for making 3D models (free if possible, i.e. Blender) and then how you go about exporting them and getting them into XNA GS4.0. Eventually I will be wanting to animate and texture the models so any advice in these areas would also be appreciated. Cheers.
  • 10/22/2011 4:16 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    I prefer 3DS Max, if you are a student you can get a free copy of that for 3 years. Blender is nice too, all depends on your personal preference.

    XNA takes .x or .fbx formats. MAX doesn't natively export .x (there are exporters you can download for it, but no importers to my knowledge), so I just work in .fbx. Not sure what all Blender supports, been a few years since I've looked at it.... but I'm sure it exports .fbx at least.

    Once you have them exported properly, you can send them through the content pipeline like normal. People will tell you a bunch of different programs, I think you just need to get out there and play with them yourself and find one that best suits you.
  • 10/22/2011 6:12 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    MichaelArts:
    I prefer 3DS Max, if you are a student you can get a free copy of that for 3 years. Blender is nice too, all depends on your personal preference.


    Personal preference aside, you cannot use the academic version of 3ds Max if you plan to put a game on the marketplace (read the EULA).
  • 10/22/2011 6:34 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    I'm aware of that, I was just throwing that out there since he seems to just be getting started and the academic version of 3DS Max is probably the best way to jump in!
  • 10/22/2011 6:39 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    I'm looking to use something that I can potentially sell if it's a decent enough application to play. So student edition of programs are probably not a good idea due to the EULA. I've had a quick look at Blender this afternoon and found you can export .fbx etc. I just need a bit of practice to get used to the Blender GUI. However I now need to find how you import the .fbx file into XNA as the ways I've found so far keeping coming back with the following compile error: Error loading "mytexture". Cannot find ContentTypeReader for Microsoft.Xna.Framework.Content.Pipeline.Graphics.MaterialContent.
  • 10/22/2011 8:04 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    Hmmm... not really sure on that to be honest. Do you see the appropriate Microsoft.Xna.Framework references up at the top?
  • 10/22/2011 8:12 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    Hmm, you should be able to just add the fbx file to your content project and then load it as a Model in your game. That should be it.

    What does the code where you load it look like?

    Did you do anything weird when you created your project? Does it work if you create a new Windows Game project?
  • 10/22/2011 9:25 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    If I create a new project without adding anything it works fine.... here's what I'm adding.

    Define model at top with other variables: Model currentModel;

    Attempt to load model in LoadContent() function: currentModel = Content.Load("mytexture");

    The .fbx file is added as a Content Resource in the solution explorer.
    Those are the only two lines I have added.
  • 10/22/2011 9:46 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    When loading models you want to use: model = Content.Load<Model>("model");

    When loading textures replace <Model> with <Texture2D>.
  • 10/23/2011 7:24 AM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    Yep that's what I've got... my model is called mytexture and links to .fbx file. Have renamed it now to be model.

    However I still get the same issue using the code you suggested... I did have the <model> above but AppHub forums must have stripped it out.
  • 10/24/2011 12:55 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    Just tried this at work... works absolutely fine. Must be something to do with my install on Windows XP at home. :(
  • 10/24/2011 2:10 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    Diggersworld:
    I'm wanting to create a game using 3D models for the characters... then how you go about exporting them and getting them into XNA GS4.0. Eventually I will be wanting to animate and texture the models so any advice in these areas would also be appreciated...

    I use Blender.  Its free and fully featured.  It takes a long time to master but then so does any 3D modeling app., with the exception of perhaps Google SketchUp.

    I've typed up lots of details about using Blender on my blog.  There are lots of gotchas but once you know how to setup the model and the exporter its very easy.  I use it all the time.

    Non-animated models are very easy.  Lots of people have trouble with animated ones but mainly because they don't follow all of the instructions.  Object scale is one of the most overlooked things as is setting the correct Pipeline processor for animations in XNA.

    Some of my blog posts:
    http://blog.diabolicalgame.co.uk/2011/07/before-animating-with-blender.html
    http://blog.diabolicalgame.co.uk/2011/07/exporting-animated-models-from-blender.html

    I also have a tutorials page with more links:
    http://blog.diabolicalgame.co.uk/p/tutorials.html

    Regards
  • 10/24/2011 3:11 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    @Diggersworld -

    Have you applied a texture to the model in your modelling program?  If so, make sure the folder structure matches... it may be having trouble loading missing textures.  Let's say you have a folder with your model in it... and inside that folder you have a "textures" folder that you're storing your textures in.  When you put your model into XNA's content project, make sure you have that folder with the textures there as well.  I don't believe they have to be included in the project, but the folder has to be with your model.  XNA will include the textures when it builds the xnb file because they're referenced by your model.

    You may also find the following link useful which covers some settings you need to be aware of in the FBX Exporter if you're using Max (same principles apply in Blender):
    http://www.cgarena.com/freestuff/tutorials/max/xna/

    Just ran across this ModelViewer post as well... you might find it useful to troubleshoot your models:

    http://xboxforums.create.msdn.com/forums/t/93874.aspx
  • 10/24/2011 4:53 PM In reply to

    Re: Creating 3D models for XNA Game Studio 4.0

    Cheers JCBDigger, I'll be sure to check out your blog. Had a quick sneak peek, looks like you've got some good stuff there.
Page 1 of 1 (14 posts) Previous Discussion Next Discussion