Sign in to follow this  
cobbel9

Questions on 3D Game Development Process

Recommended Posts

cobbel9    103
I've been in the field of software development for 3yrs now, and so have some understandings on general software development process. However when it comes to game development my knowledge somewhat lacks, especially for the 3D graphic part.

I've looked up some tutorials on opengl and directx, and they seem pretty straightforward, but pretty much the same; create a GL window, draw lines and shapes...
But the thing is they don't talk much about 3D graphic/animation tools like Maya, 3D Max and Blender...
I heard about the *.obj file format. People say that you import the model by obj file and use that in your application, but I also heard that *.obj file only contains model work, not animation.

To sum up all these vague words, what I want to know are,

1. How can 3D graphical resources be used in applications that use opengl or directx?

2. How does this linkage work in the real field? (Division of labor)

3. If one can import animating objects from Maya or Blender, can I consider this object similar to animated GIF image on the web?

4. If importing an animating object is not preferred in the industry, do they import the sprite sheets of the movement like old 2D games?


I admit all these questions may sound funny or immature.

Thank you in advance!

Share this post


Link to post
Share on other sites
littletray26    284
[quote name='cobbel9' timestamp='1340592658' post='4952523']
How can 3D graphical resources be used in applications that use opengl or directx?
[/quote]

3D meshes come in different formats, there is as you said .obj, also .x and .fbx and heaps of other choices or can be programmed (tediously) vertex by vertex

[quote name='cobbel9' timestamp='1340592658' post='4952523']
If one can import animating objects from Maya or Blender, can I consider this object similar to animated GIF image on the web?
[/quote]

Animated meshes have an extra dimension than a .gif so they would not be treated as a 2d image. It wouldn't make sense

[quote name='cobbel9' timestamp='1340592658' post='4952523']
If importing an animating object is not preferred in the industry, do they import the sprite sheets of the movement like old 2D games?
[/quote]

2D animation is done using sprite sheets still. To animate 3D objects you have to import the mesh and animation files

Share this post


Link to post
Share on other sites
cobbel9    103
Thanks for the quick reply. The answers are straight forward and pretty much cover all.
But could anyone post the step by step detail of using "tool-created" object in the application?

like,

create model -> put texture on the model -> make it move -> export to a file (mesh?) -> import the file (mesh??) -> deploy? (move, transform, stop, pause whatever...)

Sorry, I'm not in the field of game development but just want to learn the big picture of it.

Share this post


Link to post
Share on other sites
littletray26    284
The code for animating a mesh is too long for me to write up right now (I'm in school) but I can write a sample of how you'd go about loading and drawing a mesh stored in an X file using Direct3D 9:

[CODE]
LPD3DXMESH mesh; //mesh object to store the loaded mesh
DWORD numberOfMaterials; //stores number of materials in the mesh
D3DMATERIAL9* materialArray; //array to store the materials in
LPD3DXBUFFER materialBuffer;

D3DXLoadMeshFromX(L"filepath", D3DPOOL_MANAGED, &d3dDevice,
NULL, &materialBuffer, NULL, &numberOfMaterials, &mesh); //Loads a mesh from a *.x file

D3DXMATERIAL* temp = (D3DXMATERIAL*)materialBuffer->GetBufferPointer();

materialArray = new D3DMATERIAL9[numberOfMaterials];

for (DWORD i = 0; i < numberOfMaterials; ++i)
{
materialArray[i] = temp[i].MatD3D;
}

//in your drawing code:

for (DWORD i = 0; i < numberOfMaterials; ++i)
{
d3dDevice->SetMaterial(&materialArray[i]);
mesh->DrawSubset(i);
}

//finally in your cleanup code remember to release and deallocate memory:

mesh->Release();
materialBuffer->Release();
delete[] materialArray;
[/CODE]

That will load a mesh at it's most basic (without textures) forgive me if there is errors, it's rushed and I'm at school so I couldn't test the code first

Share this post


Link to post
Share on other sites
larspensjo    1561
Be prepared that it is quite a lot of effort. It requires a lot of subjects that need to be mastered.

I just managed to get it going, and made a blog describing what I learned (based on Blender+Assimp+OpenGL):

[url="http://ephenationopengl.blogspot.de/2012/06/doing-animations-in-opengl.html"]http://ephenationopengl.blogspot.de/2012/06/doing-animations-in-opengl.html[/url]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this