Very noobish question about using 3ds models...

Started by
4 comments, last by Kyle Campbell 20 years ago
Hey guys, I am "very" new to game programming and right now I''m just trying to study the overall concepts. As a programmer, can someone explain to me what kind of burdens would be lifted by having a buddy that is extremely proficient in 3ds max? I understand you can import models into a game but I don''t know how its done, what that solves, or anything like that. Right now I''m just trying to figure out, from a programmers point of view, what would be the difference in the responsibilities of your code if you have access to 3ds models v.s. not having any models. Can anyone help or at least point me to some articles that shed light on this topic? Thanks in advance Kyle
Advertisement
if u have someone to make 3d models for you then thats good. a 3d game wouldnt be very good without 3d models. the programmer writes the code that loads the 3d model into the game.

you can export .x files from 3ds max using a plugin and then import that into direct3d quite easily. theres a tutorial in the directx sdk.

if you use opengl there are some good tutorials for loading .3ds files at gametutorials.com
Using a 3D modeling program allows you to use create complex meshes of vertices. At its core, the graphics side of 3D game programming is moving these vertices around in space.

The Direct3D and OpenGl APIs have canned routines for simple shapes, such as cubes, spheres, tori (doughnut shapes), and everyone''s favorite, the teapot, but beyond that, the programmer is on their own. This is where the modeling programs step in. With these, you create the monsters, heroes, etc., that you put into the game -- exported in some format that the programmer is responsible for handling.

Getting into greater complexity, you can create skeletons for these meshes, and create skeletal animations in the modeling program. While it may indeed be possible to create such things within your program, the difficulty is simply ridiculous.

Having a buddy who can create such things for you is of huge benefit.
quote:Original post by Kyle Campbell
Hey guys, I am "very" new to game programming and right now I''m just trying to study the overall concepts.

As a programmer, can someone explain to me what kind of burdens would be lifted by having a buddy that is extremely proficient in 3ds max? I understand you can import models into a game but I don''t know how its done, what that solves, or anything like that.

Right now I''m just trying to figure out, from a programmers point of view, what would be the difference in the responsibilities of your code if you have access to 3ds models v.s. not having any models. Can anyone help or at least point me to some articles that shed light on this topic?


Basically your game artist will get a model "game ready". Which means that it''s orientation is set (what is forward/back/etc.), it''s fully textured, and it''s fully animated (if needed). Then they will export this into a 3D file format such as ".3ds", ".cob", ".blend", and ".x". Now you (the programmer) will incorporate a 3D file loader into your 3D game engine. The "file loader" will parse the file in order to extract the vital information. For instance, the ".x" format contains templates that may hold any thing from mesh data (vertices/polygons) to transformation matrix data (different frames of animation).

Now if you buy a 3D engine (TORQUE) then it can deal with certain types of 3D file formats. All you have to do is give it the location of the file you want to load.

Check out this article for loading ".x" files with DirectX:

Step 1: Loading a Mesh Object

And if you''re a cyborg, you can forget 3D packages and just input the data into the file yourself and save it as "my_mesh.x". But like I said, only if you''re a cyborg.
Thanks a bunch guys, that''s a lot of help!

So let me ask one more question, and I know its not this simple but I''m just asking from a conceptual point of view...

Suzie Modeler designs a character, and creates an animation for that character that whenever it walks forward it walks with a limp, or hunched back, or some other kind of physical characteristic.

Then Freddie Programmer imports the file data from that model, and whenever his program indicates that the model is moving forward, the traits and characterstics (ie a limp, or hunched back) that Suzie designed for that particular animation are automatically handled? Freddie''s code doesn''t have to manually move every single vertex to create the animation effect?

I know these are very elementary questions for you guys and I appreciate your willingness to help out. Thanks again.

Kyle
quote:Original post by Kyle Campbell
Thanks a bunch guys, that''s a lot of help!

So let me ask one more question, and I know its not this simple but I''m just asking from a conceptual point of view...

Suzie Modeler designs a character, and creates an animation for that character that whenever it walks forward it walks with a limp, or hunched back, or some other kind of physical characteristic.

Then Freddie Programmer imports the file data from that model, and whenever his program indicates that the model is moving forward, the traits and characterstics (ie a limp, or hunched back) that Suzie designed for that particular animation are automatically handled? Freddie''s code doesn''t have to manually move every single vertex to create the animation effect?

I know these are very elementary questions for you guys and I appreciate your willingness to help out. Thanks again.

Kyle

A good way to handle animation is skinning. As a simplified explanation, that involves creating a simple ''skeleton'' for your model, with each vertex attached to a bone on the skeleton. Animations are then created as sequences of rotations and translations for the bones, and so they take up only a little space and can be applied to any model that has an appropriate skeleton. You can make a standard skeleton for all the bipeds in your game, and Suzie can make a generic ''limp'' animation that can be used with any of the models she makes.

Of course, Freddie still has to write the logic for transforming the vertices based on the locations of the bones, and that can get a bit complicated. For speed, you can even do this on the GPU with a vertex program.

This topic is closed to new replies.

Advertisement