I'm writing a library to allow users to generate 3D models programatically.
- User writes code (e.g.
- User views preview of 3D model (with built in visualizer)
- User can "print" the model to a
.objfile that can be read by other 3D modeling programs and visualizers
What is a good way to architect the data objects and the above functionality?
Lets assume a
Square object subclasses a
Polygon would have
- a face
- a transformation/translation
Eventually, I need to be able to
Polygon class because I would like the
Polygon class to only have to worry about pure geometric considerations, not details of graphics libraries. So, I could just create a
Renderer object that can take
Curves and inspect them and then decide how to display them, but that didn't seem very Object Oriented.
So to summarize, I want to have
- a bunch of different types of geometric objects (
- a few different ways to "print" the objects (display to screen, write to file, etc)
And I'm not sure where to put all of this functionality so that it is well encapsulated, easy to maintain, and extensible.