DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Converting DirectX .X Files for Use in Games

Simon Jackson user avatar by
Simon Jackson
·
Nov. 08, 12 · Interview
Like (0)
Save
Tweet
Share
7.69K Views

Join the DZone community and get the full member experience.

Join For Free

what do you do if you have assets in microsoft’s directx x .x format and you want to use them with unity? you'd have no problems with xna, but unity doesn't like .x one bit.


what formats does unity support

amazingly unity has an astounding amount of support for 3d model formats, including:

image


road to conversion

now quite surprisingly converting models from .x is quite difficult, want a package to save in .x format no problem, but import!, that’s a one way trip to the funny farm.

after a few hours of searching and installing tools i eventually came across a solution that not only worked, it was also free.

image

lithunwrap is primarily a tool for mapping and editing the uv coordinates of low poly models, but it can also read and write models from one format to another.

it supports importing & exporting lwo, obj, dxf, 3ds, asc, cob, and x files .

so after launching up lithunwrap you can open up a model file:

image

once loaded we can simply then save the model to which ever format we want to use, i’ve no particular preference but i generally use obj files as they are more commonly supported by other tools, but if you are using unity and have access to 3d studio max (or have a modeler who does) then you can just export to .3ds which unity also supports:

image

just be sure to use the “model –> save” options, the export options are for other things.

*note

i could not confirm (just because i didn’t have any assets to test with) if lithunwrap will also convert / save all the features of a model such as animations, bones.  it does support meshes and textures (including the ability to unwrap / change the uv mapping of a model) but you should check if you have animations or bones in your model if they are also exported.  granted if you have no other option you might just have to live with it and re-create them in your tool of choice


what didn’t work?

in my journey i followed many posts and hints of ways i could convert .x files, here why most of them didn’t work:

  • milkshape – was free to try and could read .x files. but doesn’t allow saving in the trial.  granted it wasn’t much and you may want to buy milkshape if you wish
  • truespace3d – truespace was made free several years back after microsoft bought them, can be tricky to find but its a great free 3d tool.  however it cannot import .x files no matter what people say! ( <download link> )
  • online / downloadable model converters – looked at several but all require purchase, anything from $100 to $$$$, seems it’s a very hot market.
  • 3ds max / maya – i found hints that these big boy tools may be able to read .x files but couldn’t confirm (plus autodesk’s site wasn’t working when i tried to check)
  • moddb.com had some great tools (like xconv) but they generally only convert into 1 format or another, usually for specific game engines like modern warfare
  • blender is a great and free 3d modelling tool, however it can only export .x files.  i think it did import .x files at one point but such things have been lost to the past (i went back as far as version 2.49b but no luck)
  • do it yourself – found a nice article on how you could write your own converter / importer for the .x format, but i’m just not going there right now – http://www.opengl.org/discussion_boards/showthread.php/166733-convert-from-x-or-obj-to-opengl-in-c

DirectX

Published at DZone with permission of Simon Jackson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Data Leakage Nightmare in AI
  • Cloud-Native Application Networking
  • Deploying Java Serverless Functions as AWS Lambda
  • GPT-3 Playground: The AI That Can Write for You

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: