Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


methinks

Member Since 21 Mar 2004
Offline Last Active Sep 23 2014 05:55 PM

#5058998 Alternatives to singletons for data manager?

Posted by methinks on 03 May 2013 - 01:07 PM

I want to add a central data manager to my project, so that different classes can share data. It will also act as a map to avoid doubling up on resources.

 

layout1.png

 

I figure that there are 3 ways I can do this:

  • create the manager as a global (EVIL)
  • pass the manager to each class as it is created (UGLY)
  • create the manager as a singleton

Every post I see says to avoid singletons, but is this a situation that breaks the rule, or is there a better solution?

 

Also, the graphic data above is just one type of data; realistically there will be many data types. To avoid having a whole mess of singletons, I would create a central data manager that has a factory class for each type:

 

layout2.png

 

Oh yeah, I'm doing this in C++, but the concepts should apply to most languages




#5038920 Is a mesh a 3d model?

Posted by methinks on 03 March 2013 - 09:25 PM

The mesh is the data describing the points that make up the object (This includes faces and edges). This is just one small part of the model.

 

"Model" is a generic term. It means any data related to drawing a 3d item onto the screen. Exactly what data this includes depends on the program or file format. In some case it might just be the mesh, although usually it also includes some of the following:

  • Material - the colours, shading models, and other things that determine how to apply lights and rendering
  • Textures - the images that are mapped onto the mesh
  • UV - co-ordinates that determine how textures are applied to the mesh
  • vertex groups - used to break the model into smaller chunks for special purposes
  • bones / armatures - used to link parts of the mesh to specific parts of animations
  • animations - how the mesh moves

... the list goes on, depending on what you're trying to do with the mesh.




#5018050 Making Blender files take up less space?

Posted by methinks on 05 January 2013 - 09:50 PM

The difference is what actually gets saved. The 3ds file only saves the model data itself (geometry, materials, etc) while the blender file contains structures explaining the data as well (the so-called DNA structure) that guarantees both forward and backward compatibility. Add to this the workspace setup (tool settings, layouts, preferences, etc), the blender file actually contains far more data.

(To be very specific, the blender file is a direct dump of the internal data structure, while the 3ds is an optimized format to store only very specific data)




PARTNERS