0

How would you name a class describing a 3d model?

  • 3DModel, this is not a valid identifier
  • ThreeDimensionalModel I do not like this
  • Model to general
  • AnimatedMesh to technical or close to implementation, but maybe ok if there are accessors for face and vertex arrays. But the model is more than the mesh, as it also contains UV vertices used for shading.
  • Animated3dShape But the model is more than the mesh, as it also contains UV vertices used for shading.
  • 2
    Can you give some more information on why you think this matters? If I have a person class, do I have to call it something else because it is a clothed person or a person carrying a hammer? – JeffO May 17 '18 at 18:41
  • The problem with "Model" is that it very context dependent. A person is a person. A Model is any representation of whatever it is a model of: It can be a system of equations, a miniaturized train/railway, something made out of clay... And using a namespace does not help with context, as the naming problem moves to the namespace. – user877329 May 17 '18 at 19:06
  • 2
    I like AnimatedMesh and Animated3dShape. The name doesn't have to embody every possible characteristic; that's what methods and properties are for. The name only has to be sufficiently descriptive of what the object is. – Robert Harvey May 17 '18 at 19:31
  • 4
    What about Model3d? – whatsisname May 17 '18 at 19:57
  • I'd try _3DModel – immibis May 18 '18 at 1:15
0

I'd go with a convention of [SubType][Type][Variant].

Leading me to AnimatedModel3d.

That leaves me open to create classes for a non-animated model, and a model that's not even 3d.

I would also consider any broader namespacing in the application, something in the namespace that contains the Type for example would nullify the need for the Model part, and your classes would become Models.Animated3d format.

Here's the catch though. Do you even NEED all that possible variation? Could you not simply go with Model, because there's no other type of model in your application?

2p.

0

I will go with AnimatedPolyhedron. That tells what it is, and as Robert Harvey commented, texturing aspects does not have to be a part of the class name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.