Re: [osg-users] 360 degree screen captures
Hi Darin, You can easily create 360 degree image captures in your app by just creating a series of slave cameras that each take around a 90 degree portion of the view, the viewports for the cameras can be side by side so you don't see the seem. Alternatively you can render the slave cameras to a cubemap than have final pass where you render this texture - this enables you to do full dome projection with distortion correction. It just so happens that the OSG already support full dome projection with distortion correction just do: viewer cow.osg --3d-sd This option calls the View::setUpViewFor3DSphericalDisplay(...), and if you have a look inside src/osgViewer/Viewer.cpp you'll find the implementation for it. It creates 7 slave cameras - 6 for the cube map and one for the final distortion correction pass. If you just want to do this all off screen then you you just use a pbuffer for graphics context rather than a conventional window. Also in your case you should be able to simplify the code from the 3DSphericalDisplay() example as you probably can get away with no distortion correction. Robert. On Wed, Jan 13, 2010 at 8:40 PM, Darin Kwasniewski dkwasniew...@prologic-inc.com wrote: Hi, Does there exist the capability utilizing the osg libraries to create the JPG/PNG without running the viewer, i.e. without displaying the viewer window. Is there an alternative to creating an image from the screen (and then writing it to the file), or is running the viewer a necessity to accomplish the rotation and image creation? Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22574#22574 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 360 degree screen captures
Hi, Does there exist the capability utilizing the osg libraries to create the JPG/PNG without running the viewer, i.e. without displaying the viewer window. Is there an alternative to creating an image from the screen (and then writing it to the file), or is running the viewer a necessity to accomplish the rotation and image creation? Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22574#22574 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 360 degree screen captures
Hi Darin, Does there exist the capability utilizing the osg libraries to create the JPG/PNG without running the viewer, i.e. without displaying the viewer window. Is there an alternative to creating an image from the screen (and then writing it to the file), or is running the viewer a necessity to accomplish the rotation and image creation? To render without displaying anything on the screen, you need to create an offscreen (pbuffer) graphics context. Search the examples, you should find a few that do this. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 360 degree screen captures
Hi, Wally Atkins wrote: Hi jp, Thanks for the reply. I see that the osgprerender does spin the model and I made a stab at putting in the osgDB::writeImageFile but I must be at the wrong place ... because the output (PNG) that I got was just a full white image. In the function createPreRenderSubGraph() I went to the if (useImage) block and added the writeImageFile() call there ... that must not be the appropriate place though. Also, I see in the createPreRenderSubGraph() function a variable named noSteps which I am assuming determines the number of steps to take in order to perform the 360 around the model. What I would like to do is use that count ... somehow ... to number the images accordingly as the snap shots around the model. The cow is actually spun using an AnimationPathCallback attached to loadedModelTransform. You could either try to get the angle from the AnimationPathCallback or you could just attach the model to your own transform that you control manually. You would then need to pass this angular value to MyCameraPostDrawCallback. You could start by using a global variable and then refine it, there are multiple options. I just tried adding the writeImageFile() into the MyCameraPostDrawCallback and got at least a resemblance of the model in the resulting image file. I'm really not sure of the best way to go about this so any further tips would be greatly appreciated. Yes, the writeImage should go into MyCameraPostDrawCallback, you could remove the image modification in the callback or put the write before the image is modified. jp Thanks, Wally -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16276#16276 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 360 degree screen captures
Hi jp, Thanks for the reply. I see that the osgprerender does spin the model and I made a stab at putting in the osgDB::writeImageFile but I must be at the wrong place ... because the output (PNG) that I got was just a full white image. In the function createPreRenderSubGraph() I went to the if (useImage) block and added the writeImageFile() call there ... that must not be the appropriate place though. Also, I see in the createPreRenderSubGraph() function a variable named noSteps which I am assuming determines the number of steps to take in order to perform the 360 around the model. What I would like to do is use that count ... somehow ... to number the images accordingly as the snap shots around the model. I just tried adding the writeImageFile() into the MyCameraPostDrawCallback and got at least a resemblance of the model in the resulting image file. I'm really not sure of the best way to go about this so any further tips would be greatly appreciated. Thanks, Wally -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16276#16276 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 360 degree screen captures
Hi Wally, have a look at the code path of the example: osgprerender --image cow.osg It already has a spinning cow and copies the image back in the callback. What you have to add is just the image write e.g. osgDB::writeImageFile(*myIm, im.jpg); and maybe some manual stepping. If you feel more adventurous, have a look at the osgscreencapture example. jp Wally Atkins wrote: I am interested in creating a small OSG programs that will read in a model of whatever type and then render screen captures that would mimic a 360 rotation around the model. I would imagine this would be rather simple to write but my days of writing C++ are rusty at best and my initial attempts have proved to be fruitless (got a bunch of gray screen captures). The basic idea is that I could run a command line program with one argument (the path to the model) and have that do the stepping, say 36 steps of 10 degrees each, taking a screen capture at each step and outputting the sequence to JPG or PNG (i.e. model01.png, model02.png, ...). Are there any kind souls out there that could help me with such a task or know of something that already may do such a thing? Thanks in advance for your help, Wally Atkins -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16101#16101 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 360 degree screen captures
I am interested in creating a small OSG programs that will read in a model of whatever type and then render screen captures that would mimic a 360 rotation around the model. I would imagine this would be rather simple to write but my days of writing C++ are rusty at best and my initial attempts have proved to be fruitless (got a bunch of gray screen captures). The basic idea is that I could run a command line program with one argument (the path to the model) and have that do the stepping, say 36 steps of 10 degrees each, taking a screen capture at each step and outputting the sequence to JPG or PNG (i.e. model01.png, model02.png, ...). Are there any kind souls out there that could help me with such a task or know of something that already may do such a thing? Thanks in advance for your help, Wally Atkins -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16101#16101 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org