Jump to content

  • Log In with Google      Sign In   
  • Create Account

Rendering items on a model


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Chris Tubbs   Members   -  Reputation: 100

Like
0Likes
Like

Posted 28 February 2012 - 02:09 PM

I looked around/did a search and I didn't find another topic like this. Sorry in advance if I missed it.

I'm working on a new project where different types of characters can wear different clothes, tools, etc. I've done a project like this in 2D and it just required that I make new sprites, not a big deal. The new project is going to be in 3D (using XNA), so I was wondering:

1. Would it just be easier (though time consuming) to just create a new model for every different set of equipment (i.e. guy in fatigues, guy in plate armor, guy in t-shirt/jeans) ?

or

2. Would it be easier/more efficient to render the equipment onto my base character models based on their dimensions (i.e. breast plate is scaled based on model's width, depth, and height and placed with relative coordinates to the model's torso)?

I've done some work in 3D as far as hierarchal modeling that I believe might be the correct direction to go, but I'm not sure (this being my first 3D game).

I'm not asking for code or anything, just some psuedocode or a general direction will be tremendously helpful. I'm still quite a bit far away from actually rendering models to the screen, so its not that urgent. Really just curious.

Sponsor:

#2 Digitalfragment   Members   -  Reputation: 845

Like
1Likes
Like

Posted 28 February 2012 - 04:26 PM

#2 as it is more flexible, and in the long run is quicker to add new features with less memory overhead.

If your characters are rigged, then you can just load multiple models and attach them all to the same skeleton instance. As long as the peices are designed to fit together, everything just works (e.g. if you do body shape scaling by affecting the skeleton, then it will affect the body model, the chestplate armour model, gauntlets model, etc)

#3 Chris Tubbs   Members   -  Reputation: 100

Like
0Likes
Like

Posted 28 February 2012 - 11:28 PM

Ok, thats pretty helpful. Thanks for taking the time to help! Posted Image

#4 Tordin   Members   -  Reputation: 604

Like
0Likes
Like

Posted 29 February 2012 - 03:51 AM

from performance wise, it would allso be more efficent to bake the entire models into one vertexbuffer aswell as one texture atlas.
ea, one drawcall.

the way i would do it would be like this :
1 : find the models current itemset
2 : load the correct items, ea, right arm, left arm, torso, head, legs and more to it.
3 : combine the vertex & texture buffer
4 : unload all the data we dont need anymore (models and texture that we just combined)
5 : in the shader have input params controlling the length, size and other personal stuff about the charcter.


hope this would help. (btw, this way will work with animation aswell)
"There will be major features. none to be thought of yet"




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS