Question about ingame 3D model

Started by
10 comments, last by novice4ever 17 years ago
This may sounds stupid, but I realy want to know how they make the character ingame with difference clothes & weapon. I mean model such as a cowboy with hat and without hat. 3D artist should build a model of a cowboy and model of an hat separately. If they make it separately then how they combine cowboy and the hat later in-game? Anyone please? P.S. sorry for my bad english.
Advertisement
Separate models can actually be combined by merging (i.e. copying the vertices together), but Ithink that way is seldom used for the given purposes. Instead, the particular models are spatially transformed so that they look like to be one. E.g. the cowboy is located and oriented in the world by having its own co-ordinate frame. This frame spatially relates the cowboy's model (given in "local"co-ordinates) to the world co-ordinates. Now, don't stop at this level but relate the model of the hat locally to the co-ordinate frame of the cowboy, building a chain (or a tree in general) of spatially dependend models. So a transformation applied to the cowboy's model is automatically also applied to the hat. This is called "forward kinematics" and is not only used in games but also already in the artist's modelling tool; it is common for this kind of problem.
Thanks a lot haegarr :) But I think that solution still have some sort of difficulty.
For example, I have the cowboy with difference clothes. When cowboy run, then his trousers should tie to his legs. It would be very funy if it doesn't :)
I appreciate for your help.
Oh, there was another question in th OP, too ...

Well, clothes are normally handled another way. It is often sufficient to exchange the texture only, since clothes often introduce another look but not another shape. E.g. exchanging a blue suit with a green one need not necessarily replace the vertices of the model; it suffices to exchange the color texture.
Quote:Original post by novice4ever
Thanks a lot haegarr :) But I think that solution still have some sort of difficulty.
For example, I have the cowboy with difference clothes. When cowboy run, then his trousers should tie to his legs. It would be very funy if it doesn't :)

Modeling physically correct behavior is more difficult, right you are. A hat is somewhat static in its shape, and it follows the head position and orientation. At most its flaps move a bit independently.

If you want to model "real" clothes you 1st have to make the model somewhat flexible. This can be done by introducing small weights into the vertices of the model, and to introduce something like springs between them (socalled "mass-spring model"). Giving the springs a rest length and some stiffness you can define a standard form of the model. When you move the model now, the trousers and the legs will collide. You have to detect that collisions and to adjust the vertices of the trousers to no longer interpenetrate with the legs.

To be more sophisticated, since the trousers does not collide everywhere, there are also portions that are affected by forces like wind and by acceleration due to the movement of the legs (transmitted by the aforementioned springs).

However, physically behavioural models are definitely an advanced topic.
That's mean I have to write a customise 3d loader to handle all transformation and coloring.
Is that the coders work? and 3d artist just make separate models?
Best regards
Oh ok ! I see your point. So I have to calculate someway to make sure every movement of the character will not cause trouser's penetrate.
However, this will bring to performance situation. Because I plan to render about hundred of small character on scene. with this checking, it will slow down the PC for sure.
Quote:Original post by novice4ever
That's mean I have to write a customise 3d loader to handle all transformation and coloring.

Transformation is not directly a task of the loader. A loader can load models, textures, and even animations. The _engine_ provides some kind of assembling tool, e.g. a scene graph, to put all the loaded stuff together. If the cowboy wears a hat then the hat is added to the scene graph in the appropriate location (e.g. into the head's node to utilize the forward kinematics). If the hat is dropped it is removed from that node and added to the node that represents the floor (for example).

Notice that your intention is to _change_ clothes and weapons. That is the task of the engine, since the exchange is controlled by events (e.g. input of the player or some in-game events like a wind blast). A loader only provides a way to get the resources.

Quote:Original post by novice4ever
Is that the coders work? and 3d artist just make separate models?

Definitely (however, I'm a coder and in my eyes "just make models" is already magic ;).
Quote:Original post by novice4ever
So I have to calculate someway to make sure every movement of the character will not cause trouser's penetrate.
However, this will bring to performance situation. Because I plan to render about hundred of small character on scene. with this checking, it will slow down the PC for sure.

Hey, that is the trouble game programmers all are in every day ;)

As mentioned above, consider first to go the simple way of texture exchange. A way not mentioned yet is that also the figure of the cowboy itself may be assembled. Perhaps you may have noticed that a couple of human models are not of 1 piece but e.g. 6, one for the head, each arm, each leg, and the torso. The artist can model several different appearances for each part, and the engine can assemble them at runtime to yield in an entire figure. Of course, this would give high flexibility but introduces some visual artifacts at the crossings of the particular body parts. Nevertheless, many games use such a technique.
haha :D It's true. Their work are amazing.
Could you suggest me any game engine does that kind of character manipulation?
Please :)
I have been search for the engine for so long. But I do not found that feature in the engine's document.

This topic is closed to new replies.

Advertisement