Re: [osg-users] Geographic earth in OSG?
Hi Shayne and Akilan, I suspect your problem has something to do with your shape drawable where you're using a sphere in your code. That is what I was trying to say, If you do your calculations with an ellipsoid model, but then you try to draw these positions in a ShapeDrawable::Sphere you'll never see the models in their right place. You have to draw on an Ellipsoid, not a Sphere. Depending on where you are putting our model (near the equator or near the poles) the difference could be very large. Cheers. -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Building new website, assistance appreciated!
Hi Thomas, I have been a bit busy these days, but hopefully this weekend I will be able to take up again the web tasks. I will start to write the author's guide ASAP, we can modify it later if necessary. Cheers. 2012/5/17 Thomas Hogarth thomas.hoga...@gmail.com Hi Again I've started work on the Windows/Visual Studio side of the platform specifics section. http://www.openscenegraph.com/index.php/documentation/platform-specifics/windows/37-visual-studio Just wondered if you'd take a look at the few pages I've done to confirm style etc before I move on. Also I think the main Visual Studio page needs a bit of refactoring, but the pages it links too seem good. Cheers Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47748#47748 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render a sub part of the viewport
Hi Aurelien, What you need to do is set up your RTT Camera so it's dimensions are 9x9 (viewport and texture sizes), keep the view matrix the same as the main camera, then adjust the post multiple the projection of the main camera so that it captures just the required portion of the main window. Off the top of my head I can't think of the exact formulas to use for the post multiplication matrix, but essentially you'll be wanting to translate and scale the small portion of the main cameras clip space (-1,1) to RTT cameras final clip space which will be -1, -1. If you were taking just the bottom left quarter of the main camera you'd want to covert a (-1,0) range to (-1,1) so would translate by 0.5 and then scale by two. Hopefully this will give you enough clues to derive the maths yourself. Robert. On 16 May 2012 08:17, Aurelien Albert aurelien.alb...@alyotech.fr wrote: Hi, I've made a render graph with a main camera and several RTT cameras. One of these cameras is disabled by default and is used to compute informations about the fragments (shader program is used to compute image signal parameters, not visible colors) When the user activate a read info mode, for each click on the viewer : - this special fragment info camera is enabled - the fragment info camera matrices (view and projection) are copied from the main camera (to get the same point of view) - the fragment info camera viewport is copied from the main camera (to get the same image) - a frame is rendered = the fragment info camera write informations into a framebuffer - the informations from the fragment info pixel under the mouse are read and displayed to the user This works well, but I have a performance issue : - the fragment info shaders are complex - the fragment info framebuffer is the same size as the main viewer, which is useless since I have to read only a few pixels So I'm looking for a way to compute : - the fragment info camera matrices (view and projection) from the main camera matrices - the fragment info camera viewport from the main camera matrices to get : - only a 9x9 pixels image - the center pixel of this image centered with the mouse cursor coordinate Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47741#47741 ___ 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] Problem with semi-transparent textures
Hi Martin, On 17 May 2012 11:52, Martin Oswald martin.r.osw...@gmail.com wrote: I hope this description makes the problem a bit more clear. I'm afraid even with this explanation I can't spot a reason of what might be going wrong for you. When stumped on issues like this I tend to pare back my usage of classes/data to a bare minimum and see if I can get something simple working then step back through the process adding the more complex tasks/data to see if something breaks. Sometimes just this process helps spot the problems in terms of forcing a thorough review of the source code, sometimes it's the results that illuminate what is going on. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render a sub part of the viewport
Hi, Thanks for your guidelines, this is exactly what I try to do... no sucess for the moment but it's probably just a math issue with the projection matrix modification. Another question : how can I render only this camera ? (not the main one) I tried to modify cameras node masks so when I call the frame() method, only the fragment info is rendered but I always get : - no camera render at all or - main and fragment info camera are rendered Thank you! Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47757#47757 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render a sub part of the viewport
Hi, Aurelien This can be done with viewport modification. Viewport matrix is one that transform -1...1 postperspective coords to window coords. You should attach 9x9 image\texture to camera, and set camera viewport with x,y = (window mouse coords center transformed to screen coords in pixels - vec2(4,4)), and width, height = 9. This way you'll get covered 9x9 area around mouse cursor. Dont forget to clip viewport values so they dont go out of window. Cheers, Sergey. 18.05.2012, 14:41, Aurelien Albert aurelien.alb...@alyotech.fr: Hi, Thanks for your guidelines, this is exactly what I try to do... no sucess for the moment but it's probably just a math issue with the projection matrix modification. Another question : how can I render only this camera ? (not the main one) I tried to modify cameras node masks so when I call the frame() method, only the fragment info is rendered but I always get : - no camera render at all or - main and fragment info camera are rendered Thank you! Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47757#47757 ___ 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] Render a sub part of the viewport
Replying to myself :) In this case you should attach full sized texture, but only 9x9 pixels area around mouse cursor will be drawn. Another possibility is to attach 9x9 texture, keep viewport (0,0,9,9) and tweak projection matrix with scale and translate, as Robert already said. 18.05.2012, 15:10, Sergey Polischuk pol...@yandex.ru: Hi, Aurelien This can be done with viewport modification. Viewport matrix is one that transform -1...1 postperspective coords to window coords. You should attach 9x9 image\texture to camera, and set camera viewport with x,y = (window mouse coords center transformed to screen coords in pixels - vec2(4,4)), and width, height = 9. This way you'll get covered 9x9 area around mouse cursor. Dont forget to clip viewport values so they dont go out of window. Cheers, Sergey. 18.05.2012, 14:41, Aurelien Albert aurelien.alb...@alyotech.fr: Hi, Thanks for your guidelines, this is exactly what I try to do... no sucess for the moment but it's probably just a math issue with the projection matrix modification. Another question : how can I render only this camera ? (not the main one) I tried to modify cameras node masks so when I call the frame() method, only the fragment info is rendered but I always get : - no camera render at all or - main and fragment info camera are rendered Thank you! Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47757#47757 ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render a sub part of the viewport
Thanks, I'll work on it on monday... What about my 2nd question ? (render only this camera) Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47761#47761 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render a sub part of the viewport
HI Aurelien, On 18 May 2012 15:06, Aurelien Albert aurelien.alb...@alyotech.fr wrote: What about my 2nd question ? (render only this camera) Not a quick an easy answer to this one. The normal frame loop will render the various graphics windows and then issue a swap buffers at the end of the frame, what you are wanting to just render a RTT Camera as a one off, or do you Typically one would do such RTT Camera's prior to the main Camera, putting them in the scene graph can be the best way to manage whether it needs to be rendered or not per frame. It's possible to render a Camera more directly by calling the Camera's Renderer's cull_draw() method for a thread with the appropriate context current, this isn't usual OSG usage though, and not one I've tried yet, this is just what the viewer will be doing behind the scenes so it will be possible to split this out into user control. The one thing you'd need to be careful of who has control of which thread and which context. Running single threaded and single context makes this more straight forward. Do too much in non standard ways will require greater low level understanding and patience in debugging stuff as you'll be doing stuff that most other haven't directly done before. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render a sub part of the viewport
This is not exactly what you want, but something similar: you can rework your rendering process to use 3 cameras: 1) RTT camera which render scene. 2) your 9x9 RTT camera. 3) main camera (which output stuff to framebuffer) - this one just render full screen quad with texture from first camera. When you dont need to re-render scene, you just disable 1st RTT camera by setting 0x0 node mask, main camera just keep drawing texture, which contain last frame when 1st camera was enabled. As rendering one textured fullscreen quad not gonna cut into framerate much, i think this is usable approach, and it can be done quite easily. Cheers, Sergey. 18.05.2012, 18:06, Aurelien Albert aurelien.alb...@alyotech.fr: Thanks, I'll work on it on monday... What about my 2nd question ? (render only this camera) Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47761#47761 ___ 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
[osg-users] Help: how does lightSource with referenceFrame of osg::LightSource::ABSOLUTE_RF work?
Hello, I have 2 questions about the lightSource node. (1) Does lightSource affect all the geode nodes in the scenedata or only the ones that are under it in the sceneData structure? (2) In my application, a lightSource is attached to the main sceneNode, and this lightSource has a osg::group node (NodeA)as its child which contains several 3D models . There is also a pre render camera attached to the lightSource, and that pre render camera also has NodeA as child. When I set lightSource-setReferenceFrame(osg::LightSource::ABSOLUTE_RF), the color of the texture from the prerender camera varies as I use mouse to change the orientation of master camera displaying the 3D view. I don't know what is happening here. In my opinion, as the position and orientation of the pre render camera relative to the static 3D objects stay the same, the texture color should be the same too. When Relative_RF is assigned, then the texture keeps the same however I change the master camera. Can anyone give me some hints on that? Thanks a lot in advance! Best regards Shuiying ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
I understand the discrepancy. The real question is why the originator of the thread was using a sphere in the first place and not the ellipsoid to place the models... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jordi Torres Sent: Friday, May 18, 2012 1:41 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Geographic earth in OSG? Hi Shayne and Akilan, I suspect your problem has something to do with your shape drawable where you're using a sphere in your code. That is what I was trying to say, If you do your calculations with an ellipsoid model, but then you try to draw these positions in a ShapeDrawable::Sphere you'll never see the models in their right place. You have to draw on an Ellipsoid, not a Sphere. Depending on where you are putting our model (near the equator or near the poles) the difference could be very large. Cheers. -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] [osgAndroid-Question] How to get .ply files to work?
Hi dear OSG Dev Community :) I'm working with the Android Implementation of OSG, namely the osgAndroidExampleGLES1. I figured out how to include the plugins like jpeg, png, curl, freetype, mainly thanks to this thread: http://forum.openscenegraph.org/viewtopic.php?t=10415 (For those who don't know: the Android.mk and the OsgMainApp.hpp have to be modified). But here comes my problem: i want to use .ply Files. I know there is a plugin for it. But when i try to include it like i do with with the other plugins i get the error cannot find -losgdb_ply. maybe someone could point me in the right direction. thanks very much in advance, this dev community is absolutely awesome! Cheers, Bernd -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47767#47767 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org