Re: [osg-users] Question about ProjectionResizePolicy - no option for both HORIZONTAL and VERTICAL?
Hi, Ron What meaning would have BOTH option? Each of HORIZONTAL and VERTICAL keep your projection aspect ratio same as window aspect ratio, difference is which one of horizontal fow or vertical fow they keep constant ( other is changed to match window aspect ratio ). Cheers, Sergey. 09.08.2012, 23:32, Ron Mayer rabra...@kns.com: Hello everybody, I would like my camera's projection matrix to change both horizontally and vertically when the window is re-sized. [The reason for this is because I want my frustum's aspect ratio to match the window aspect ratio so the objects do not get distorted when re-sizing] I noticed osg::Camera::setProjectionResizePolicy can do only FIXED (none), HORIZONTAL, or VERTICAL. Is there a reason why there is no BOTH option? I am about to write my own Resized callback, and I imagined there might be a reason for not having this. Thanks! Ron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49217#49217 ___ 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] [forum] Site web down
Hi all, I'm on holydays now and writting from my phone, i will try to reboot the server as soon as i have access to a computer. Sorry for the inconvenience.. :( El jueves, 9 de agosto de 2012, Felix Meißgeier escribió: Thanks good tip ;) Chris Hanson wrote: On Thu, Aug 9, 2012 at 9:27 AM, Felix Meißgeier () wrote: Hey Robert, I think openscenegraph.org (http://openscenegraph.org) is actually down again. Do you know when it will be reachable again? I wanted to read the CameraControlFindingWorldCoordinates tutorial... Use the Force... err, the Google Cache: http://webcache.googleusercontent.com/search?q=cache:tdQzRfxZVR0J:www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraControlFindingWorldCoordinates+cd=1hl=enct=clnkgl=us( http://webcache.googleusercontent.com/search?q=cache:tdQzRfxZVR0J:www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraControlFindingWorldCoordinates+cd=1hl=enct=clnkgl=us ) -- Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/ ( http://www.alphapixel.com/) Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49214#49214 ___ osg-users mailing list osg-users@lists.openscenegraph.org javascript:; 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
[osg-users] Interesting Problem with Segmentation Fault in eventTraversal
Hi, So here is the catch, my window is created full screen but it is inside of a Virtual Machine running in VMware. I have vmware tools installed to I get seamless mouse transitions through between guest and host. I'm using CompositeViewer and it doesn't matter if I set the camera manipulator to NULL or the Trackball manipulator or anything else. Whenever the mouse is moved outside the viewer window OSG hits a segmentation fault in osgViewer::CompositeViewer::eventTraversal() called from osgViewer::ViewerBase::frame() I'm running OSG 3.0.1 on linux (Fedora Core 17) with the OSG packages available with the distribution. So I can understand maybe some odd behavior from the trackball manipulator when the mouse is moved outside the window or something like that but a segmentation fault??? Anyone have any ideas? I haven't setup a debug version of OSG to use yet to try and figure out why this is happening but I was hoping someone here might have either tried this or have some conceptual idea of what is going on based on their massive and awesome knowledge of OSG :) Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49222#49222 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Interesting Problem with Segmentation Fault in eventTraversal
Hi, Mike With crash under debugger at hand you gonna know precisely what happening in a few minutes... what point in guessing? Also backtrace (even from release build) would help a lot. 10.08.2012, 12:47, Mike Hatcher mike.hatche...@yahoo.com: Hi, So here is the catch, my window is created full screen but it is inside of a Virtual Machine running in VMware. I have vmware tools installed to I get seamless mouse transitions through between guest and host. I'm using CompositeViewer and it doesn't matter if I set the camera manipulator to NULL or the Trackball manipulator or anything else. Whenever the mouse is moved outside the viewer window OSG hits a segmentation fault in osgViewer::CompositeViewer::eventTraversal() called from osgViewer::ViewerBase::frame() I'm running OSG 3.0.1 on linux (Fedora Core 17) with the OSG packages available with the distribution. So I can understand maybe some odd behavior from the trackball manipulator when the mouse is moved outside the window or something like that but a segmentation fault??? Anyone have any ideas? I haven't setup a debug version of OSG to use yet to try and figure out why this is happening but I was hoping someone here might have either tried this or have some conceptual idea of what is going on based on their massive and awesome knowledge of OSG :) Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49222#49222 ___ 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(terrain) krasches on a double delete
I have now also reproduced the crash on darwin/osx in i386 mode. Cheers, Ola On Thu, 09 Aug 2012 17:41:12 +0200, Ola Nilsson o...@weatherone.tv wrote: Here is some more info on how to reproduce our crash. 1. Compile the attached osgterrain program by overwriting examples/osgterrain/osgterrain.cpp and recompile. 2. Run the program with http://www.openscenegraph.org/data/earth_bayarea/earth.ive as input. 3. Wait (no further input is necessary). However, camera movement (tile loading) produces earlier crashes. The attached image shows performance of a typical run (without user input) where the frame time cyclically increases until the program crashes. Cheers, Ola ps. The output from the program is: iteration sample_ratio frame_time On Tue, 07 Aug 2012 11:59:00 +0200, Ola Nilsson o...@weatherone.tv wrote: Hi, We have been looking for a hard-to-reproduce crash in our software that seems to originate from a double delete inside osg. I have (finally) been able to reproduce the crash using a version of the osgterrain-example that _exaggerates_ the usage pattern that crashes our application. In examples/osgterrain.cpp remove return viwer.run(); an exchange it with: while(!viewer.done()) { osg::Timer_t start_tick = osg::Timer::instance()-tick(); float sr = rand() * 1.0 / RAND_MAX ; std::cerr sr; viewer.getCamera()-setLODScale(sr*10); terrain-setSampleRatio( sr ); osg::Timer_t middle_tick = osg::Timer::instance()-tick(); std::cerr osg::Timer::instance()-delta_m(start_tick, middle_tick) std::flush; viewer.frame(); std::cerr ' ' osg::Timer::instance()-delta_m(middle_tick, osg::Timer::instance()-tick()) std::endl; } return 0; When run (tested on ive earth models generated with osgdem) the frame time slowly increases, and, after a while, it warns about deleting a still referenced object and then (after arbitrary time) crashes with a glibc error. Is this usage (setLODScale + setSampleRatio) safe? If not how should these functions be called? If it's a bug, we would be _very_ happy to have it fixed or pointers about where to look in the code. We've previously submitted a patch that switched to a ReentrantMutex in osgTerrain/Terrain.cpp (changeset 12904), could this be a similar issue? My system is running Centos 6.3 (x86_64) and I compiled osg in debug mode with gcc 4.4.6. I have tested both against the 3.0.1 tag and trunk (r13106). Since I suspect a threading issue; OpenThreads/Config looks like this: #define _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS /* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */ /* #undef _OPENTHREADS_ATOMIC_USE_SUN */ /* #undef _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED */ /* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */ /* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */ /* #undef OT_LIBRARY_STATIC */ If I set a break point in the warning for deleting still referenced I get the following stack trace (using the osg 3.0.1 tag): Breakpoint 1, osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236 236 OSG_WARNWarning: deleting still referenced object this of type 'typeid(this).name()'std::endl; (gdb) bt #0 osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236 #1 0x779e467c in osg::Object::~Object (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Object.cpp:45 #2 0x779dd71d in osg::Node::~Node (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Node.cpp:94 #3 0x77993953 in osg::Group::~Group (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Group.cpp:53 #4 0x75df4ae8 in osgTerrain::TerrainTile::~TerrainTile (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95 #5 0x75df4b1e in osgTerrain::TerrainTile::~TerrainTile (this=0xaec2160, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95 #6 0x77a131a6 in osg::Referenced::signalObserversAndDelete (this=0xaec2160, signalDelete=true, doDelete=true) at /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:323 #7 0x0040b07d in osg::Referenced::unref (this=0xaec2160) at /home/ola/src/OpenSceneGraph-3.0.1/include/osg/Referenced:198 #8 0x0040cd3b in osg::ref_ptrosg::Node::~ref_ptr (this=0x478d410, __in_chrg=value optimized out) at /home/ola/src/OpenSceneGraph-3.0.1/include/osg/ref_ptr:35 #9 0x7799627e in std::_Destroyosg::ref_ptrosg::Node (__pointer=0x478d410) at /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_construct.h:83 #10 0x77996084 in
Re: [osg-users] Question about ProjectionResizePolicy - no option for both HORIZONTAL and VERTICAL?
hybr wrote: Hi, Ron What meaning would have BOTH option? Each of HORIZONTAL and VERTICAL keep your projection aspect ratio same as window aspect ratio, difference is which one of horizontal fow or vertical fow they keep constant ( other is changed to match window aspect ratio ). Cheers, Sergey. Hi Sergey, I am using orthographic projection. When the window size changes it is not enough just to adjust only the width or only the height of the frustum (projection matrix of camera), since doing that will distort the objects in the world in one axis, wouldn't it? I understand that maintaining an equal aspect ratio between the window and projection matrix can be done by modifying only one axis, but I also want to avoid my objects getting stretched or contracted in one axis. For example, let's say we start with a window of size 100X100, and a camera with an orthographic projection matrix of: (left, right, bottom, top) = (-50, 50, -50, 50). [ignoring near, far] Now the user modifies the window size to 50X75. If we only scale the projection matrix horizontally this means that our new projection matrix has the values of: (left, right, bottom, top) = (-25, 25, -50, 50). The width of the frustum was scaled by 1/2, but the height of the frustum did not change. The window height is now 75, which means the objects will not look correct in their Y values after the viewport transformation. On the other hand, I may be wrong, since there is no BOTH resize policy, for a good reason that I can't see ... so I am trying to understand where is my mistake. Thanks :D -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49225#49225 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about ProjectionResizePolicy - no option for both HORIZONTAL and VERTICAL?
Hi it works other way: assume you have window w*h with aspect w/h, and ortho projection x*y with same aspect. Window resizes to w1*h1 with some other aspect w1/h1 - projection now will be either: 1) x , (y*w*h1/(w1*h)) - if we keep horizontal fow constant or: 2) x*w1*h/(w*h1) , y - if we keep vertical fow constant with your numbers it gives projection: 1) (-50, 50, -75, 75), aspect 2/3 2) (-33.(3), 33.(3), -50, 50), aspect 2/3 and your new window aspect is same 2/3 you will get different _scale_, but it's uniform across screen, there is no stretching or smth. Cheers, Sergey. 10.08.2012, 16:32, Ron Mayer rabra...@kns.com: hybr wrote: Hi, Ron What meaning would have BOTH option? Each of HORIZONTAL and VERTICAL keep your projection aspect ratio same as window aspect ratio, difference is which one of horizontal fow or vertical fow they keep constant ( other is changed to match window aspect ratio ). Cheers, Sergey. Hi Sergey, I am using orthographic projection. When the window size changes it is not enough just to adjust only the width or only the height of the frustum (projection matrix of camera), since doing that will distort the objects in the world in one axis, wouldn't it? I understand that maintaining an equal aspect ratio between the window and projection matrix can be done by modifying only one axis, but I also want to avoid my objects getting stretched or contracted in one axis. For example, let's say we start with a window of size 100X100, and a camera with an orthographic projection matrix of: (left, right, bottom, top) = (-50, 50, -50, 50). [ignoring near, far] Now the user modifies the window size to 50X75. If we only scale the projection matrix horizontally this means that our new projection matrix has the values of: (left, right, bottom, top) = (-25, 25, -50, 50). The width of the frustum was scaled by 1/2, but the height of the frustum did not change. The window height is now 75, which means the objects will not look correct in their Y values after the viewport transformation. On the other hand, I may be wrong, since there is no BOTH resize policy, for a good reason that I can't see ... so I am trying to understand where is my mistake. Thanks :D -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49225#49225 ___ 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] OpenScenegraph Siggraph 2012 BOF Final Call for Presentations
Greetings eveyone that attened the OSG BOF for SIGGRAPH 2012 Had a good time at the BOF, look forward to next year. Thank you! David Glenn --- D Glenn 3D Computer Graphics amp; Media Systems. www.dglenn.com -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49227#49227 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about ProjectionResizePolicy - no option for both HORIZONTAL and VERTICAL?
hybr wrote: you will get different _scale_, but it's uniform across screen, there is no stretching or smth. Thank you for the detailed explanation, the only problem for me is that as you mentioned - I will get a different scale uniform across screen, that gives a zooming effect (I see 'less' of the world, and it appears the camera gets closer). I am trying to avoid that zooming effect. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49228#49228 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] a bug or feature in the osgb writer?
Hi all, I am noticing some odd behavior in the osgb file writer. I will try to describe it as succinctly as possible. Maybe it's a bug, maybe it's my code. We are using osg 3.1 0 on a CentOS 6 Linux system. A fairly large program create a points file that includes some shaders and textures which operate on the points. If the program writes the file as an ive or osg file the input geometry type in the file is POINTS, as is specified in the program, and I get no runtime errors. If the program writes the file as an osgb file the input geometry type in the file is TRIANGLES, or at least that's what I see when I convert the osgb file to an osg file. At runtime I get a bunch of spewed messages: Warning: detected OpenGL error 'invalid operation' at after RenderBin::draw(..) That is, doing nothing but changing the file type from ive to osgb causes the error. Extra information: I diffed the outputs of: env OSGNOTIFYLEVEL=debug OSG_OPTIMIZER=NONE osgconv points.osgb pointFromOsgb.osg and env OSGNOTIFYLEVEL=debug OSG_OPTIMIZER=NONE osgconv points.ive pointFromIve.osg and the ive run has the line Using vertex attribute instead repeated eight times. I doubt this has anything to do with it, as the ive file is the one that works, but you never know... I can dump more gory details on request, but as an initial email I thought I'd see if anyone familiar with the osgb writer had any ideas. Thanks, John ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [3rdparty] osgPango text in world space?
Hi all, I have a wireframe grid defined in 3-space that I want to put some labels on. I was able to get the result I wanted using osgText by using the code below where 'vert' is a world space vertex from the grid. Code: osgText::Text* text = new osgText::Text; text-setFont(font.get()); text-setCharacterSizeMode(osgText::Text::SCREEN_COORDS); text-setCharacterSize( 48.0 ); text-setDrawMode(osgText::Text::TEXT); text-setAxisAlignment(osgText::Text::SCREEN); text-setLayout(osgText::Text::RIGHT_TO_LEFT); text-setText(osgText::String(العربية, osgText::String::ENCODING_UTF8)); text-setPosition( vert ); The only reason I can't stick with osgText is the arabic characters do not render properly (the characters should be connected and they are not). This is a hard requirement for us so I presumably need osgPango. However, osgPango doesn't really seem to have parity with text placement and I wonder if it supports text in world space at all. I've tried the following code and just get extruded garbage on the screen (vert is the same world space coordinate as in the previous snippet). Code: osgPango::TextTransform* t = new osgPango::TextTransform(); t-setMatrix( osg::Matrixd::translate(vert) ); t-addText( span font='DejaVu Sans Mono 14' foreground='#7FFF7F'Testspan,0,0 ); t-finalize(); I have used osgPango in screen space successfully for other purposes. Anyone know if osgPango can work in world coords and if so how? Cheers, Trystan[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49230#49230 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] Shader Dev Tools
For what platform? A google search will turn up a bunch. Even for the iPad there's GLSL Studio. However, I have yet to find a good open source one that is consistently updated for Linux. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49232#49232 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] Shader Dev Tools
On Fri, Aug 10, 2012 at 3:10 PM, Trystan Larey-Williams trys...@trystan.org wrote: For what platform? A google search will turn up a bunch. Even for the iPad there's GLSL Studio. However, I have yet to find a good open source one that is consistently updated for Linux. If anyone knows how to get in touch with the authors of glslDevil, I'd really like to work on getting it maintained and open sourced. It's a GLSL source-level debugger, which nothing else I'm aware of does. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] osgPango text in world space?
Figured it out. It was simply a matter of scale. In my world coordinates the default scale of 1.0 for the text was enormous. The fix was just to; t-setScale(0.001, true). -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49234#49234 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem passing matrices as uniform
Hey, i've got a problem passing modelview-matrix as uniform to a vertexshader. I want to realize a object-motion-blur-effect and so I need the previous-mv-matrix. More precisely I guess (not to say I'm sure) that my passed matrix doesn't work. I read about some difference between the orientations of the opengl- and osg-coordinate system. Could this be a reason, why the fixed-builtin-uniforms gl_ProjectionMatrix, gl_ModelViewMatrix,... work perfectly and my matrix doesn't?? For testing purpose I created a simple shader which bypasses the clipcoords of a vertex to fragmentshader (gl_Position) and sets gl_FragColor to white (using my own projection-matrix). The computation gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex worked fine, but gl_Position = myownprojmat * gl_ModelViewMatrix * gl_Vertex failed. I tried different ways to generate the proj-matrix. I got it from my (pre-render-) camera which is the parent of my scene-root and I tried Code: osgViewer::Viewer::Contexts contexts; _viewer-getContexts(contexts); pmatrix=contexts[0]-getState()-getProjectionMatrix(); During my tests passing the modelview-matrix I used the view-matrix of the parental-camera and the computelocaltoworld(osg::Nodepath)-function... Maybe anybody has an idea where I've got the mistake or has a tip how to implement this. Thank you! Cheers, Felix -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49235#49235 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org