Solved

Getting 3Ds Max models into DirectX

Posted on 2012-04-11
3
668 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 500 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

830 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