Jump to content
  • Advertisement
Sign in to follow this  
Dalek

Creating a flexible character/entity model class

This topic is 5462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

These may be silly questions but: I am currently working on a simple 3D engine - and I have a couple of questions regarding implementation. With regards to world entities (i.e. trees, characters etc), what would be the best way to store the entities position and orientation information, similar to a vector based camera? i.e. up, facing, right vectors? Also - is it normal to have a model/mesh class responsible for loading its own textures and meshes, or would it be appropriate to design a texture/mesh manager that will load the appropriate data then create a series of objects based on the requirements specified in a config file? Thanks! :)

Share this post


Link to post
Share on other sites
Advertisement
Well the way other engines do it, well for the storing of the co-oridates part, is that everything is basically a node.
So what you could have is many sub nodes that all inherit from the base node. And it will be the base node that stores the co-oords;

In the base node, you can have private variable like:

vector3d position;
vector3d rotation;
vector3d scale;

Then you just pass stuff into them.

As for the textures, you can do both. If it is a model file, then you can make it automatically make it load the textures that are associated with the model. Regardless of what you do though, you will have to have a texture class. Thats if the engine is OO.

I would think its better to just write a texture loader and let the users manage their own loading. For example, you may want to, for your game, load all textures at startup or you may want to load them as you encounter such parts that need them.

If you are making an engine you must focus on engine features. Of course you must think of how a game would use them but you need the low level stuff first. Then you can write utility methods to use help out.

Hope this helps




Share this post


Link to post
Share on other sites
Yes thanks it does. Its a challenge sometimes thinking of these things generically - but of course it will help in the long run. Okay, thanks :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!