My application is similar to a very simple CAD program. The user can create and modify a database of several thousand, simple 3D objects (e.g. cubes and spheres). Each object has a position, orientation, and size. I anticipate having these objects serialized in the database.
I want to render objects in the database in 3D views. The 3D views could be the entire database or a particular query (e.g. objects of a certain size). The views should always reflect the current state of the database as objects are added/removed.
So my question is: how can I have the render loop efficiently access the database? These are the options I can think of:
- Give render loop direct access to database. Deserialize objects and render at each loop. This seems inefficient, but maybe not as bad as I fear.
- Give render loop direct access to database, but try to store data in such a way that it does not need to be serialized.
- Create another data structure that always mirrors the database, but is more easily rendered.