Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting 3Ds Max models into DirectX

Posted on 2012-04-11
3
Medium Priority
?
683 Views
Last Modified: 2012-08-13
I have bunches of models that I have made for 3D Game, I am trying to get those models in DirectX, I am using C++.

I want a way that will not allow the end users to modify or replace the model, I think if I used .x files the end user might be able to replace the models and result that his own models appear in the game!

What is the way that's used in commercial games to get 3Ds Max models in DirectX?
0
Comment
Question by:Mohamed Abowarda
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
satsumo earned 1500 total points
ID: 37837009
Commercial games typically use a proprietary model format and load from that.  The models, textures, sound and other resources are typically stored in a large archive file of some kind.  Often the file is compressed and encrypted to prevent people taking the data.  ID Software are curious because their games are easy to get data from.  The newer games use zip archives (you can open them in any zip utility) and textures are stored as common PNG or DDS files.

In this case the easiest way to do this is to make the .X files into resources, so that they are compiled into the executable.  DirectX has functions for loading .X files from resources, and a program can load any format of data from resources.  Done this way there is only one file to distribute and its not so easy for people to replace the models.

Some people would be able to extract the models from you executable, you can load an exe into Developer Studio and examine the resources.  It's still enough to stop the great majority of people.  If you want to go further you can design your own model format, or look into encryption.  However, you soon reach the point where the effort out weighs the benefit.
0
 
LVL 12

Author Comment

by:Mohamed Abowarda
ID: 37837502
Hi satsumo,

Can you please post a code to load .X file into DX9?

I tried to use D3DXLoadMeshFromX() however I am not sure how to use it, also if you can post a full code that will allow loading .x files I would appreciate it.

Thanks,
0
 
LVL 12

Author Closing Comment

by:Mohamed Abowarda
ID: 37863839
I found out how to load .x file in DirectX.

Thanks,
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question