From: Michel B. <mic...@fr...> - 2010-03-23 05:32:47
|
>On 22/03/10 01:25 PM, doug sanden wrote: >> >>> I'm interested into build my own version of freewrl to take snapshots from >>> some specific viewpoints (virtual cameras) without displaying the main GUI. The >>> aim of this modification is to be able to get the silhouettes of some objects >>> and and manipulate them with bash scripts. >>> >>> I modified the main program introducing calls to the Snapshot() function before >>> the function startFreeWRL(), but the saved image is completely black. If I >>> assign one key to call the Snapshot() function in the main GUI, when I press >>> this key, the saved image is correctly generated and correspond with the >>> rendered object. >>> >>> Could anyone give me some suggestions to achieve my goal ? >>> "Ian Stakenvicius, Aerobiology Research" <ia...@ae...> - Mon, 22 Mar 2010 14:13:42 -0400 >Michel had done a lot of work on this for the early 1.22 releases (this >was at least a year ago).. If you search the list archives you should >find his notes. He might also be available to chime in on this topic. > >Ian > Hello, indeed, I've worked on this topic, and maybe we will benefit from this new use case to extend to features of FreeWRL ;). I used it with bash script last year to create a "web directory" of models. Mufti suggested the best approach IMHO: we have to use Off-Screen Rendering for this purpose. To achieve this some configuration is required in addition to evolutions in FreeWRL. Basically if your script run in a environment where it can connect to the real X server then we just have to use FreeWRL like this: #!/bin/sh for i in *.x3d; do n=${i%.x3d} freewrl -Ksq -o. -n$n $i mv ./${n}.0001.png ./$n.png done "-Ksq" tells FreeWRL to grab a screen shot right after initialization and then quit. Using Xvfb could remove the need for an X server running (no DISPLAY). Using Xvfb could work, but I'm not sure that FreeWRL will run into it without problem (it makes use of OpenGL extensions and some are required now). -- More elaborated approach: You have to setup an off-screen renderer: Mesa for example. And link FreeWRL to this library. It won't need a DISPLAY anymore. But you'll lose all features that your GPU would provide. All rendering will be done in software by Mesa. Cheers, Michel |