[osg-users] osg support gocad file format?
hi friends: osg support gocad file format? or is there a plugin like DB_gocad ? ___ 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] Test Mail
This is the test mail, sorry for inconvenience, Regards, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg support gocad file format?
Hi xiexing? wh? can you please supply a complete name, so we can address you correctly? Also please open a new topic (don't use the answer functionality of your mail client), else your question is easily overlooked. Regarding your question: There seems to be no plugin to handle gocad files right now. But there is some documentation on the internet [1] which indicate that the ASCII-format of gocad should be relatively easy to implement for at least some of the primitives. So if you really need the format you can go ahead and write it. If you need help how to do this, I recommend looking at some plugin like obj which is fairly lightweight and easy to comprehend. cheers Sebastian hi friends: osg support gocad file format? or is there a plugin like DB_gocad ? ___ 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] Test Mail
On 9 April 2014 07:22, Sonya Blade sonyablade2...@hotmail.com wrote: This is the test mail, sorry for inconvenience, Email works :-) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Test Mail
Yes, Users should be notified about the fact that mailing list is more active than the forum in OSG, AFAIU there is automatic method which transfers mails posted in mail-lists to forum, but reverse mechanism is not possible so most of the posts posted in forum are unnoticed by community or are in pending status topic waiting approval for couple of days by moderator. Regards, Date: Wed, 9 Apr 2014 09:24:53 +0100 From: robert.osfi...@gmail.com To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Test Mail On 9 April 2014 07:22, Sonya Blade sonyablade2...@hotmail.com wrote: This is the test mail, sorry for inconvenience, Email works :-) ___ 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] Definding against aggressive domain aquisitions
Hi All, I have been contacted by the manager of auditing department at http://hk-ip.org/ about a company, Ross Investments, that is attempting to purchase openscenegraph.* domains. I have never heard of Ross Investments before, so I can only presume that they feel they can make a profit from redirect OpenSceneGraph traffic or gambling on being able to extort an even high price for the domains. I ask how much the domains were are the costs are: Below are the annual domain registration fees of these domains. openscenegraph.cn 44 USD / Year openscenegraph.com.cn 44 USD / Year openscenegraph.com.hk 87 USD / Year openscenegraph.hk87 USD / Year openscenegraph.com.tw 84 USD / Year All of these are way more expensive than I pay for openscenegraph.org and openscenegraph.com. The only additional value to the OpenSceneGraph project of any of these domains would be if a local community wanted to use them for a local language forum/website. For the core OpenSceneGraph project purchasing them would be purely defensive. I raise this issue as adding an extra costs that is more than I currently pay for hosting and domains just isn't viable. Where does one stop in being defensive? There are so many new domain extensions popping up that it's impossible to buy them all up. Thoughts? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Definding against aggressive domain aquisitions
Robert Osfield writes: I raise this issue as adding an extra costs that is more than I currently pay for hosting and domains just isn't viable. Where does one stop in being defensive? There are so many new domain extensions popping up that it's impossible to buy them all up. Indeed, whatever is not pure .com or .org is always preceived as secondary, so IMHO it's not a real danger. Take into consideration that anybody can register any OSG-related domain, as osg-tricks.com or osg-official.org, but just the traffic size from the real site will keep them down in the crawler results. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Test Mail
Hi Sonya, On 9 April 2014 09:46, Sonya Blade sonyablade2...@hotmail.com wrote: Users should be notified about the fact that mailing list is more active than the forum in OSG, AFAIU there is automatic method which transfers mails posted in mail-lists to forum, but reverse mechanism is not possible so most of the posts posted in forum are unnoticed by community or are in pending status topic waiting approval for couple of days by moderator. The mailing list and forum are coupled, so posts to the mailing appear on the forum and visa-versa, it's not really a case of the mailing list being more active, just less hurdles to getting going. The problem with forum moderators is an issue that is unfortunate. I am responsible for the mailing list side, but not the forum. We have discussed this issue an number of times and temporarily we've seen things improve only to see things slide once more. It's a topic we'll need to resolve, but how best to isn't yet clear. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg 3.2.0 rendering problem vs osg 3.1.2
Hi, I am trying to update a code that was working on 3.1.2. A osg::Node is loaded from a stl file using osgDB::readNodeFile. The Node is a Group with one Geode with one geometry. There is a problem with the colors. The only code difference between osg 3.2.0 and osg 3.1.2 is where I set the colors: Code: void Mesh::setColor(osg::Vec4 color) { #if OSG_VERSION_GREATER_OR_EQUAL(3, 2, 0) osg::Geometry* geometry = meshNode_-asGroup()-getChild(0)-asGeode()-getDrawable(0)-asGeometry(); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(color); colors-setBinding(osg::Array::BIND_OVERALL); geometry-setColorArray(colors); #else osg::Geometry* geometry = this-meshNode_-asGeode()-getDrawable(0)-asGeometry(); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(color); geometry-setColorArray(colors); geometry-setColorBinding(osg::Geometry::BIND_PER_PRIMITIVE_SET); #endif } The result I get are shown in the pictures attached. Do you have any idea where this could come from? Thank you! Cheers, alexis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58826#58826 Attachments: http://forum.openscenegraph.org//files/osg312_109.png http://forum.openscenegraph.org//files/osg320_786.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [3rdparty] Qt Form integration
Hi, I want to ask is there a way to OSG as a widget in Qt form (I mean how can I promote OSG header to QWidget to put Qt from and use QT button and the other stuff). I try to show some point clouds and make some modification Thank you! Cheers, oner -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58704#58704 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg 3.2.0 rendering problem vs osg 3.1.2
HI Alexis, This looks like an issue with your application setting up the viewer Camera's without initializing the Camera's StateSet to global defaults. 3.0.x and 3.1.x have a bug where the internal rendering setup overrides the Camera's StateSet forcing the global defaults so would hide where this wasn't done correctly so in effect hid this bug in client applications. In OSG-3.2.x If you use osgViewer::View(er)'s default Camera it will by default set the the StateSet global defaults that you can then override if you wish, but if you apply your own osg::Camera in place of this it won't have the StateSet's set up with global defaults and will just what you set it up with, and if you don't provide any then it'll be just OpenGL defaults which won't enable key things like depth test. The simple solution is to reuse the View(er) Camera rather than replacing it, or if you do replace it call StateSet::setGlobalDefaults() on the Camera StateSet that you are applying. Robert. On 9 April 2014 08:51, alexis pierre qpe...@bluewin.ch wrote: Hi, I am trying to update a code that was working on 3.1.2. A osg::Node is loaded from a stl file using osgDB::readNodeFile. The Node is a Group with one Geode with one geometry. There is a problem with the colors. The only code difference between osg 3.2.0 and osg 3.1.2 is where I set the colors: Code: void Mesh::setColor(osg::Vec4 color) { #if OSG_VERSION_GREATER_OR_EQUAL(3, 2, 0) osg::Geometry* geometry = meshNode_-asGroup()-getChild(0)-asGeode()-getDrawable(0)-asGeometry(); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(color); colors-setBinding(osg::Array::BIND_OVERALL); geometry-setColorArray(colors); #else osg::Geometry* geometry = this-meshNode_-asGeode()-getDrawable(0)-asGeometry(); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(color); geometry-setColorArray(colors); geometry-setColorBinding(osg::Geometry::BIND_PER_PRIMITIVE_SET); #endif } The result I get are shown in the pictures attached. Do you have any idea where this could come from? Thank you! Cheers, alexis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58826#58826 Attachments: http://forum.openscenegraph.org//files/osg312_109.png http://forum.openscenegraph.org//files/osg320_786.png ___ 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] Odd Font/Text issue
Hi, First, thanks for the software. I'm having an issue with osgText::Text instances being added to my scenegraph. I have markers loaded statically from a config file when the application begins, and others are populated from a remote simulation. With the latter, everything is fine if I use the default/generic font (explicitly not set a font for each osgText instance). If, however, I supply a font, many of the markers show up as blank, while others are missing most of their characters. I've debugged to check if there are marshalling issues (C#-CLI-OSG), but the std::string values being fed into setText are appropriate. These are being set through an UpdateCallback. Assigned DYNAMIC variance on all mutable scenegraph components. Does anyone have debugging suggestions? Thank you! Cheers, Josh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58807#58807 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 'osgwidgetbox' example can not work in HORIZONTAL_SPLIT stereo mode with OSG3.2.0 or higher
Hi, 'osgwidgetbox' example can not work in HORIZONTAL_SPLIT stereo mode with OSG3.2.0 or higher. The widgets box can not respose to mouse movement. I test it with OSG3.0.1 and it works well. I don't know what changes between OSG3.0.1 and OSG3.2.0 have lead to this problem. My project must use some new feature braught by OSG3.2.0. So is there any suggestion to make it work well with OSG3.2.0? Thank you! Cheers, Junjie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58791#58791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Uniform Matrix arrays for shaders
And how can you update it?? I am trying to id tiwh ModelViewMatrix and ModelViewPerspectiveMatrix and I can't. Thank you! Cheers, Jaime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58785#58785 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Matrix uniforms glsl
Hi, I want to use matrix uniforms with GLSL shaders. I want to use MVM (modelview matrix) , MVP (modelviewprojection matrix) and NormalMatrix. How can I update it? Thank you! Cheers, Jaime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58783#58783 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android osgPlugins
Greetings! Nathan - were you ever able to resolve this? I am getting the same error with the GLES2 example and _think_ I have compiled osg for Android correctly in static mode. Thanks! -- Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58784#58784 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Why isn't OSG popular and used?
First of all, I wanna to introduce me because it is my first post in the forum. Hello everybody :) I have been learning and using OSG for 6 months, and I am very surprised with it. I think it has a lot of power, specially with the future about OpenGL. So, I have a question. As I salid in the subject...why is not OSG popular and used?? If I look for information, there are not so much. Also, all the info is very very old. What do you think about it? Do you think that OSG has a potential power future, specially with video games? Thanks for your answers! Cheers, Jaime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58770#58770 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] render main scene and 2d menu in single RTT
Good day! 1) I want to draw the MAIN SCENE to RTT, then render 2D ORTHO MENU to RTT, and then withdraw the post process. But I see only 2D ORTHO MENU (cow.osgt - MAIN SCENE, cessnafire.osgt - 2D ORTHO MENU): [Image: http://i.piccy.info/i9/648a1267f5efda76d6e669b60f628234/1395578789/45342/492111/second.jpg ] If I do not create 2D ORTHO MENU and draw only the MAIN SCENE, then everything works fine. You see: [Image: http://i.piccy.info/i9/10bc45e93e8d35b10e52db0d7380466e/1395578661/46732/492111/first.jpg ] The problem is to draw the MAIN SCENE and the 2D ORTHO MENU into one single RTT! What am I doing wrong? If I render MAIN SCENE and 2D ORTHO MENU in separate RTT and combine two RTT in post processing - its working, but it is wrong way. Main logic (I don't use tab, because I see strange symbols...): Code: int main(int argc, char** argv) { osg::ArgumentParser arguments(argc,argv); osgViewer::Viewer viewer(arguments); unsigned int width,height; get_width_height(width,height); osg::ref_ptrosg::GraphicsContext gc = create_gc(width,height); configure_main_camera(viewer.getCamera(),gc,width,height); osg::ref_ptrosg::Node scene_node = osgDB::readNodeFile(cow.osgt); osg::ref_ptrosg::Node hud_node = load_menu_model(width,height); /// 1) create render target osg::ref_ptrosg::Texture2D rtt = create_rtt_texture(width,height); /// 2) create camera to render main scene osg::ref_ptrosg::Camera scene_camera = create_scene_camera(gc,rtt); /// 3) create camera to render ortho 2d hud osg::ref_ptrosg::Camera hud_camera = create_hud_camera(gc,rtt); hud_camera-addChild(hud_node); /// 4) create post processing quad and camera osg::ref_ptrosg::Camera post_camera = create_post_camera(gc); osg::ref_ptrosg::Geode post_quad = create_post_quad(); post_camera-addChild(post_quad); post_camera-setViewport(new osg::Viewport(0,0,width*0.5f,height*0.5f)); /// 5) connect post processing shader connect_shader(post_quad,post_camera,rtt); /// 6) add cameras as slave viewer.addSlave(scene_camera,true); viewer.addSlave(hud_camera,false); viewer.addSlave(post_camera,false); viewer.setSceneData(scene_node); return viewer.run(); } Full code: Code: void get_width_height(unsigned int width,unsigned int height) { osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); wsi-getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); width *= 0.5f; height *= 0.5f; } osg::ref_ptrosg::Node load_menu_model(int width, int height) { osg::ref_ptrosg::MatrixTransform mt(new osg::MatrixTransform); osg::Matrix m = osg::Matrix::translate(width/2,height/2,-100); m.preMult(osg::Matrix::scale(10,10,10)); mt-setMatrix(m); mt-addChild(osgDB::readNodeFile(cessnafire.osgt)); osg::StateSet* stateset = mt-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE); return mt; } osg::Matrix projection_matrix(float aspect) { return osg::Matrix::perspective(60.f,aspect,1.f,1000.f); } osg::ref_ptrosg::GraphicsContext create_gc(int width, int height) { osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-windowDecoration = true; traits-x = 0; traits-y = 0; traits-width = width; traits-height = height; traits-doubleBuffer = true; traits-sharedContext = 0; traits-sampleBuffers = true; traits-samples = 4; traits-vsync = true; return osg::GraphicsContext::createGraphicsContext(traits); } osg::ref_ptrosg::Texture2D create_rtt_texture(int width, int height) { osg::ref_ptrosg::Texture2D tex(new osg::Texture2D); tex-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); tex-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); tex-setTextureSize(width,height); tex-setInternalFormat(GL_RGBA); return tex; } osg::ref_ptrosg::Camera create_scene_camera(osg::GraphicsContext* gc,osg::Texture2D* tex) { osg::ref_ptrosg::Camera camera(new osg::Camera); camera-setGraphicsContext(gc); camera-setRenderOrder(osg::Camera::PRE_RENDER); camera-setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); camera-setReferenceFrame(osg::Camera::RELATIVE_RF); camera-setViewport(0,0,tex-getTextureWidth(),tex-getTextureHeight()); camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); camera-attach(osg::Camera::COLOR_BUFFER,tex,0,0,false,4,4); camera-setClearColor(osg::Vec4(0.4,0.4,0.4,1)); return camera; } osg::ref_ptrosg::Camera create_hud_camera(osg::GraphicsContext* gc,osg::Texture2D* tex) { osg::ref_ptrosg::Camera camera(new osg::Camera); camera-setGraphicsContext(gc); camera-setRenderOrder(osg::Camera::PRE_RENDER);
Re: [osg-users] render main scene and 2d menu in single RTT
What you think? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58757#58757 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Not able to access http://www.openscenegraph.org/
Hi, Starting a few days ago, I am not able to access Code: www dot openscenegraph dot org using either Firefox or Chrome. I get the message Forbidden You don't have permission to access / on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. Thank you! Cheers, Norm[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58728#58728 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Couple of quest about Offset Polygon, Composite Viewer in window, license
Hi, I've got couple of questions in my mind I would be very glad if anyone can answer them. *How to achieve the effect of showing the edges of shapes along with rendered surface. So the edges becomes more emphasized and visible. The effect is similar to those which we get in rendering applications with features edges+rendered in Blender3D, 3DMax etc.. apps? *I do have a composite viewer example source (front, top, side, perspective) and I'm trying to figure out on how to put all this in a window, SetUpViewInWindow doesn't work in my case? *Is there any limitations on using OSG in commercial applications with disclosure, but my proprietary code will be in closed form? Thank you! Cheers, Sonya -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58763#58763 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render main scene and 2d menu in single RTT
Good day! What about my question? What you think? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58738#58738 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Scrolling a texture in runtime
Hi, I am currently developing a Head Up Display (HUD) for my application. My target right now is to load a part of image as a texture that will be the altitude indicator. I know how it works but I want to implement it using OSG :D. An image will contain the whole altitude scale ( i.e. from 0 to 1ft for example ), and depending on the current altitude of the plane, just a part of the image will be rendered in the scene and it shall scroll up and down when the altitude reading changes. ... Thank you! Cheers, Ahmed -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58710#58710 Attachments: http://forum.openscenegraph.org//files/pfd_alt_strip_931.bmp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] FBO - Write to texture array using sampleBuffer
Hi all, I would like to use shaders - especially a sampleBuffer to write to a floating point texture containing data. Do I have to setup an FBO and attach it to a camera? Is there another way to write to a buffer using shaders besides using an FBO? Regards Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58656#58656 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Geometry shader results in OGL error in OSG 3.2
Hello, First time posting. We developed an OSG based viewer using OSG 3.0.1. Recently, I upgraded to using OSG 3.2. We have a geometry shader that implements a billboard for trees. Even though I can still see the trees, they are no longer aligned with the line of sight (i.e. don't rotate to align normal with los). OSG does issue a warning when it renders with this geometry shader: OGL error is 1282 (i.e. generic INVALID operation error). Now nothing in our code has changed before I upgraded to OSG 3.2. I did notice that the offending call seems to be EmitVertex(), since if I omit that from the shader, I don't get the 1282 error, but obviously no billboards either. Would anybody in this forum be able to provide some hints on how I can fix this issue? May be something that needs to be done differently when using OSG 3.2? Thanks in advance, Paulo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58666#58666 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Applying shaders or other effects within a shaped region.
Hi, I am looking for some guidance to the right doc or example, or even just a hint or a few classes to look closely at. Essentially I want to create a piece of geometry that applies effects to any part of a node in its interior. What I would be modelling is a camera's field of view, so it will be a 4-sided frustum extending out (not unlike the osgthirdpersonview example). All surfaces that intersect should be painted in some fashion not unlike a strong light source would do. In fact I at first thought a light source might be desirable but it seems like I am limited to 8 of those, and I have not seen any way to light up the whole path (and not just the surfaces it hits) so it highlights the whole field of view. So I think semi-transparent frustum will do the trick, but I am wondering how I can apply a shader to only the parts of other nodes that intersect with it? In terms of the scene graph the nodes may not be anywhere near each other, but I want to shade their overlap. Typically these areas will not be animated although it'd be nice to have the option. I have looked also at the osgclip example since this seemed promising - but this example uses two copies of the model, with one being clipped out. Meaning that the ClipNode could not easily be moved around the scene unless it carried a full duplicate (with shaders applied) of the entire graph. Is this the best/only approach? Maybe it is not as much of a chore or not as expensive as it seems? I am new to 3d graphics in general but can accept a fairly technical description since I've been perusing the source code a while now and understand the mathematics of it fairly well. Thanks, Josh Sutterfield -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58553#58553 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] Looks like that VPB data can not be properly run on Android.
Hi,everyone. I produced some VPB data on windows and want to emerge it on Samsung noteIII.The App which i run the VPB data is OSGAndroidExampleGles2.Now the problem is that the only terrain emerge on the phone is which i read from the SDCARD.But It never show more details when i zoom in the viewer.I want to confirm that whether program know where to query the path of sourcefile on Android.Maybe someone encountered tha same problem and know how to fix it. I would appreciate your early reply. Thank you! Cheers, ZL -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57570#57570 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] Windows and weird error messages
I needed to get VPB working on Windows (Visual Studio 2010), and I ran into a bizarre compiler error that I'm sure you've heard about before: std::basic_ofstreamchar,struct std::char_traitschar ::`vbase destructor'(void) (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in SpatialProperties.obj I found, surprisingly enough, that giving vpb::LogFile an empty destructor made the error go away. Would it be possible to add an empty destructor to the master copy of the source code? I can't see how it would hurt other OSes Keith Steiger (who doesn't know how Subversion does the equivalent of a pull request) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56783#56783 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] VPB cannot dispatch task files dynamicly on android
Hi,everyone. I had a project which need emerging VPB data on android.now,i can show the Texture of VPB data(through changing the format of images),but i found that the terrain showing on the phone which can never dispatch files(the ives) dynamicly when i change the angle of view.The phone always shows the file which i read from the sdcard.Didn't the VPB know the Path index on the android plateform,or some other reasons? I would be apreciated it if someone can help! ... Thank you! Cheers, ZL -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57559#57559 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] Change the position and rotation angle of the camera
Hi, I draw a box using addDrawable. Then I want to change the position and rotation angle of the camera by: viewer-getCamera()-setViewMatrix(cameraTranslationMatrix); But actually it makes no change to the camera. The cube is still in the center of the screen after run the scene. I also tried to update the frame by using the following code, but also failed: while(!viewer-done()) { viewer-getCamera()-setViewMatrixAsLookAt(eye,center,up); viewer-frame(); } Would anyone tell me what could I do to move the camera? Thank you! Cheers, Becky -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58769#58769 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Why isn't OSG popular and used?
Hi. I was asking the same question some time ago: http://forum.openscenegraph.org/viewtopic.php?t=10308 2014-04-01 17:34 GMT+07:00 Jaime xatp...@hotmail.com: First of all, I wanna to introduce me because it is my first post in the forum. Hello everybody :) I have been learning and using OSG for 6 months, and I am very surprised with it. I think it has a lot of power, specially with the future about OpenGL. So, I have a question. As I salid in the subject...why is not OSG popular and used?? If I look for information, there are not so much. Also, all the info is very very old. What do you think about it? Do you think that OSG has a potential power future, specially with video games? Thanks for your answers! Cheers, Jaime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58770#58770 ___ 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] osg 3.2.0 rendering problem vs osg 3.1.2
Hi, I saw this issue while reading the forum. I don't use a custom camera. Even if I try to call setGlobalDefaults() I still get the same problem. Here is my code: Code: //Creating the viewer osgViewer::Viewer viewer; viewer.setUpViewInWindow(200, 200, 800, 600); osg::ref_ptrKeyboardHandler keyboardEvent(new KeyboardHandler()); viewer.addEventHandler(keyboardEvent.get()); // Camera osg::ref_ptrosg::Camera camera = viewer.getCamera(); //Tried With or Without this line camera-getOrCreateStateSet()-setGlobalDefaults(); viewer.setSceneData(root.get()); viewer.realize(); if (!viewer.getCameraManipulator() viewer.getCamera()-getAllowEventFocus()) { viewer.setCameraManipulator(new osgGA::TrackballManipulator()); } viewer.setReleaseContextAtEndOfFrameHint(false); Thank you! Cheers, alexis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58848#58848 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg 3.2.0 rendering problem vs osg 3.1.2
Hi. I was getting similar result when I was using custom camera. The revision that introduced the change in SVN was 13604 (July 2 2013), version 3.1.9 or 3.1.10. If these versions don't break rendering for you, you should simply hunt the necessary revision in SVN. That's what I did. 2014-04-09 18:43 GMT+07:00 alexis pierre osgfo...@tevs.eu: Hi, I saw this issue while reading the forum. I don't use a custom camera. Even if I try to call setGlobalDefaults() I still get the same problem. Here is my code: Code: //Creating the viewer osgViewer::Viewer viewer; viewer.setUpViewInWindow(200, 200, 800, 600); osg::ref_ptrKeyboardHandler keyboardEvent(new KeyboardHandler()); viewer.addEventHandler(keyboardEvent.get()); // Camera osg::ref_ptrosg::Camera camera = viewer.getCamera(); //Tried With or Without this line camera-getOrCreateStateSet()-setGlobalDefaults(); viewer.setSceneData(root.get()); viewer.realize(); if (!viewer.getCameraManipulator() viewer.getCamera()-getAllowEventFocus()) { viewer.setCameraManipulator(new osgGA::TrackballManipulator()); } viewer.setReleaseContextAtEndOfFrameHint(false); Thank you! Cheers, alexis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58848#58848 ___ 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] Why isn't OSG popular and used?
On Tue, Apr 1, 2014 at 12:34 PM, Jaime xatp...@hotmail.com wrote: So, I have a question. As I salid in the subject...why is not OSG popular and used?? I think it depends a lot on the definition of popular and used. OSG can be found as a part of many professional visualization and simulations systems, driving big installations. It maybe just isn't as visible, because it is only one of many parts such installation uses. Also, these are usually not mass-market projects with millions in marketing and advertising budgets, so you are not likely to be aware of them unless you are directly involved, even though the price of such installation can exceed the development budget of an AAA game title several times ... If you are looking at game development, this has been answered before - OSG is not a game engine and while it can be used to build one (e.g. the Delta3D engine or the Worldviz Vizard toolkit), it is not something people looking for an integrated engine like Unity or Unreal will typically want to do. A typical game has a shelf life of 6-12 months, spending months building your own engine on top of OSG with such rapid turnover is not likely going to be worth the investment for most people. Also, dedicated game engines usually come with artwork production pipelines and such - OSG doesn't have that. While it is not horribly complicated, it is a significant time investment which pays off only long term. With Unreal or Unity you get these things as part of the package. On the other hand, if you need flexibility, because you must adapt to things like driving a head-mounted display or a full motion flight simulator, CAVE and such you will want OSG. Many of these things are either very complicated or outright impossible to do with a typical game engine. Ogre3D has been mentioned by others, however, Ogre isn't really in the same ballpark as the big commercial engines like Unreal or even Unity. The documentation is poor (collecting random code snippets buried in their forums is not proper documentation, IMO), the tools are basic at best, the engine itself is fairly dated, with the OpenGL renderer being outright horrible. If I look for information, there are not so much. Also, all the info is very very old. I think the http://www.openscenegraph.com/ has all the documentation you may ever want and it is fairly current, even if it is old. OSG has a pretty stable design and most of the core concepts haven't really changed in years. Some of my old code from 2002-2003 still works even with the current OSG, perhaps with minor fixes - 10 years later. What do you think about it? Do you think that OSG has a potential power future, specially with video games? I think that depends on the game developers. OSG has the bits you would want to build a very good game engine, but it isn't one out of the box. On the other hand, if you need a solid foundation that you can rely on and where you are sure that your middle-ware vendor will not pull the rug from under you in the long term by a sudden license change, royalties hike or even discontinuation of the product you are depending on, OSG could be hard to beat. Regards, Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Camera callbacks
Hi, I very like the capability of osg::Node to register any number of update, event and cull callbacks. This allows for a nice modular approach with each module registering callbacks for anything they wish without disturbing others. I came to a problem that Camera can register just one Initial-,Pre-,Post-, and Final-DrawCallback. Surely, I can register my own callback container that would call all my registered callback. But that is not compatible with OSG- registered Callbacks, for instance OcclusionQueryNode would overwrite my callback container. Could we possibly make the similar approach for the camera as for osg::Node? I can volunteer to make the first iteration for osg- submissions, if the community and Robert thinks that it is a good idea. My idea for implementation would be to append ref_ptrDrawCallback _nestedCallback into the Camera::DrawCallback structure, append Camera::add*Callback() and Camera::remove*Callback() and make Camera::callCallbacks(DrawCallback *cb) with a parameter giving pointer to the first DrawCallback of Initial-,Pre-,Post-, and Final- DrawCallback list. An alternative would be to let the user call nested callbacks from DrawCallback::operator(), but as we would always want (probably) to call all the callbacks and never stop in the middle of the work, I personally like the first approach more and it is more compatibility-friendly, as users will not need to modify their existing callbacks to get the new multi-callback capability. But I am ok with any approach. Do you think it is a good idea? John ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgCompute] osgCompute Questions [or... osgCompute vs. roll my own CUDA in OSG]
Hi, I need to render a scene to a texture, then process the texture via a CUDA kernel, then render resulting texture to quad. I see that the osgRTTDemo in osgCompute seems to do what I need, but I am wondering if I really need/want to use invest in using osgCompute rather than implement my own. I am not certain I want to tie my project to another 3rd party project and I also have concerns about osgCompute: A) Does it supports the latest CUDA (v6RC and eventually 6 production) and does it suppport some of the newer features found in 6 such as unified memory. B) Is osgCompute currently maintained and if so will it continue to be maintained. CD ... Thank you! Cheers, Conan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58852#58852 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to modify projection matrix from (own) CameraManipulator directly
Hi, we'd like to implement our own camera manipulator class in order to have more control of the projection matrix. What we want to implement is e.g. a zooming function in othografic projection. This can only be done by adjusting the FOV of the ortho frustum. Also, we would like to implement a Grab panning, where a object maintains under the cursor, while panning the scene (as known from several 2D programs). Here again, the projection matrix has to be known inside the camera manipulator in order to sync mouse movements with the appropriate movements in world coordinates. What we don't know, how to implement this correctly, since the projection matrix is updated somewhere automatically by the values of the Manipulator (position, look-at, up-direction ...) Do you have some advice? Cheery, Martin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Odd Font/Text issue
An update to the issue since it was first posted. Sorry, I couldn't edit the post while pending for approval. The strangest thing happened when I started to change the text of those initial labels; the displaying osgText instances later loaded only showed characters which has already been rendered/loaded/displayed by that first set. If I artificially set one osgText instance with all letters a-z, capitals, numbers, and symbols, any subsequent osgText drawables I add to the scene show up perfectly. Thanks, Josh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58853#58853 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera callbacks
Hi John, Original Node callbacks didn't support multiple callbacks, but I worked out that I could add the functionality relatively non-intrusively by nesting callbacks. The key advantage with nesting is that it enables a callback retain data on the stack within the local scope of the callback - which makes things easy to implement and gives you thread safety for free, and enables the callback to take complete controlling traversal. Providing similar support for Camera::DrawCallbacks would be possible, there isn't the same imperative for controlling traversal, but it'd keep the public Camera API simple - it's complicated enough as it is so am reluctant to add further API to it. The alternative would be to add a list of callbacks, but as you said this would break compatibility. Robert. On 9 April 2014 14:10, PCJohn pec...@fit.vutbr.cz wrote: Hi, I very like the capability of osg::Node to register any number of update, event and cull callbacks. This allows for a nice modular approach with each module registering callbacks for anything they wish without disturbing others. I came to a problem that Camera can register just one Initial-,Pre-,Post-, and Final-DrawCallback. Surely, I can register my own callback container that would call all my registered callback. But that is not compatible with OSG- registered Callbacks, for instance OcclusionQueryNode would overwrite my callback container. Could we possibly make the similar approach for the camera as for osg::Node? I can volunteer to make the first iteration for osg- submissions, if the community and Robert thinks that it is a good idea. My idea for implementation would be to append ref_ptrDrawCallback _nestedCallback into the Camera::DrawCallback structure, append Camera::add*Callback() and Camera::remove*Callback() and make Camera::callCallbacks(DrawCallback *cb) with a parameter giving pointer to the first DrawCallback of Initial-,Pre-,Post-, and Final- DrawCallback list. An alternative would be to let the user call nested callbacks from DrawCallback::operator(), but as we would always want (probably) to call all the callbacks and never stop in the middle of the work, I personally like the first approach more and it is more compatibility-friendly, as users will not need to modify their existing callbacks to get the new multi-callback capability. But I am ok with any approach. Do you think it is a good idea? John ___ 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] Odd Font/Text issue
HI Josh, The behaviour sounds pretty odd, the osgText library has been in existence for quite a while and mostly just works without problems. The biggest variable is likely to be the OpenGL driver, in particular some OpenGL drivers haven't implemented texture subloading correctly, I guess there is chance this is the issue with your system. What hardware/OS/drivers are you using? Do examples like osgtext work fine? If have other hardware/OS/drivers available I would suggest testing on these to see if it give your any more understanding of the way the problem manifests itself. Robert. Robert. On 9 April 2014 15:45, Josh Hamell jham...@sift.net wrote: An update to the issue since it was first posted. Sorry, I couldn't edit the post while pending for approval. The strangest thing happened when I started to change the text of those initial labels; the displaying osgText instances later loaded only showed characters which has already been rendered/loaded/displayed by that first set. If I artificially set one osgText instance with all letters a-z, capitals, numbers, and symbols, any subsequent osgText drawables I add to the scene show up perfectly. Thanks, Josh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58853#58853 ___ 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] OSG Android App works on phones, but not on tablets
Hi David, we played around with android quite successfully. We could even run OSG on the emulator, even if everyone says that it doesn't work. Most of the problems come up, when creating the egl surface. Each device is different and supports different configurations of depth and stencil buffer. So you might play around with these 16 and 8 values in your code. Try to use mview.Init(false, 0, 0) as a first step. Also have a look into the NDK GLES examples where they show, how to debug the EGL configuration. Cheers, Martin Am 09.04.2014 13:22 schrieb David city...@live.com: Hi, I was trying the OsgAndroid's buillt-in application OsgSimple, it worked great on the Android phones, but the same apk file does hangs up on the tablet devices. Debugging into it shows that the program hangs at below code line: mViewer = new Viewer(this); Does any one know how to solve this? Or did you encounter same issue or have any suggestions? Thanks. Cheers, David -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58679#58679 ___ 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] How to change content in HUD camera dynamically
Hi, I'm a bit stucked on one general problem. I have a HUD camera with which I draw some text from time to time on a screen. Just like Font-Text-Geode-Camera. How to change that content in Geode? ( Content = just some text.. ) I tried removeChildren(current Geode) and then addChild( new Geode) but it often ends up with segmentation fault. What is the best way to do it? Using switch is not an option, because that text I want to render is pretty random. Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58859#58859 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change content in HUD camera dynamically
Hi, First, make sure the mutable elements of your scene are assigned DYNAMIC variance. Even once your thread of control has returned from the frame() call (if that is how you are running this), background threads from traversals may still be ongoing. If you set an element to DYNAMIC, it knows to complete the update and event traversals for that node before returning from the frame() call. And after applying the above, if all you are doing is changing the osgText, why not use setText() instead of adding/removing the Geode? Thanks, Josh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58860#58860 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Odd Font/Text issue
Hi Robert, Thank you for your response. I've used OSG a few different projects now, and I agree, this is bizarre. We're using homogeneous, fairly locked down machines. All are: OS: Win 8.1 Pro 64 Card: Quadro K5100M It seems I can hack it by initially setting a text drawable which contains *every* character (or at least the limited ASCII set for now), then setting it back to empty, before adding it to the scene graph. I'm yet unsure whether the sufficient piece is to add this for *just* the first drawable, or apply this for all added text drawables. I'll continue to debug. Running OSG as part of OsgEarth, if that makes a difference. Our first pass was to add raw osg::Geometry, Transforms, Text, Image etc to the scenegraph before looking at what the OsgEarth-specific Features/Symbols/Annotations offered. I've tried it both by having the text nodes share the same font instance, or each explicitly loading their own (same font name). Seems to make no difference. Thanks, Josh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58861#58861 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change content in HUD camera dynamically
jhamell wrote: Hi, First, make sure the mutable elements of your scene are assigned DYNAMIC variance. Even once your thread of control has returned from the frame() call (if that is how you are running this), background threads from traversals may still be ongoing. If you set an element to DYNAMIC, it knows to complete the update and event traversals for that node before returning from the frame() call. And after applying the above, if all you are doing is changing the osgText, why not use setText() instead of adding/removing the Geode? Thanks, Josh Thank tou so much! I dont know how could I overlooked setText()... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58862#58862 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Android App works on phones, but not on tablets
Hi Martin and David, Are you talking about osgAndroid's project on gitorious or the examples inside osg source code? If it's the osgAndroid project I haven't reviewed the project for some time since I'm pretty busy on other projects (osg related but for desktop) but if do you find a better approach for initialize the EGL context, I'd be glad to merge the changes :). Cheers, Rafa. 2014-04-09 19:07 GMT+02:00 Martin Siggel martinsiggel+...@gmail.com: Hi David, we played around with android quite successfully. We could even run OSG on the emulator, even if everyone says that it doesn't work. Most of the problems come up, when creating the egl surface. Each device is different and supports different configurations of depth and stencil buffer. So you might play around with these 16 and 8 values in your code. Try to use mview.Init(false, 0, 0) as a first step. Also have a look into the NDK GLES examples where they show, how to debug the EGL configuration. Cheers, Martin Am 09.04.2014 13:22 schrieb David city...@live.com: Hi, I was trying the OsgAndroid's buillt-in application OsgSimple, it worked great on the Android phones, but the same apk file does hangs up on the tablet devices. Debugging into it shows that the program hangs at below code line: mViewer = new Viewer(this); Does any one know how to solve this? Or did you encounter same issue or have any suggestions? Thanks. Cheers, David -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58679#58679 ___ 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 -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera callbacks
Hi Robert, Providing similar support for Camera::DrawCallbacks would be possible, there isn't the same imperative for controlling traversal, but it'd keep the public Camera API simple - it's complicated enough as it is so am reluctant to add further API to it. Sorry, I am not native English. By the last sentence do you mean that the multiple Camera::DrawCallback support must be as simple as possible or that you would prefer to not put it into the API? I am not pushing the things, but it seems that shadow classes are already not compatible with OcclusionQueryNode as they both register pre and post draw callbacks. And a programmer might want to make his own callbacks for profiling reasons, start various OpenGL queries, resize his own custom RenderBuffers used for HDR rendering whenever screen window resizes, etc. My idea was: struct OSG_EXPORT DrawCallback : virtual public Object { DrawCallback() {} DrawCallback(const DrawCallback,const CopyOp) {} META_Object(osg, DrawCallback); virtual void operator () (osg::RenderInfo renderInfo) const; virtual void operator () (const osg::Camera /*camera*/) const {} ref_ptrDrawCallback _nestedCallback; }; inline void addPreDrawCallback(DrawCallback* dc) { if (dc != NULL) { dc-_nestedCallback = _preDrawCallback; _preDrawCallback = dc; } } inline void removePreDrawCallback(DrawCallback* dc) { if (dc != NULL) { if (dc == _preDrawCallback) _preDrawCallback = _preDrawCallback-_nestedCallback; else { DrawCallback *c = _preDrawCallback; while (c) { if (c-_nestedCallback==dc) { c-_nestedCallback = c-_nestedCallback- _nestedCallback; dc-_nestedCallback = NULL; return; } } } } } Not sure if it is enough thread-safe. If you think that Initial-,Pre-,Post-, and Final-DrawCallback functionality has too many methods, we can make like see bellow, while possibly deprecating some of the current methods. enum DrawCallbackEnum { INITIALIZE_DRAW_CALLBACK = 0, PRE_DRAW_CALLBACK = 1, POST_DRAW_CALLBACK = 2, FINALIZE_DRAW_CALLBACK = 3 }; inline void addPreDrawCallback(DrawCallbackEnum which, DrawCallback* dc) { if( which 4 ) { ref_ptrDrawCallback c = _drawCallbacks[which]; } inline void removePreDrawCallback(DrawCallbackEnum which, DrawCallback* dc) { } ref_ptrDrawCallback _drawCallbacks[4]; // this replaces four variables John On Wednesday 09 of April 2014 16:16:31 Robert Osfield wrote: Hi John, Original Node callbacks didn't support multiple callbacks, but I worked out that I could add the functionality relatively non-intrusively by nesting callbacks. The key advantage with nesting is that it enables a callback retain data on the stack within the local scope of the callback - which makes things easy to implement and gives you thread safety for free, and enables the callback to take complete controlling traversal. Providing similar support for Camera::DrawCallbacks would be possible, there isn't the same imperative for controlling traversal, but it'd keep the public Camera API simple - it's complicated enough as it is so am reluctant to add further API to it. The alternative would be to add a list of callbacks, but as you said this would break compatibility. Robert. On 9 April 2014 14:10, PCJohn pec...@fit.vutbr.cz wrote: Hi, I very like the capability of osg::Node to register any number of update, event and cull callbacks. This allows for a nice modular approach with each module registering callbacks for anything they wish without disturbing others. I came to a problem that Camera can register just one Initial-,Pre-,Post-, and Final-DrawCallback. Surely, I can register my own callback container that would call all my registered callback. But that is not compatible with OSG- registered Callbacks, for instance OcclusionQueryNode would overwrite my callback container. Could we possibly make the similar approach for the camera as for osg::Node? I can volunteer to make the first iteration for osg- submissions, if the community and Robert thinks that it is a good idea. My idea for implementation would be to append ref_ptrDrawCallback _nestedCallback into the Camera::DrawCallback structure, append Camera::add*Callback() and Camera::remove*Callback() and make Camera::callCallbacks(DrawCallback *cb) with a parameter giving pointer to the first DrawCallback of
Re: [osg-users] How to modify projection matrix from (own) CameraManipulator directly
Hi Martin, There's a couple of ideas that come to my mind: 1) In the GUIEventHandler, the signature of the handle method is: handle (const GUIEventAdapter ea, GUIActionAdapter aa, osg::Object *, osg::NodeVisitor *) the aa is usually a osgViewer::View, where you can get the camera in your manipulator doing something like this: osgViewer::View* v = dynamic_castosgViewer::View*(aa); if(v) { osg::Camera *camera = v-getCamera(); camera-getProjectionMatrixAsOrtho(...); // compute new planes using your current zoom level camera-setProjectionMatrixAsOrtho(...); } 2) Set the viewer's camera to your manipulator in the initialization and use it in a similar way as the previous solution. Something like this: MyZoomManipulator* zoomManipulator = new MyZoomManipulator(viewer.getCamera()); viewer.setCameraManipulator(zoomManipulator); ... I hope it helps Regards, Rafa. 2014-04-09 16:41 GMT+02:00 Martin Siggel martinsiggel+...@gmail.com: Hi, we'd like to implement our own camera manipulator class in order to have more control of the projection matrix. What we want to implement is e.g. a zooming function in othografic projection. This can only be done by adjusting the FOV of the ortho frustum. Also, we would like to implement a Grab panning, where a object maintains under the cursor, while panning the scene (as known from several 2D programs). Here again, the projection matrix has to be known inside the camera manipulator in order to sync mouse movements with the appropriate movements in world coordinates. What we don't know, how to implement this correctly, since the projection matrix is updated somewhere automatically by the values of the Manipulator (position, look-at, up-direction ...) Do you have some advice? Cheery, Martin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Android App works on phones, but not on tablets
Thanks, Martin! Will have a try! Martin Siggel wrote: Hi David, we played around with android quite successfully. We could even run OSG on the emulator, even if everyone says that it doesn't work. Most of the problems come up, when creating the egl surface. Each device is different and supports different configurations of depth and stencil buffer. So you might play around with these 16 and 8 values in your code. Try to use mview.Init(false, 0, 0) as a first step. Also have a look into the NDK GLES examples where they show, how to debug the EGL configuration. Cheers, Martin Am 09.04.2014 13:22 schrieb David (): Hi, I was trying the OsgAndroid's buillt-in application OsgSimple, it worked great on the Android phones, but the same apk file does hangs up on the tablet devices. Debugging into it shows that the program hangs at below code line: mViewer = new Viewer(this); Does any one know how to solve this? Or did you encounter same issue or have any suggestions? Thanks. Cheers, David -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58679#58679 (http://forum.openscenegraph.org/viewtopic.php?p=58679#58679) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58867#58867 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Android App works on phones, but not on tablets
Hi Rafael, I tried the osgAndroid library on gitorious, as well as the examples osgAndroidExampleGLES1 in the osg source code. Both apps does not run on the Samsung Galaxy Tab. Rafa Gaitan wrote: Hi Martin and David, Are you talking about osgAndroid's project on gitorious or the examples inside osg source code? If it's the osgAndroid project I haven't reviewed the project for some time since I'm pretty busy on other projects (osg related but for desktop) but if do you find a better approach for initialize the EGL context, I'd be glad to merge the changes :). Cheers, Rafa. 2014-04-09 19:07 GMT+02:00 Martin Siggel martinsiggel+ (martinsiggel+): Hi David, we played around with android quite successfully. We could even run OSG on the emulator, even if everyone says that it doesn't work. Most of the problems come up, when creating the egl surface. Each device is different and supports different configurations of depth and stencil buffer. So you might play around with these 16 and 8 values in your code. Try to use mview.Init(false, 0, 0) as a first step. Also have a look into the NDK GLES examples where they show, how to debug the EGL configuration. Cheers, Martin Am 09.04.2014 13:22 schrieb David (): Hi, I was trying the OsgAndroid's buillt-in application OsgSimple, it worked great on the Android phones, but the same apk file does hangs up on the tablet devices. Debugging into it shows that the program hangs at below code line: mViewer = new Viewer(this); Does any one know how to solve this? Or did you encounter same issue or have any suggestions? Thanks. Cheers, David -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58679#58679 (http://forum.openscenegraph.org/viewtopic.php?p=58679#58679) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com (http://www.mirage-tech.com) -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58868#58868 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org