[osg-users] problem getting texture image from a model

2012-04-16 Thread Andrey Ibe
Hi everyone. I'm experiencing an issue with texture images. I am using line segment intersectors in a manner similar to picking. With a couple of models, the texture retrieving algorithm works fine, however, with one model it fails. This is the extract of the code: Code: osg::Drawable

Re: [osg-users] getting eye position / direction

2012-04-15 Thread Andrey Ibe
Hi, this post is for those reading this thread wondering how i solved the issue. I solved it by creating the line segment intersectors in model coordinate space, transforming the starting/ending point using this matrix: Code: osg::Matrixd matrix;

Re: [osg-users] making a copy of camera root node or whole scene graph

2012-04-15 Thread Andrey Ibe
Hi guys, I solved the issue NOT using a osg::Camera at all. It caused a series of other fatal issues (culling away some geometry, that was then missing in reflections). anyone doing ray-tracing, do not use osg::Camera as a root of your scene for intersectionVisitor ! it will fail with

Re: [osg-users] default lighting

2012-04-15 Thread Andrey Ibe
Hi, just a guess - try global ambient intensity. i'm using this code: Code: osg::LightModel *lightModel = collisionStateSet ? dynamic_castosg::LightModel* (collisionStateSet-getAttribute(osg::StateAttribute::LIGHTMODEL)) : NULL; if (lightModel) { globalAmbientIntensity =

Re: [osg-users] getting correct light position

2012-04-12 Thread Andrey Ibe
Hi, update: working! ... almost correctly I have recently realized, that the problem may be caused by me not treating the fourth vector component (w) well - but if i use .project() method of either osg::Vec4d or osg::Vec4dH, it produces infinity for directional lights, which is expected, but

Re: [osg-users] Multiple views

2012-04-05 Thread Andrey Ibe
Hi, i'm not really an experienced user, i have issues of my own, but i have a couple of suggestions for you: check the osgCompositeViewer example and its source code - there you can find a way to open several views in one window as well as open several windows, as you please. for having

[osg-users] making a copy of camera root node or whole scene graph

2012-04-05 Thread Andrey Ibe
Hello everyone! I am using line segment intersectors to do ray-tracing. i trace rays from the window into the scene and then the consequent rays. This will be a no-time answer for those fluent with scene graph, i'm sure. i have a scene and a osgViewer::View, in which the scene is displayed. i

Re: [osg-users] getting eye position / direction

2012-03-31 Thread Andrey Ibe
update: Code: // get matrices osg::Matrix matrix; matrix.preMult(_tracer-getCamera()-getViewport()-computeWindowMatrix()); matrix.preMult(_tracer-getCamera()-getProjectionMatrix()); matrix.preMult(_tracer-getCamera()-getViewMatrix()); // invert osg::Matrix inverse; inverse.invert(matrix); //

Re: [osg-users] getting eye position / direction

2012-03-30 Thread Andrey Ibe
Hello again! I've just realized i do need to be able to translate the starting and ending points of a LineSegmentIntersector created in WINDOW coordinate frame into the WORLD coordinate space. is there any simple method to do so ? by retrieving them from the intersector or its intersection. i

Re: [osg-users] getting correct light position

2012-03-28 Thread Andrey Ibe
Hi and thank you for the quick suggestion. i double checked. i treat all three types of the light equally, in terms of vector mathematics. the only difference is the attenuation stuff, but these values are scalar. Cheers, Andrey -- Read this topic online here:

Re: [osg-users] getting eye position / direction

2012-03-18 Thread Andrey Ibe
again, thank you, robert. now i know i'm getting correct results. regards, Andrey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46391#46391 ___ osg-users mailing list

[osg-users] getting eye position / direction

2012-03-09 Thread Andrey Ibe
Hi, i am trying to get eyePosition and direction, more precisely, the direction of a ray for the purpose of ray tracing. this is what i am doing: Code: const osg::Vec3d collisionPoint = intersection.getWorldIntersectPoint(); ... osg::Vec3d eyeDirection = collisionPoint - _tracer-getEye();

Re: [osg-users] getting eye position / direction

2012-03-09 Thread Andrey Ibe
i am trying to compute the direction of an osg::LineSegmentIntersector object. i can get the collision point and i am trying to get the starting point - i need the vector of the intersector's direction. i do this for the purpose of ray tracing (or ray casting). i create the intersectors this

Re: [osg-users] request new frame manually

2012-02-27 Thread Andrey Ibe
Thank you, Robert! it worked well. for the record, the correct call is made on osg::View Code: _view-requestRedraw() I am puzzled how i could have missed the method in the sources :? Cheers, Andrey -- Read this topic online here:

[osg-users] request new frame manually

2012-02-26 Thread Andrey Ibe
Hello world! Until recently i had been using Code: _viewer-setRunFrameScheme(osgViewer::ViewerBase::CONTINUOUS); but then i switched to Code: _viewer-setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND); and now i have a minor problem with window refresh. This should be fairly simple to do,

[osg-users] OpenThreads reference manual, documentation or tutorial

2012-01-29 Thread Andrey Ibe
Hello all the OSG enthusiasts and gurus! Is there any tutorial for OpenThreads? or at least a reference manual for the current OSG version, preferably with some comments? all i have is a reference manual lacking almost any comments (i mean descriptions of classes, methods and parameters, data

Re: [osg-users] OpenThreads reference manual, documentation or tutorial

2012-01-29 Thread Andrey Ibe
hi there! my post was NOT in any way a criticism of the developers. i am only frustrated ... well you read it anyway. what i wanted to say - maybe, a couple of lines, a single sentence - it helps a LOT. i really think this is the biggest downside of the OSG. i can't say anything else than good

[osg-users] IntersectionVisitor - low performance and NO performance boost with KdTrees enabled.

2012-01-06 Thread Andrey Ibe
Hi, i finally got to cast some rays with my ray-casting application and i found out the perforamce is terribly low. i am not sure how fast the intersections should be counted, but i am pretty sure that an image 160x120 pixels (which is 19200 points) should be computed in less than 5.5 seconds

Re: [osg-users] starting with stencil buffer to achieve ray tracing

2012-01-06 Thread Andrey Ibe
Thank you, Robert. I won't implement this then. i realized later that this might be just a minor optimization, if the Kd-Trees were working properly. Cheers, Andrey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44666#44666

Re: [osg-users] IntersectionVisitor - low performance and NO performance boost with KdTrees enabled.

2012-01-06 Thread Andrey Ibe
Hello, Robert and thank you for the swift reply. The scene is quite simple, it's actually just a room with a mirror, table and a couple of spherical objects. There are 126 drawables (all are fast drawables), 16k vertices and 5.3k triangles. I have just tried building the app with -O3 -DNDEBUG

Re: [osg-users] IntersectionVisitor - low performance and NO performance boost with KdTrees enabled.

2012-01-06 Thread Andrey Ibe
hello! here is the scene [Image: http://img441.imageshack.us/img441/6236/sceneviewwireframe.png ] so what do you think? and here i was thinking the built-in kd tree support will save me the time of implementing kd-trees, eh thanks Andrey -- Read this topic online here:

Re: [osg-users] IntersectionVisitor - low performance and NO performance boost with KdTrees enabled.

2012-01-06 Thread Andrey Ibe
now this is strange - i loaded a much more complex model with 250k vertices and 83k triangles, but with only 13 primitive sets / drawables, and given the same resolution (160*120 px) i get a frame in 0.6 seconds with KdTrees enabled and in approx. 10 - 12 seconds if they are disabled. now i at

Re: [osg-users] simple window manager to reopen a window

2012-01-02 Thread Andrey Ibe
another update: now i got rid of the error by setting the start tick timer of the viewer to be equal to the timer on the existing main scene view this way Code: osg::Timer_t timer = _sceneView-getStartTick(); _viewer-realize(); _viewer-setStartTick(timer); i can even omit the command with

Re: [osg-users] simple window manager to reopen a window

2012-01-01 Thread Andrey Ibe
thank you sth! i am now able to store the state of the window. never the less, with the error going on i am still not able to move forward. i forgot to mention, that if i try to open the window and run the realize() method on my compositeViewer - in say 5 seconds from launching the

Re: [osg-users] simple window manager to reopen a window

2012-01-01 Thread Andrey Ibe
update: i found this thread http://forum.openscenegraph.org/viewtopic.php?t=9176 and using this command Code: _viewer-setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND); i got rid of the annoying irresponsivness. i am still getting the error though. however, i bumped into another issue -

[osg-users] simple window manager to reopen a window

2011-12-30 Thread Andrey Ibe
Hi, i'm trying to create some kind of window manager, which would allow me to open a certain pop-up window with RTT camera on request and later reopen it if it has been closed. i was looking for some kind of window onClose callback function to allow me to store the current window state

Re: [osg-users] starting with stencil buffer to achieve ray tracing

2011-12-02 Thread Andrey Ibe
thank you filip! this might just be what i was looking for :) but i'm getting OpenGL errors here ... Code: Warning: detected OpenGL error 'invalid operation' at end of SceneView::draw() Warning: detected OpenGL error 'invalid operation' at start of State::apply() the letter one keeps piling

Re: [osg-users] starting with stencil buffer to achieve ray tracing

2011-12-02 Thread Andrey Ibe
filip, that line of code solved the problem! thank you so much! now i have to bend the code i have a bit for my purpose. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44189#44189 ___ osg-users

Re: [osg-users] [osgPlugins] png plugin - problem loading images

2011-12-01 Thread Andrey Ibe
hi laurence! i have got zlib1.dll in my path env.. it is the one i used for building the libpng15.dll dynamic library. both libs i used to build the OSG. i kept every single dynamic library i built during the process of compiling the osg in my compiler's bin folder, which is in my system PATH

Re: [osg-users] [osgPlugins] png plugin - problem loading images

2011-11-30 Thread Andrey Ibe
thank you for the tip. i tried locating the libpng library and i found there was a file libpng15.dll in the system path. i don't really know how this library file-name-thing really works so i renamed it to libpng.dll and tried running my osg app again, but without any success. i will try the

[osg-users] starting with stencil buffer to achieve ray tracing

2011-11-30 Thread Andrey Ibe
hello good people! i need a bit of advice ragarding some more advanced rendering techniques. advanced for me, anyway. i am trying to build a simple ray tracing application on top of the basic osgviewer program. to start off, i am trying to look at the loaded model and decide where to cast

Re: [osg-users] starting with stencil buffer to achieve ray tracing

2011-11-30 Thread Andrey Ibe
basically, what i want to do is to cast primary rays from the camera (for each pixel on the screen) into the scene using line intersectors. then i want to retrieve normal of the intersection to be able to compute the direction of the secondary ray and then to cast it the way i cast the primary

[osg-users] [osgPlugins] png plugin - problem loading images

2011-11-25 Thread Andrey Ibe
Hello good ppl! i am quite new to OSG, though i managed to build it from source with several plugins. now one of them is not working - PNG. and i do need it. i am using MinGW gcc compiler suite and w7/x64 system. i built osg 3.xy from sources, with libpng, zlib, libjpg and coin plugins, which