Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Inactive thread for a while but I’m wondering if you made progress since then and/or are still working in the same field.</p> <p>I'm having a similar problem. I'm separating an existing codebase with everything lumped together: Model (SceneGraph), GUI (win32) and rendering (OpenGL) into a nice Model/View framework (no separate Controller). The Model/View separation for the GUI works and now I'm working on the OpenGL rendering. As a first "simple" demand for myself I started out restricting the system in the sense that no inclusion of an OpenGL header is allowed in the model layer. This immediately forces you to have a separate OpenGL "RenderGraph" on the view side in addition to a SceneGraph on the model side. All possible nodes in the SceneGraph get their own view representation (like you state). I kind of like that, because typical OpenGL rendering data (like vertex arrays) stay on the view side. One could for instance imagine a raytrace rendering that has no use for this data, so it’s good not to include it in the model (only things like “radius” or “position”).</p> <p>The hierarchy of the SceneGraph and Rendergraph is simular at the moment, although I could imagine one would have a different structure based on state changes (as TokenMacGuy mentions). When the SceneGraph changes (as triggered by the GUI, and propagated by the model) you have to handle this change notification locally in the RenderGraph. This involves actions like adding/removing/moving objects. This is a bit cumbersome, but it is manageable.</p> <p>My main problem at the moment is that the relation between the SceneGraph (Model) and the "ViewGraph" (View/GUI) is a bit different from the relation between the SceneGraph and the RenderGraph (View/OpenGL). While in the first case you can have "horizontal" connections between model nodes and view nodes, in the second case a change of an intermediate node often forces a re-render of the whole RenderGraph, from the root node up. I haven't found an elegant way to incorporate that in my framework.</p> <p>As an example, say you have a model of a car in your SceneGraph. Somewhere in a leaf, you have "the diameter of the valve of the front left tire". This would be represented in a text control in the ViewGraph and when a user changes it, the corresponding leaf in the SceneGraph is adjusted. No problem, it is a local change. The model receives this change and sends a notification to the RenderGraph to update the OpenGL rendering. The node in the RenderGraph receiving this notification now not only has to re-render itself, but the whole RenderGraph as a whole has to be redrawn.</p> <p>Kind Regards, Daniel Dekkers</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload