Rapid PovRAY raytracing from processing
in
Library and Tool Development
•
1 years ago
Recently I've been prototyping some improvements to my povwriter library in
ruby-processing, which include a GUI and running PovRAY directly from the processing sketch. I intend to implement some of these ideas in my processing library. However most of the functionality of my ruby-processing prototypes can be achieved in regular processing now by simply modifying the sketch see example on my
blog.
In my example the the 'P', 'p' preview option is rendered so quickly, that you hardly get time to see it as the PovRAY window (at least on my linux box) which closes on completion. So the provided 'v', 'V' option is handy to view the raytraced sketch again, ideally I would like invoke the view option within preview, but I don't know how to schedule it. I have protected the manual view option with a check on the external process completion (PovRAY creates a 'png' file), but I don't know how to use the process signal inside my sketch, any ideas? It seems a bit catch 22 as calling the Process can lead to error.
Update a 4 hours later, thanks to a bit of googling and prototyping in NetBeans I think I've solved how to check the external process signal, I have updated the sketch on my blog. It seems you can use waitFor() to wait for a process, but I needed to wrap that in try/catch exception block (and throw in check for null). Works for me even though the coding looks damn ugly. Works on linux I would grateful for report on how it works on Windows/Mac.
In my example the the 'P', 'p' preview option is rendered so quickly, that you hardly get time to see it as the PovRAY window (at least on my linux box) which closes on completion. So the provided 'v', 'V' option is handy to view the raytraced sketch again, ideally I would like invoke the view option within preview, but I don't know how to schedule it. I have protected the manual view option with a check on the external process completion (PovRAY creates a 'png' file), but I don't know how to use the process signal inside my sketch, any ideas? It seems a bit catch 22 as calling the Process can lead to error.
Update a 4 hours later, thanks to a bit of googling and prototyping in NetBeans I think I've solved how to check the external process signal, I have updated the sketch on my blog. It seems you can use waitFor() to wait for a process, but I needed to wrap that in try/catch exception block (and throw in check for null). Works for me even though the coding looks damn ugly. Works on linux I would grateful for report on how it works on Windows/Mac.