Hello, I’m following the graphic codex tutorials http://graphicscodex.com/projects/rays/index.html and I’m now at the point where I’ve to build a ray tracer in OF, precisely:
“Backward” ray tracing algorithms iterate over the light rays that entered a camera and trace them back along the negative direction of propagation to discover the surfaces, and eventually light sources, that gave rise to them.
I need a gui, with a button that trigs a “render”, and this render will take some minute or seconds, depending on the resolution, to render the Cornell Box.
My question is, once that I’ve set up (in the setup method) the scene with the model (a loaded .obj file with the Cornell Box), I’ve defined the camera position and the light position, and I’ve initialized the GUI, where should i draw the rendered image? I assume not in the
draw method, as what I need to draw is an image that progressively gets updated.
The same thing for the ray tracing loop, it should not go into the
update method, right?
So, I think everything should go in the
setup method, that restart from the beginning when i click on the “render” button in the GUI.
Is this correct? do someone have some suggestion about the skeleton of my application?