How to import a 3d Model in XNA framework?
- Can anyone explain me howto import a 3d model in an XNA project? In which format I have to export my model from 3ds max 7?
Answers
The SWM is fairly simple. Here's how its structured:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=685166&SiteID=1
All Replies
- As far as I know, the current BETA has no loading routines for 3D modell formats. It seems they are part of the content pipeline which will be implemented later, so you must write your own model file reading code for now. My advice is the Wavefront OBJ format, which is a very well documented ascii format. It's also supported by the most modelling programs like Wings3D, Maya, 3DS-MAX, Anim8or...
Look here for detailed imformation: http://www.fileformat.info/format/wavefrontobj/ - I created a .X to .SWM converter.
x2swm - http://astaroth.beatbuggy.net:8080/Downloads/x2swm.zip
It's not properly tested, so let me know if it works ok.
- Hi,
thanks for posting this converter.
Now, I don't like to look a gift horse in the mouth and all that, but would it be possible for you to post this as source? I understand if you are restricted by work or such but you will appreciate we have to be very careful about downloading .exe files and such.
cheers, Joc - Thanks X-Tactic for te converter...i'll try it...
- What would be great now is if somebody posted a tutorial for loading and using SWM files, methinks it's a bit simpler than it looks - I'm just going off extracting the code from Space Wars at the moment to write some helper methods for it...
Jocphone wrote: Hi,
thanks for posting this converter.
Now, I don't like to look a gift horse in the mouth and all that, but would it be possible for you to post this as source? I understand if you are restricted by work or such but you will appreciate we have to be very careful about downloading .exe files and such.
cheers, JocDon't worry, its perfectly safe :)
Unless you save over some .swm you didint want to, but thats about it.
The SWM is fairly simple. Here's how its structured:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=685166&SiteID=1
- Don't worry, its perfectly safe :)
That's the trouble tho', I do worry and downloading .exe files posted on forums
is beyond the level of risk that I'm willing to take with a work computer so I will
have to pass unfortunately.
cheers, Joc Jocphone wrote: Don't worry, its perfectly safe :)
That's the trouble tho', I do worry and downloading .exe files posted on forums
is beyond the level of risk that I'm willing to take with a work computer so I will
have to pass unfortunately.
cheers, JocOk fair enough, If you don't want to use it theres no problem.
- Alright, heres a new version:
Updates:
.swm now contains vertex format string
more verbose error descriptions
Get it here: http://astaroth.beatbuggy.net:8080/Downloads/x2swm_1_0_0_1.zip
- It fails! it gives the following error:
Mesh format clone failed
:-(
Matute wrote: It fails! it gives the following error: Mesh format clone failed
:-(
I updated the cloning a little, hopefully it will fix your problem.
Heres an updated version with modifed cloning:
http://astaroth.beatbuggy.net:8080/Downloads/x2swm_1_0_0_2.zip
- I used your converter X-Tactic and it works great!
- Your welcome.
X-Tatic
I used your .exe and it caused a massive collapse of my system. I rebooted and suddenly the power in my house went out. Then I looked outside and noticed that power had gone out in the whole neighborhood. Then suddenly the power came back on and so did my computer. But, there was still something 'wrong' with my computer. Instead of windows coming up... it was just this blank screen with the words:
Shall we play a game?
- ..lol
- I uploaded a new version of x2swm:
Fixes:
Batch vertices now have the proper offset
batch Indices are now correct.
can perform multiple conversions without restarting the application.
Get it here: http://astaroth.beatbuggy.net:8080/Downloads/x2swm_1_0_0_3.zip
I converted many .x files successfully with this version . Here is an image showing .swm rendering in XNA:
http://astaroth.beatbuggy.net:8080/Images/XNAMagic/x2swm_success.jpg
Enjoy!
Any chance someone could put up a tutorial thats simply how to import a .swm file and how to render it in 3D?
I find the Spacewar tutorial a little much to learn simple basics sometimes. I want to learn the basics then I can start adding caches etc.
Thanks!
- X-Tatic...your SimpleMesh game component is simply brillant :)

