Geometry does not derive from Object3D. Why?

In general three.js is immensely useful and well designed. There is one design decision that makes no sense to me: Geometry does not derive from Object3D. Why?

Some context: I often have the need to manipulate geometry before I insert it into a mesh. But all the properties I would expect to be part of Geometry exist instead in Object3D:

  • matrix
  • matrixWorld
  • normalMatrix
  • positon, rotation scale
  • up

Geometry does host methods to manipulate a geometry: translate, applyQuaternion, etc. Basically we have the methods but not the state. Why?

In a scene graph library you usually have a class for modelling the 3D hierarchy. Sometimes it’s called Node, Entity, Component or Object3D in the case of three.js. Such 3D objects have a position, rotation and scale component and also derive their transformation to their descendants.

Materials and geometries are different since they can be shared by more than a single 3D object. Besides, it’s not their task to represent 3D transformations. Materials describe the object’s surface properties whereas geometries describe the raw geometry data.

TBH, it would make no sense to me to derive BufferGeometry from Object3D. It would be contradictory considering the scene graph concept and the resulting separation of logic.

3 Likes

I get that. It just makes it awkward If I simply want to position and orient a box or cylinder independent of it its parent mesh.

For context see my question - which I solved here: