Re: [osg-users] OpenThreads::Condition and spurious wakeups
Hi, Cory Riddell wrote: I'm using boost::threads, but not any of the timed wait stuff. I run my viewer in its own thread. It is my understanding that for a timed wait, you do need to manually track how much time has actually elapsed Only if the time specified is a relative time. Pthreads uses an absolute time specifically for this problem. It's easy to restart with an absolute time in future and you don't have to keep track of time passed manually. OT does not have this facility, I'll double check if boost has relative/absolute time. The only reason I want to use the timed wait is to make sure the users of my app don't deadlock it waiting for a condition. If there is some other way to handle it without the timed wait, I'm interested. rgds jp and restart the wait if necessary. Cory J.P. Delport wrote: Hi all, I'm using OpenThreads in a cross-platform application and wanted to use the Condition implementation, specifically the wait(timeout) version. However, the pthread docs suggest that pthread_cond_timedwait (that is used by OT) can return without explicitly being signalled (so-called spurious wakeups [1]). Now if I used pthreads directly I can just put the wait in a while loop checking my condition, because pthread_cond_timedwait takes an absolute time as a parameter and not a relative time as OT::Condition does. With the current OT::Condition there is no way to easily restart the timed wait (one will have to keep track of time oneself and OT does not have functions for it). I've searched for places in OSG where the timed wait is used and it is not used much. It is used in block(timeout) too, but that is also not used much in OSG. However, in the new ffmpeg plugin there is also this comment before using the timed wait: ---8--- // We don't wait in a loop to avoid an infinite loop (as the ms timeout would not be decremented). // This means that timedPop() could return with (is_empty = true) before the timeout has been hit. ---8--- Does anyone have more information on how to handle this issue? Should I just write my code to cope with this limitation? Has anyone used boost threads (and associated sync utils) with OSG? rgds jp [1] see the pthread docs or http://en.wikipedia.org/wiki/Spurious_wakeup ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Accessing Texture Indices
Hi Omar, On 27/5/09 12:33 AM, Omar Alvi wrote: I am new to osg. I have loaded an obj file using osgDB but I don't know how to access vertex and texture indices. I can get the vertex array from the geometry using pGeo.get()-getVertexArray() method but pGeo.get()-getVertexIndices() returns null. I cant figure out how the indices are stored for the vertices and the texture. The model is loaded and displayed fine so there is definitely a problem in the way I am accessing the data. Would really appreciate any help. It might be that there simply are no vertex indices. Which would be good because then the rendering doesn't drop to the slow path. A good way to understand what's happening is to convert whatever you have to a .osg file using 'osgconv file.obj file.osg' You can then inspect it at your leasure in any text editor. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Accessing Texture Indices
omaralvi wrote: Hello guys, I am new to osg. I have loaded an obj file using osgDB but I don't know how to access vertex and texture indices. I can get the vertex array from the geometry using pGeo.get()-getVertexArray() method but pGeo.get()-getVertexIndices() returns null. I cant figure out how the indices are stored for the vertices and the texture. The model is loaded and displayed fine so there is definitely a problem in the way I am accessing the data. Would really appreciate any help. Thanks Hotmail® has ever-growing storage! Don’t worry about storage limits. Check it out. -- Post generated by Mail2Forum Hi! If your file isn't a .osg, you can convert it using osgconv in prompt. Once you have a .osg you can open it with a text editor, thus you can have an idea of how is your scene graph organized. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13006#13006 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Test post, very strange
On Wed, May 27, 2009 at 5:22 AM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: I'm posting to see if this message shows up. Oddly, a message I've tried to send to the list three times over the past few weeks, refuses to appear here. But my other replies seem to show up. Is there any sort of content-based filtering that might be eating my message? There isn't any content based filtering. The only filtering done presently is the rejection of email addresses that aren't subscribed to the osg-users list. Some mail clients silently don't display your own posts, perhaps this is something that is happening. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 2.10 schedule?
Hi Martin, On Tue, May 26, 2009 at 5:55 PM, Martin Beckett m...@mgbeckett.com wrote: Is there are a bigger picture roadmap for OSG? There isn't a formal roadmap. It goes where it goes to fulfill the needs of those who contribute to it. The direction it's heading and the kind of apps it is aimed at. On the list we often discuss items like where we'd like to take things, it's generally about either doing things better than we already do now, or encompassing new markets through adoption of API's like OpenGL ES etc. I know this depends on what code users submit but is there a master plan from the benevolent dictator? I actually get to dictate very little beyond what gets merged with svn/trunk and when we attempt to go for releases. I can hint to the community that I'd like to x or y feature developed or refactored, but such stuff only makes a difference if it chimes in with what community members already have in mind for their own work. It's a strangely chaotic development process, I don't get to choose what members of the community work upon, they just do what they do for the good of their projects that just so happen also to benefit the general community so we get to share in it. The secret to effectiveness to seemingly disordered process is that end users are developing real apps, they don't develop stuff unless it addresses a concrete need. This keeps things focused on useful functionality, rather than marketing bullet points. Oh the other secret is that is some rather talented engineers out there so the contributions are often of high quality, and the engineers also pour over the OSG source code and fix the bits where quality ain't what it should be. In the end order comes out of chaos. The OSG keeps chugging along getting better on each release ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PluginStrData....
Hi Robert, I hope you're over your cold/flu now? I'm looking at the PluginStrData work , and wondered whether you think the setPluginStrData and getPluginStrData should be made case insensitive? I was thinking to force the 'set' parameters through the osgDB::convertToLowerCase function. It would make checking for specific option string settings a little cleaner, and more robust. Neil ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] missed state set for a scene node
Hi All. I've forgotten to set a state set to a node (and it shouldn't be necessary, since it is just a switch, with any children that define its own state set; and in fact the state set for that switch should be a simple set that just sets a rendering bin to the default for opaque, 0), but I got strange visualization. Does a node need a state set, always? Thanks, Gianluca ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Test post, very strange
Robert Osfield wrote: On Wed, May 27, 2009 at 5:22 AM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: I'm posting to see if this message shows up. Oddly, a message I've tried to send to the list three times over the past few weeks, refuses to appear here. But my other replies seem to show up. Is there any sort of content-based filtering that might be eating my message? There isn't any content based filtering. The only filtering done presently is the rejection of email addresses that aren't subscribed to the osg-users list. Some mail clients silently don't display your own posts, perhaps this is something that is happening. Note that there is also a mailman setting to specify if you want to receive your own post or not. Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PluginStrData....
Hi Neil, On Wed, May 27, 2009 at 9:40 AM, neil.hug...@tesco.net wrote: I hope you're over your cold/flu now? On the mend thanks, still not 100%, but able to work just fine. I'm looking at the PluginStrData work , and wondered whether you think the setPluginStrData and getPluginStrData should be made case insensitive? I was thinking to force the 'set' parameters through the osgDB::convertToLowerCase function. It would make checking for specific option string settings a little cleaner, and more robust. FYI, I renamed the method is s/getPluginStringData(). As to whether to make it case insensitive on setting, I would generally avoid enforcing this, what you set is what you get. For instance if you want to encode a human readable phrase then for sure you would want to keep case. For options it's a bit different, but it's on reading the options you can decide whether you want to treat it as case insensitive. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] missed state set for a scene node
Hi Gianluca, On Wed, May 27, 2009 at 9:42 AM, Gianluca Natale gianluca.nat...@adstorino.it wrote: Does a node need a state set, always? No, in fact you can have scene graphs where no nodes or drawables have StateSet assigned to them, it's still a perfectly valid scene graph. Such a naked scene graph would have to rely on the viewer's camera for it's state, and wouldn't be that useful, but it's still valid. For most scene graphs you'll find the StateSet's on the Geode's or Drawable leaves. StateSet's on internal nodes of the scene graph tend to be used for decorating the subgraph with some new or overridden state. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Single-sided ClipPlane?
Wish someone could of told me, you cant put clipplanes within clip planes, you cant make holes! Is it possible to have more than one clipNode in a scene? if i try 2 clipnodes everything gets clipped to the second node. Any ideas? If I cant use more than one clipNode in a scene im thinking about using a shader to make parts transparant. BUT ive got to figure a way to cap the holes after. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13016#13016 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] missed state set for a scene node
Thanks, I should have messed up some state set elsewhere. Gianluca -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: mercoledì 27 maggio 2009 10.49 To: OpenSceneGraph Users Subject: Re: [osg-users] missed state set for a scene node Hi Gianluca, On Wed, May 27, 2009 at 9:42 AM, Gianluca Natale gianluca.nat...@adstorino.it wrote: Does a node need a state set, always? No, in fact you can have scene graphs where no nodes or drawables have StateSet assigned to them, it's still a perfectly valid scene graph. Such a naked scene graph would have to rely on the viewer's camera for it's state, and wouldn't be that useful, but it's still valid. For most scene graphs you'll find the StateSet's on the Geode's or Drawable leaves. StateSet's on internal nodes of the scene graph tend to be used for decorating the subgraph with some new or overridden state. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.39/2134 - Release Date: 05/26/09 20:20:00 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] missed state set for a scene node
Hi Gianluca, On 27/5/09 10:42 AM, Gianluca Natale wrote: state set for that switch should be a simple set that just sets a rendering bin to the default for opaque, 0), but I got strange visualization. That is such a nondescriptive problem description it's not funny. You'll need to be more specific if you expect us to help you in any way. But I doubt it's related to the missing StateSet (see below). Does a node need a state set, always? No, you don't. Nodes without StateSet are perfectly fine. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] vertex shader help: compare position
Hi, Im trying to use a shader to make parts of models transparant(clipped) i was using a clipnode but learned you cant use more than one in a scene? or am i wrong? anyway, i wish to clip along a plane. currently this plane is defined as 3 points: Code: varying vec3 pos0; varying vec3 pos1; varying vec3 pos2; currently set as: Code: pos0.x = 0.0; pos0.y = 0.0; pos0.z = 0.0; pos1.x = 0.0; pos1.y = 1.0; pos1.z = 0.0; pos2.x = 0.0; pos2.y = 0.0; pos2.z = 1.0; how do i check which side the current world position is compared to this plane? ive tried Code: varying float inside; ... vec3 worldPos = gl_ModelViewMatrix * gl_Vertex; inside = 1.0; if (worldPos.x pos0.x) { inside = 0.0; } and inside my fragment shader im simply using Code: if (inside) discard; which does cut the model in half but its jagged. its not removing pixels but the whole vertex. it is wrong. how do i get the current world position with the vertex shader? and how can i check this position compared to the plane? the example code above just checks x axis, i need all 3. ... Thank you! Cheers, PaulG -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13020#13020 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] vertex shader help: compare position
Hi Paul, I guess the problem is related to the varying. AFAIR it is interpolated over the primitive. So maybe this is the problem. The other odd thing is that you do if (inside) discard; instead of if (inside == 1.0) discard; cheers Sebastian Hi, Im trying to use a shader to make parts of models transparant(clipped) i was using a clipnode but learned you cant use more than one in a scene? or am i wrong? anyway, i wish to clip along a plane. currently this plane is defined as 3 points: Code: varying vec3 pos0; varying vec3 pos1; varying vec3 pos2; currently set as: Code: pos0.x = 0.0; pos0.y = 0.0; pos0.z = 0.0; pos1.x = 0.0; pos1.y = 1.0; pos1.z = 0.0; pos2.x = 0.0; pos2.y = 0.0; pos2.z = 1.0; how do i check which side the current world position is compared to this plane? ive tried Code: varying float inside; ... vec3 worldPos = gl_ModelViewMatrix * gl_Vertex; inside = 1.0; if (worldPos.x pos0.x) { inside = 0.0; } and inside my fragment shader im simply using Code: if (inside) discard; which does cut the model in half but its jagged. its not removing pixels but the whole vertex. it is wrong. how do i get the current world position with the vertex shader? and how can i check this position compared to the plane? the example code above just checks x axis, i need all 3. ... Thank you! Cheers, PaulG -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13020#13020 ___ 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] vertex shader help: compare position against plane
I know the code: vec3 worldPos = gl_ModelViewMatrix * gl_Vertex; is worng, if i rotate the view so does this position. i need the world position and not the modelview position. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13023#13023 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Visual Studio 2008 (vc90sp1) binaries
Hi Robert, I have uploaded msvc90sp1 binaries built from the 2.8.1 tag to the ftp area. I verified the archives here and will download and verify again once you have moved them into their appropriate locations. On another issue - I still haven't found the time to make the deb package generator work on linux. I hope I can have it ready for 2.10. cheers Mattias ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Using a slave camera to take screenshots in a different resolution than the main camera.
Hi all, I'm trying to use a slave camera to take screenshots in a different resolution than the main camera. I have tried setting the slave cameras renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have made a graphics context with the desired resolution, but I'm always just getting a screenshot where I have the desired content in the original camera's resolution in the lower left corner and black pixels in the rest of the screenshots area. I've tried changing the background color of the slave cameras graphics context, and this works fine with only the screenshot being affected and the windows rendered by the main camera looking as normal, so I'm guessing that it's using the FBO for the slave camera. I'm guessing that I have forgotten some kind of statement regarding the slave camera's graphics context. regards, and thanks in advance. Jesper D. Thomsen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] earth_bayarea sample dataset
Hi guys, should the earth_bayarea sample dataset at http://www.openscenegraph.org/data/earth_bayarea/earth.ive still work? It's supposed to have a hi-res inset but I'm only getting the top-most LOD and nothing after that. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] OpenFlight plugin and static linking
I have submitted the patch. I guess one could add a macro in one of the OpenFlight headers to group all the USE_FLTRECORD macros, something like: #define REGISTER_FLT_RECORDS USE_FLTRECORD(Comment, COMMENT_OP); \ USE_FLTRECORD(LongID, LONG_ID_OP); \ USE_FLTRECORD(Matrix, MATRIX_OP); \ .. Cheers, Greg -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13029#13029 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] earth_bayarea sample dataset
Hi Ulrich, On Wed, May 27, 2009 at 1:20 PM, Ulrich Hertlein u.hertl...@sandbox.de wrote: should the earth_bayarea sample dataset at http://www.openscenegraph.org/data/earth_bayarea/earth.ive still work? It's supposed to have a hi-res inset but I'm only getting the top-most LOD and nothing after that. Running: osgviewer http://www.openscenegraph.org/data/earth_bayarea/earth.ive Works fine for me. I've just removed my local file cache to force it reload everything over http and it's working great. I'm using the svn/trunk version of the OSG. I would expect it to work find in previous versions of the OSG as well, certainly back to 2.6. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] vertex shader help: compare position against plane
ok, i got the world position with: Code: mat4 ToWorldMatrix= osg_ViewMatrixInverse* gl_ModelViewMatrix; vec3 worldPos = ToWorldMatrix * gl_Vertex; now i need to check which side of the plane the worldPos is. I googled and found some code for this but its not for glsl, ive came up with this but i get errors. the code is: Code: vec3 n; float d; n = (pos1 -pos0) ^ (pos2 - pos1); d = -n * pos0; inside = 1.0; if (dot(n, gl_Position) + w) { inside = 0.0; } the errors i get are: Code: VERTEX glCompileShader FAILED VERTEX Shader infolog: 0(46) : error C1021: operands to ^ must be integral glLinkProgram eroded FAILED Program eroded infolog: Vertex info --- 0(46) : error C1021: operands to ^ must be integral Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,) so i tried Code: vec3 n; float w; int p0 = (pos1 -pos0); int p1 = (pos2 - pos1); n = p0 ^ p1; w = -n * pos0; inside = 1.0; if (dot(n, worldPos) + w) { inside = 0.0; } but it alway returns inside = 0.0; any ideas? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13031#13031 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera.
I just tried changing the main camere to a slave camera (as supposedly a main+slave cam combination is bad somehow). This changed the behaviour such that the screenshot slave camere can now take screenshots in any resolution for the first screenshot, but subsequent screenshots have the same rendered area as the first screenshot, which either results in black area (when the second screenshot has higher resolution) or a cropped screenshot (when the new screenshot is in lower resolution). I'm assigning a fresh graphics context to the slave camera before each screenshot, but it seems to ignore the resolution in the subsequent graphics contexts. I'm pretty sure it's something really simple I'm forgetting to do. Regards, Jesper D. Thomsen From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen [...@anybodytech.com] Sent: Wednesday, May 27, 2009 1:18 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera. Hi all, I'm trying to use a slave camera to take screenshots in a different resolution than the main camera. I have tried setting the slave cameras renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have made a graphics context with the desired resolution, but I'm always just getting a screenshot where I have the desired content in the original camera's resolution in the lower left corner and black pixels in the rest of the screenshots area. I've tried changing the background color of the slave cameras graphics context, and this works fine with only the screenshot being affected and the windows rendered by the main camera looking as normal, so I'm guessing that it's using the FBO for the slave camera. I'm guessing that I have forgotten some kind of statement regarding the slave camera's graphics context. regards, and thanks in advance. Jesper D. Thomsen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] BoundingSphere and IntersectionTest
Simon Hammett schrieb: 2009/5/21 Matthias Gabriel g3e...@hotmail.de: Hi, today i wanted to build my own LineSegmentIntersector - well some kind of... while doing this, i looked into the sourcecode of the LineSegmentIntersector. There I saw, that the tests in LineSegmentIntersector::intersects(..) refer to start and end point of the lsi on the one hand, and to boundsphere.center()/radius() on the other hand. But here is my Problem. Start and end- points are in world coordinates, while the boundingsphere is in local coordinates...somewhere here in the newsgroup a read, that boundingssphere only refers to their children.. I came to this problem, while implementing my own Intersect-Bounding-Algorithms, where i get wrong results... Why is the original LinesegmentIntersector working or: is it actually working? At which point am i missunderstanding this? Thanks für your Help, MG As you traverse the scene graph, you maintain a matrix stack in the same way that open gl does. Enter a transform, push your stack, multiply the transform into it. Leave a transform and pop your stack. Then when you want to do the intersection, you can either transform the bounding sphere into world coordinates or transform your pick ray into local coordinates. It's easier to transform the ray, but then you have to pay for a matrix invert. Hi Simon, i looked at the source code and then i saw my mistake. In the iv-apply(osg::Transform); method, the IntersectionVisitor pushs the model matrix. After that, the LinesegmentIntersector will be transformed to this local coordinate system via the lsi-clone() method... So in every case we will compute (and pay for) the matrix inverse (except traversing upwards?!). Thank you for your reply, now i know how it is working! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera.
Another update: Well, I kind of found a solution, but it's really ugly. If I remove the slave camera from the viewer, then set the new graphics context, and then add the slave cam to the viewer again, it works with a new resolution for each screenshot. This seems very un-elegant though, and I'm pretty sure that this is a misuse of OSG in comparison to what was intended. Jesper D. Thomsen From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen [...@anybodytech.com] Sent: Wednesday, May 27, 2009 2:42 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera. I just tried changing the main camere to a slave camera (as supposedly a main+slave cam combination is bad somehow). This changed the behaviour such that the screenshot slave camere can now take screenshots in any resolution for the first screenshot, but subsequent screenshots have the same rendered area as the first screenshot, which either results in black area (when the second screenshot has higher resolution) or a cropped screenshot (when the new screenshot is in lower resolution). I'm assigning a fresh graphics context to the slave camera before each screenshot, but it seems to ignore the resolution in the subsequent graphics contexts. I'm pretty sure it's something really simple I'm forgetting to do. Regards, Jesper D. Thomsen From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen [...@anybodytech.com] Sent: Wednesday, May 27, 2009 1:18 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera. Hi all, I'm trying to use a slave camera to take screenshots in a different resolution than the main camera. I have tried setting the slave cameras renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have made a graphics context with the desired resolution, but I'm always just getting a screenshot where I have the desired content in the original camera's resolution in the lower left corner and black pixels in the rest of the screenshots area. I've tried changing the background color of the slave cameras graphics context, and this works fine with only the screenshot being affected and the windows rendered by the main camera looking as normal, so I'm guessing that it's using the FBO for the slave camera. I'm guessing that I have forgotten some kind of statement regarding the slave camera's graphics context. regards, and thanks in advance. Jesper D. Thomsen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] svn proplist svn:eol-style missing
There are many text files in svn that don't have svn:eol-style set to native. When it is set the line endings are corrected for the platform the file is checked out on, newline for Unix, carriage return newline for Dos. When it isn't set the files are Unix style. For example CMakeModules/FindOSG.cmake doesn't have it set, many of the other source files don't have it set either. svn proplist CMakeModules/FindOSG.cmake CMakeModules/FindOpenThreads.cmake Properties on 'CMakeModules/FindOpenThreads.cmake': svn:eol-style svn propget svn:eol-style CMakeModules/FindOSG.cmake CMakeModules/FindOpenThreads.cmake CMakeModules/FindOpenThreads.cmake - native svn propset svn:eol-style native CMakeModules/FindOSG.cmake property 'svn:eol-style' set on 'CMakeModules\FindOSG.cmake' then commit Here's a shell script command to check a list of files that don't have svn:eol-style set to native. $(find -name \*.cpp) lists 493 files. for a in *; do if [ `svn propget svn:eol-style $a` != native ] ; then echo $a; fi ; done -- David Fries da...@fries.net http://fries.net/~david/ (PGP encryption key available) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] LOD problem
Hi, Thanks for the reply. What do I need to add to support DatabasePager? I'm quite new to osg. Is there a workaround? Can I create a node visitor that fixes this problem or something similar? Using the --LOD option works for small models but generates huge files or crashing osgdem. I looked into how to extend vr juggler to use osg viewer, but it seams a bit complicated. I use active stereo and it seems that you cannot control the user's position and orientation in osg and are limited to simple settings such as user distance from screen and eye separation. I need to investigate this further. By the way, what is the relationship between the radius, pixel values in the height map and the vertical scaling in osgdem when I create ellipsoid models? For now I use nasa's blue marble data for testing. Kind regards, Miroslav -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13037#13037 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] vertex shader help: compare position against plane
I presume this line: n = (pos1 -pos0) ^ (pos2 - pos1); is a cross product of two vectors. i.e. the normal, also known as the vector perpendicular to the two vectors that define the plane. In which case you would want to use the glsl function cross(vec3,vec3) as on the reference sheet I sent previously. You should have a read about the geometry math being used here. Blindy copying code without understanding it is a good way to shoot yourself in the foot later on. Kim. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Griffiths Sent: 27 May 2009 13:40 To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] vertex shader help: compare position against plane ok, i got the world position with: Code: mat4 ToWorldMatrix= osg_ViewMatrixInverse* gl_ModelViewMatrix; vec3 worldPos = ToWorldMatrix * gl_Vertex; now i need to check which side of the plane the worldPos is. I googled and found some code for this but its not for glsl, ive came up with this but i get errors. the code is: Code: vec3 n; float d; n = (pos1 -pos0) ^ (pos2 - pos1); d = -n * pos0; inside = 1.0; if (dot(n, gl_Position) + w) { inside = 0.0; } the errors i get are: Code: VERTEX glCompileShader FAILED VERTEX Shader infolog: 0(46) : error C1021: operands to ^ must be integral glLinkProgram eroded FAILED Program eroded infolog: Vertex info --- 0(46) : error C1021: operands to ^ must be integral Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,) so i tried Code: vec3 n; float w; int p0 = (pos1 -pos0); int p1 = (pos2 - pos1); n = p0 ^ p1; w = -n * pos0; inside = 1.0; if (dot(n, worldPos) + w) { inside = 0.0; } but it alway returns inside = 0.0; any ideas? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13031#13031 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g* To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html *___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Attack the PrimitiveSet
Hi, I'm currently attacking the primitives of my scene and I would like to remove some of them from my one of my PrimitiveSets. A very ugly and heavy solution would be to copy the existing one but the indices I want to remove . As I say, it's very ugly and as I want to remove a lot of primitives it would quickly become very heavy. Isn't there a way to do a classical remove method like the one from the std::vector (for example) ? Thank you! Cheers, Maxime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13040#13040 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Attack the PrimitiveSet
Hi, Maxime BOUCHER wrote: I'm currently attacking the primitives of my scene and I would like to remove some of them from my one of my PrimitiveSets. [...] Isn't there a way to do a classical remove method like the one from the std::vector (for example) ? What kind of PrimitiveSet do you want to erase elements from? E.g. all DrawElementsXXX classes derive from std::vector, so you should be able to use the methods from vector on those. Paul A very ugly and heavy solution would be to copy the existing one but the indices I want to remove . As I say, it's very ugly and as I want to remove a lot of primitives it would quickly become very heavy. Thank you! Cheers, Maxime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13040#13040 ___ 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] Attack the PrimitiveSet
Hi, What exactly do you mean attacking, are you trying to remove primitive from primitive sets. Indices are deprecated and they are not encouraged to be used anymore. The dirty way is the classical way. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13042#13042 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] transparency problem
Hi Su Hu, You need to place transparent objects in the depth sorted bin, normally loaders will do this for you. There is a chance that these objects are already in the transparent bin but you have some very large transparent objects in the scene as well that are causing the depth sorting to perform poorly - if this is the case you need to break the large objects up into small parts to allow depth sorting to work correctly. Robert. On Wed, May 27, 2009 at 2:26 PM, su hu ttts...@gmail.com wrote: Hi all. Some transparent textures are used in our model. When we render this model by osg v2.8, we find some problem as attached snapshot. We try to change orders(in model structure) of those transparent objects to get right result, but failed. Any special setting should be included in program?Thanks for your help. Regards, Su Hu ___ 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] Attack the PrimitiveSet
Thanks for replying! Paul Melis wrote: What kind of PrimitiveSet do you want to erase elements from? E.g. all DrawElementsXXX classes derive from std::vector, so you should be able to use the methods from vector on those. OK, it's interesting. I mainly work on DrawArrayLength. What can I do with it? wrote: What exactly do you mean attacking, are you trying to remove primitive from primitive sets. Indices are deprecated and they are not encouraged to be used anymore. The dirty way is the classical way. Yes, I want to remove primitives removing their indices. Can I ask you since which version indices are deprecated? Have you an example of the dirty way? I don't get what you mean. Thanks to you, Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13044#13044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] transparency problem
Hi Robert, sorry to chip in... I've been wondering about this also recently. Robert Osfield wrote: Hi Su Hu, You need to place transparent objects in the depth sorted bin, normally loaders will do this for you. There is a chance that these objects are already in the transparent bin but you have some very large transparent objects in the scene as well that are causing the depth sorting to perform poorly - if this is the case you need to break the large objects up into small parts to allow depth sorting to work correctly. What specifically is a part? Geode, Geometry, PrimitiveSet, Triangle? jp Robert. On Wed, May 27, 2009 at 2:26 PM, su hu ttts...@gmail.com wrote: Hi all. Some transparent textures are used in our model. When we render this model by osg v2.8, we find some problem as attached snapshot. We try to change orders(in model structure) of those transparent objects to get right result, but failed. Any special setting should be included in program?Thanks for your help. Regards, Su Hu ___ 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 -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] transparency problem
Hi Robert, Thanks for your reply. Our 3D modeler tell me that the same model is shown right in vega view. We will break large objects up into small parts and try it again. Thanks a lot. Regards, Su Hu 2009/5/27 Robert Osfield robert.osfi...@gmail.com Hi Su Hu, You need to place transparent objects in the depth sorted bin, normally loaders will do this for you. There is a chance that these objects are already in the transparent bin but you have some very large transparent objects in the scene as well that are causing the depth sorting to perform poorly - if this is the case you need to break the large objects up into small parts to allow depth sorting to work correctly. Robert. On Wed, May 27, 2009 at 2:26 PM, su hu ttts...@gmail.com wrote: Hi all. Some transparent textures are used in our model. When we render this model by osg v2.8, we find some problem as attached snapshot. We try to change orders(in model structure) of those transparent objects to get right result, but failed. Any special setting should be included in program?Thanks for your help. Regards, Su Hu ___ 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] transparency problem
This is a old problem of all scenegraphs try a searching on halos for performer and Vega try here http://www.multigen-paradigm.com/cgi-bin/Ultimate2.cgi I know I have discussed this many time there ( you don't have to be member to search there) Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of su hu Sent: Wednesday, May 27, 2009 9:27 AM To: OpenSceneGraph Users Subject: [osg-users] transparency problem Hi all. Some transparent textures are used in our model. When we render this model by osg v2.8, we find some problem as attached snapshot. We try to change orders(in model structure) of those transparent objects to get right result, but failed. Any special setting should be included in program?Thanks for your help. Regards, Su Hu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] earth_bayarea sample dataset
Hi Robert, On 27/5/09 2:38 PM, Robert Osfield wrote: Running: osgviewer http://www.openscenegraph.org/data/earth_bayarea/earth.ive Works fine for me. I've just removed my local file cache to force it The reason why it didn't work for me was that I had a file 'earth.ive' in my OSG_FILE_PATH that was picked up first. Works now, thanks. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Attack the PrimitiveSet
Maxime BOUCHER wrote: Thanks for replying! Paul Melis wrote: What kind of PrimitiveSet do you want to erase elements from? E.g. all DrawElementsXXX classes derive from std::vector, so you should be able to use the methods from vector on those. OK, it's interesting. I mainly work on DrawArrayLength. What can I do with it? From include/osg/PrimitiveSet: class OSG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorGLsizei { public: [...] where VectorGLsizei is (basically) std::vectorGLsizei. So you can just do osg::DrawArrayLengths *arr = new osg::DrawArrayLengths(); arr-push_back(5); arr-erase(arr-begin()+10, arr-begin()+20); wrote: What exactly do you mean attacking, are you trying to remove primitive from primitive sets. Indices are deprecated and they are not encouraged to be used anymore. The dirty way is the classical way. Yes, I want to remove primitives removing their indices. Can I ask you since which version indices are deprecated? Have you an example of the dirty way? I don't get what you mean. With indices do you mean OpenGL indices here (as in drawing primitives by index), or do you mean indices in the DrawArrayLengths array? Rabbi means the former is generally not recommended for performance reasons. The latter is something completely different and is no problem. Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] vertex shader help: compare position against plane
Hi Paul; Watch the video. It can tell you much of dot and cross product :) http://video.google.com/videosearch?q=cross+productoe=utf-8rls=org.mozilla:en-US:officialclient=firefox-aum=1ie=UTF-8ei=LE4dSreZCpLt_AbS4OGxDQsa=Xoi=video_result_groupresnum=4ct=title# Regards. 2009/5/27 Paul Griffiths gaffe...@gmail.com Kim C Bale wrote: I presume this line: n = (pos1 -pos0) ^ (pos2 - pos1); is a cross product of two vectors. i.e. the normal, also known as the vector perpendicular to the two vectors that define the plane. In which case you would want to use the glsl function cross(vec3,vec3) as on the reference sheet I sent previously. You should have a read about the geometry math being used here. Blindy copying code without understanding it is a good way to shoot yourself in the foot later on. Kim. -Original Message- From: [mailto:] On Behalf Of Paul Griffiths Sent: 27 May 2009 13:40 To: Subject: Re: vertex shader help: compare position against plane ok, i got the world position with: Code: mat4 ToWorldMatrix= osg_ViewMatrixInverse* gl_ModelViewMatrix; vec3 worldPos = ToWorldMatrix * gl_Vertex; now i need to check which side of the plane the worldPos is. I googled and found some code for this but its not for glsl, ive came up with this but i get errors. the code is: Code: vec3 n; float d; n = (pos1 -pos0) ^ (pos2 - pos1); d = -n * pos0; inside = 1.0; if (dot(n, gl_Position) + w) { inside = 0.0; } the errors i get are: Code: VERTEX glCompileShader FAILED VERTEX Shader infolog: 0(46) : error C1021: operands to ^ must be integral glLinkProgram eroded FAILED Program eroded infolog: Vertex info --- 0(46) : error C1021: operands to ^ must be integral Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,) so i tried Code: vec3 n; float w; int p0 = (pos1 -pos0); int p1 = (pos2 - pos1); n = p0 ^ p1; w = -n * pos0; inside = 1.0; if (dot(n, worldPos) + w) { inside = 0.0; } but it alway returns inside = 0.0; any ideas? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13031#13031 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g * To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html * ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Thanks kim. am new to this 3d math stuff. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13051#13051 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ümit Uzun ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Attack the PrimitiveSet
Paul Melis wrote: class OSG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorGLsizei { public: [...] where VectorGLsizei is (basically) std::vectorGLsizei. So you can just do osg::DrawArrayLengths *arr = new osg::DrawArrayLengths(); arr-push_back(5); arr-erase(arr-begin()+10, arr-begin()+20); My bad, I should have seen it myself. Anyway, thank you for the help. Paul Melis wrote: With indices do you mean OpenGL indices here (as in drawing primitives by index), or do you mean indices in the DrawArrayLengths array? Rabbi means the former is generally not recommended for performance reasons. The latter is something completely different and is no problem. I mean the indices in DrawArray. Thus there is no performance problem, right? Thanks for all. Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13052#13052 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] transparency problem
Hi J.P, On Wed, May 27, 2009 at 3:01 PM, J.P. Delport jpdelp...@csir.co.za wrote: What specifically is a part? Geode, Geometry, PrimitiveSet, Triangle? The transparent bin is sorted by the distance away from the eye of center of the drawables. To get finner grained sorted you have to break the large drawable into smaller ones. The drawables are usually osg::Geometry, so you'd break these into a series of smaller osg::Geometry. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Image pointer in the Intersected node is NULL
Hi, I have a scene graph and I'm trying to intersect with it using a LineSegmentIntersector. In the intersection result I get a List of nodes, the last node being the Geode containing the drawable that I intersected with. When I try to retrive the image pointer which should contain the texture for that drawable the pointer is NULL. Can anybody tell me why is NULL? Is it normal that is NULL? Is there any way I can retrieve that image pointer? I even tried when loading the model to cach the image, but it did not work. Thank you! Cheers, Cristina -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13055#13055 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Mouse click line
Hi, I'm trying get the line that intersects the fulcrum of the viewing volume and the point I clicked with my mouse on the viewing surface. So I set my projection matrix with: _sceneView-setProjectionMatrixAsPerspective(_viewAngle, (float) width/height, 1, 1); I get the overall matrix as: osg::Matrixd vum; vum.set(_sceneView-getViewMatrix()*_sceneView-getProjectionMatrix()); Then I invert it: osg::Matrixd vumi; vumi.invert(vum); My theory is that I should be able to transform points 0,0,0 and mouse points x,y,1 to get the line that I want: osg::Vec3 p0(0,0,0); osg::Vec3 p1(x, y, 1); p0 = p0*vumi; p1 = p1*vumi; It doesn't seem to work, though. Is my thinking incorrect? I'm not sure if it's correct to assume a Z value of 1 for the viewing plane. I get it from the near clipping plane in setProjectionMatrixAsPerspective(). Thank you! Cheers, Mark -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13050#13050 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image pointer in the Intersected node is NULL
Hi Christina, It sounds like your textures have the UnrefRefImageOnApply feature set to true. If you want to retain the images after the first frame is rendered you'll need to not enable this. This feature is off by default but If you are running the osgUtil::Optimizer one of it's default passes does optimization of the texture settings and enables this. Robert. On Wed, May 27, 2009 at 4:16 PM, Cristina Paponi cristina.pap...@meggitt.com wrote: Hi, I have a scene graph and I'm trying to intersect with it using a LineSegmentIntersector. In the intersection result I get a List of nodes, the last node being the Geode containing the drawable that I intersected with. When I try to retrive the image pointer which should contain the texture for that drawable the pointer is NULL. Can anybody tell me why is NULL? Is it normal that is NULL? Is there any way I can retrieve that image pointer? I even tried when loading the model to cach the image, but it did not work. Thank you! Cheers, Cristina -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13055#13055 ___ 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] vertex shader help: compare position against plane
umituzun84 wrote: Hi Paul; Watch the video. It can tell you much of dot and cross product :) http://video.google.com/videosearch?q=cross+productoe=utf-8rls=org.mozilla:en-US:officialclient=firefox-aum=1ie=UTF-8ei=LE4dSreZCpLt_AbS4OGxDQsa=Xoi=video_result_groupresnum=4ct=title# (http://video.google.com/videosearch?q=cross+productoe=utf-8rls=org.mozilla:en-US:officialclient=firefox-aum=1ie=UTF-8ei=LE4dSreZCpLt_AbS4OGxDQsa=Xoi=video_result_groupresnum=4ct=title#) Regards. 2009/5/27 Paul Griffiths () Kim C Bale wrote: I presume this line: n = (pos1 -pos0) ^ (pos2 - pos1); is a cross product of two vectors. i.e. the normal, also known as the vector perpendicular to the two vectors that define the plane. In which case you would want to use the glsl function cross(vec3,vec3) as on the reference sheet I sent previously. You should have a read about the geometry math being used here. Blindy copying code without understanding it is a good way to shoot yourself in the foot later on. Kim. -Original Message- From: [mailto:] On Behalf Of Paul Griffiths Sent: 27 May 2009 13:40 To: Subject: Re: vertex shader help: compare position against plane ok, i got the world position with: Code: mat4 ToWorldMatrix= osg_ViewMatrixInverse* gl_ModelViewMatrix; vec3 worldPos = ToWorldMatrix * gl_Vertex; now i need to check which side of the plane the worldPos is. I googled and found some code for this but its not for glsl, ive came up with this but i get errors. the code is: Code: vec3 n; float d; n = (pos1 -pos0) ^ (pos2 - pos1); d = -n * pos0; inside = 1.0; if (dot(n, gl_Position) + w) { inside = 0.0; } the errors i get are: Code: VERTEX glCompileShader FAILED VERTEX Shader infolog: 0(46) : error C1021: operands to ^ must be integral glLinkProgram eroded FAILED Program eroded infolog: Vertex info --- 0(46) : error C1021: operands to ^ must be integral Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,) so i tried Code: vec3 n; float w; int p0 = (pos1 -pos0); int p1 = (pos2 - pos1); n = p0 ^ p1; w = -n * pos0; inside = 1.0; if (dot(n, worldPos) + w) { inside = 0.0; } but it alway returns inside = 0.0; any ideas? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13031#13031 (http://forum.openscenegraph.org/viewtopic.php?p=13031#13031) ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or) g * To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html (http://www.hull.ac.uk/legal/email_disclaimer.html) * ___ 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 Thanks kim. am new to this 3d math stuff. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13051#13051 (http://forum.openscenegraph.org/viewtopic.php?p=13051#13051) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Ümit Uzun -- Post generated by Mail2Forum Thaks umituzun84, for the link. Ill have a watch when im home and not on mobile broadband. - Ive got my code working. But its clipping to a vertex level when I need it down to the fragment level. Is it possible to get the fragment world position in some way? heres my code so far: Vertex shader: Code: varying float lightIntensity; varying vec3 Position; uniform vec3 LightPosition; uniform float Scale; varying float inside; uniform mat4 osg_ViewMatrixInverse; varying vec3 pos0; varying vec3 pos1; varying vec3 pos2; void main(void) {
Re: [osg-users] Image pointer in the Intersected node is NULL
Hi, You were right. The optimize enables UnrefRefImageOnApply feature, so my image pointer is NULL. I disable the texture optimization, so now it works. Thank you! Cheers, Cristina -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13059#13059 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dragger snap to grid / raster
If you're rendering in 3d, 20 pixels doesn't have a lot of meaning. In general what you'd need to do is transform 20 pixels into your world's coordinates. Transform 20 pixels into normalized screen coordinates, something like: gridUnit = 20/screenWidth/2; Then transform gridUnit into world coordinates. Something like: osg::Vec3 p(gridUnit, gridUnit, 1); p = p*inverseMatrix; The problem is, again, that 20 pixels will have different 3d sizes depending on the depth of what you're snapping. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13060#13060 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Foring Trilinear Mipmaping
Yep That worked. Thanks you guys. Guy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13061#13061 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] transparency problem
Also make sure you multi-sampling turned on, this show up much more when multi-sampling is off Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Wednesday, May 27, 2009 11:08 AM To: OpenSceneGraph Users Subject: Re: [osg-users] transparency problem Hi J.P, On Wed, May 27, 2009 at 3:01 PM, J.P. Delport jpdelp...@csir.co.za wrote: What specifically is a part? Geode, Geometry, PrimitiveSet, Triangle? The transparent bin is sorted by the distance away from the eye of center of the drawables. To get finner grained sorted you have to break the large drawable into smaller ones. The drawables are usually osg::Geometry, so you'd break these into a series of smaller osg::Geometry. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG users in Colorado
We have a few long-time OSG users here in the Colorado front-range area, and in the past I've hosted informal OSG get-togethers. Is there anyone here interested in attending one in the next month or so? I highly recommend get-togethers like this if you have a few users in your area. it's a great way to network and see what everyone is up to. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Mouse click line
Mark Walker wrote: Hi, I'm trying get the line that intersects the fulcrum of the viewing volume and the point I clicked with my mouse on the viewing surface. :s/fulcrum/frustum/ http://en.wikipedia.org/wiki/Frustum -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Test post, very strange
Chris 'Xenon' Hanson wrote: As a test, I'm going to post the content of the mystery message as a followup to this very message and see if it goes through. Here's the mysterious content that won't post: Subject: Working GLSL implementation of Tatarchuk's Parallax Occlusion Mapping I'm looking to add extra visual realism to surfaces using shaders. Grass, gravel and dirt are some of the obvious candidates, but there could be others. I am hoping to use a type of Parallax Mapping. I have a few algorithms of basic Parallax Mapping, but they fall apart at glancing angles close to the ground (where the user viewpoint will frequently be). Tatarchuk's Parallax Occlusion Mapping: http://ati.amd.com/developer/SIGGRAPH05/Tatarchuk-ParallaxOcclusionMapping-Sketch-print.pdf http://ati.amd.com/developer/gdc/Tatarchuk-ParallaxOcclusionMapping-FINAL_Print.pdf http://ati.amd.com/developer/gdc/2006/GDC06-Tatarchuk-Parallax_Occlusion_Mapping.pdf Seems to solve many of the issues. The GDC 06 paper with the allegedly improved algorithm only talks about HLSL and DirectX. I'm interested in checking this algorithm out to see how it performs (I'm designing shaders in RenderMonkey) but I've had a hard time finding working GLSL source for anything newer than the original Parallax Shader from 04 and earlier. I don't want to write and debug an implementation from scratch just to find out it doesn't do the job, so I was hoping to find a working implementation somewhere, but am not finding one. Anyone seen one? It looks like a heck of a technique and could really be used to great purpose in landscapes, and well, just about anything with surface detail. Anyone know where to find something like this? Also, I'm interested in other sources of canned shaders. I'm not trying to do cutting-edge research, I'm just trying to apply the best available technology to a visualization problem to give the best results without reinventing the wheel. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] add/remove camera crash
Hi, I integrated an overlays system into my code that essentially supports multiple overlays, each having multiple hud items. Each overlay uses an osg::Camera at its root. All this works very well, with the exception of the following issue: when I remove the overlay (i.e the root camera) from the scene, I get a draw crash (this does not happen all the time, but very often) I made sure that the root of the scene (i.e Group node) has the data variance set to DYNAMIC. Here is the overlay camera constructor code: Code: setDataVariance( osg::Camera::DYNAMIC); setReferenceFrame( osg::Transform::ABSOLUTE_RF ); setProjectionMatrix( osg::Matrix::ortho2D( -1, 1, -1, 1 ) ); setViewMatrix( osg::Matrix::identity () ); setClearMask( 0 ); setRenderOrder( osg::Camera::POST_RENDER ); // we don't want the camera to grab event focus from the viewers main camera(s). setAllowEventFocus(false); osg::StateSet* pStateSet = getOrCreateStateSet( ); pStateSet-setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF ); pStateSet-setMode( GL_LIGHTING, osg::StateAttribute::OFF ); pStateSet-setMode( GL_FOG, osg::StateAttribute::OFF ); pStateSet-setMode( GL_CULL_FACE, osg::StateAttribute::OFF ); pStateSet-setMode( GL_BLEND, osg::StateAttribute::OFF ); Cheers, Guy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13067#13067 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] add/remove camera crash
Hi, Here is the call stack for the crash and the code: [img]CallStack.bmp[/img] Code: void RenderStage::draw(osg::RenderInfo renderInfo,RenderLeaf* previous) { if (_stageDrawnThisFrame) return; // push the stages camera so that drawing code can query it if (_camera) renderInfo.pushCamera(_camera); _stageDrawnThisFrame = true; if (_camera _camera-getInitialDrawCallback()) { // if we have a camera with a intial draw callback invoke it. [color=red] [b](*(_camera-getInitialDrawCallback()))(renderInfo);[/b][/color] } // note, SceneView does call to drawPreRenderStages explicitly // so there is no need to call it here. drawPreRenderStages(renderInfo,previous); if (_cameraRequiresSetUp) { runCameraSetUp(renderInfo); } ... Thank you! Cheers, Guy[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13069#13069 attachment: CallStack.bmp___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Drawing a line once( bullet physics integration )
Hi all, I'm trying to integrate bullet with osg; the problem comes with bullet's debug drawing. Bullet has an abstract class, with drawing functions to be implemented by the user. The main requirement is simply to render a line; however I need to draw a single frame, not add a model to a scene to be drawn over and over. The only theorical solution I have been able to come up with, is to add a node per line before calling osgViewer:: frame(), and then delete the nodes. Pure OpenGL code outside of the scenegraph is not an option. -Coz ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org