[osg-users] How to resize/move existing OSG window dynamically?
Hi, I have an example where I create an OSG window. I need to be able to move or resize it after creation through code. I have tried something like this: Code: while (!viewer->done()) { viewer->frame(); if (bConditionMet) viewer->getEventQueue()->windowResize(newX, newY, newWidth, newHeight); } But this seems to have no effect. Do I need to reset the traits on the graphicsContext? Thank you! Cheers, Mike[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76156#76156 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osggeometryshaders example question
Thanks! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71703#71703 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osggeometryshaders example question
Hi, In reference to the osggeometryshaders example, I have a question about a seeming problem when only passing one point to the geometry shader: If I comment out all but the first push back: Code: osg::Vec3Array* vAry = new osg::Vec3Array; setVertexArray( vAry ); vAry->push_back( osg::Vec3(0,0,0) ); /*vAry->push_back( osg::Vec3(0,1,0) ); vAry->push_back( osg::Vec3(1,0,0) ); vAry->push_back( osg::Vec3(1,1,0) ); vAry->push_back( osg::Vec3(0,0,1) ); vAry->push_back( osg::Vec3(0,1,1) ); vAry->push_back( osg::Vec3(1,0,1) ); vAry->push_back( osg::Vec3(1,1,1) );*/ Nothing shows up. But if I do two, three or more points, every thing works fine. It seems a minimum of two points in the DrawArrays array is required? Thank you! Cheers, Mike[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71697#71697 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is it possible to draw an ive object inside a shader?
Similar to what OSGforest example does, except render an actual ive file and mot just textured quads... Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69661#69661 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Is it possible to draw an ive object inside a shader?
Hi, Wondering if it possible to draw an ive file inside a shader. For example, say I want to populate an urban area with a particular building, maybe have the shader scale and rotate and place it randomly. Can I use a shader to draw the ive file over and over again externally to the actual OSG program? Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69660#69660 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Irregular shaped clip node?
Thanks, Robert. What about some convex shape like a pentagon? Just looking for some way to do something other than a rectangle? ... Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67658#67658 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Irregular shaped clip node?
Hi, Can you have an irregular shaped clip node? For example, what if I want an ellipse or a pentagon shaped clip node. Is that possible? Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67656#67656 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] undefined setColorArray and setNormalArray in 3.2.3
Robert, I have found the problem - multiple OSG versions and I was linking to the older one. Thanks! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66280#66280 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] undefined setColorArray and setNormalArray in 3.2.3
Hi, Have some older code that I have working with on Windows (OSG 3.2.1). Uses setColorArray and setNormal array to define some primitive geometry. While porting to LINUX using OSG 3.2.3, I get undefines on these two methods while linking. Are there some "deprecation" flags or something I need to link these in? Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66272#66272 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] setProjectionMatrixAsPerspective changes eyepoint when camera is rotated
In a post frame callback. ... Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65412#65412 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] setProjectionMatrixAsPerspective changes eyepoint when camera is rotated
Hi, I am trying to manually effect near and far clipping planes based on camera altitude in my app. Essentially, I do this: Camera()->getProjectionMatrixAsPerspective(_fov,_ratio,_near,_far); Then based on some criteria, I might change the near or far clip planes. _near = _nearNew; _far - _farNew; I then try to reset using Camera()->setProjectionMatrixAsPerspective(_fov,_ratio,_nearNew,_farNew); which works fine IF the original camera is not rotated, However, if the camera is rotated by, say , 90 degrees, prior to the calls, then the view after the get/set combo moves the eyepoint down by a factor equal to the aspect ratio of the screen. Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65410#65410 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Floating point depth buffer
Having problems with Z-fighting when using a very large terrain database and mixing it with Triton ocean - seeing lots of z-fighting along the coast line where the water and the terrain depths are nearly the same. I can alleviate the problem by reducing the near/far clip boundaries, but this is not acceptable for our application as it cuts off the mountains in the distance of our terrain. Has anyone successfully used the Nvidia floating point depth buffer extension with OSG, GL_NV_depth_buffer_float, to increase the depth buffer precision? If so, how do you apply this in an OSG application (GraphicsContext:Traits)? ... Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64996#64996 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LOS materail query
OK, Got this working for some cases. For example, I used Lightwave to create a box with a colorbar texture placed on it so I would know for sure that the color returned was correct. The texture I used was a plain jpg. The problem is when using some other .ive , ost, or .osgt files. These have embedded textures of some unknown format. Do I need to somehow use set/getPixelFromat in order to be able to retrieve to right values for the texture color ? I am using this to check the color values for the picked texture: Code: osg::Image *myImage = myTexture-getImage(0); if (myImage) { osg::Vec4 textureColor = myImage-getColor(tc); std::cout textureColor = textureColor.x()*255 , textureColor.y()*255 , textureColor.z()*255 std::endl; } Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64938#64938 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LOS materail query
OK, fixed that - loaded an .ive file and was able to get correct looking texture coordinates. In a .ive file with embedded textures, is there a textureName? Probably not - not really important. But the code does say that there is one image in the texture. But doing the getImage(0) does not return a valid image and thus no color from the texture is returned. Code: osgUtil::LineSegmentIntersector::Intersections intersections; if (viewer-computeIntersections(ea, intersections)) { const osgUtil::LineSegmentIntersector::Intersection hit = *intersections.begin(); //MGREENE std::cout hit = hit.getLocalIntersectPoint().x() , hit.getLocalIntersectPoint().y() , hit.getLocalIntersectPoint().z() std::endl; osg::Vec3 tc(0, 0, 0); osg::Texture* myTexture = hit.getTextureLookUp(tc); std::cout tc = tc.x() , tc.y() , tc.z() std::endl; if (myTexture){ std::string myString = myTexture-getName(); std::cout texturename = myString std::endl; int numImages = myTexture-getNumImages(); std::cout numImages = numImages std::endl; osg::Image *myImage = myTexture-getImage(0); if (myImage) { osg::Vec4 textureColor = myImage-getColor(tc); std::cout textureColor = textureColor.r() , textureColor.b() , textureColor.g() , textureColor.a() std::endl; } } //END MGREENE ... Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64908#64908 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LOS materail query
Yes, a null texture is the problem. I am using the osgparticleeffects example, as I know the object does have a texture. It is the example where you click on the terrain and at that point an explosion and smoke effect starts. But when printing out the coordinates of hit in the code above, they do show valid locations on the terrain whenever a mouse clicks on the terrain to place a particle effect. Using one of these valid hits, I then use that intersection to try the texture return code. For example, one of the hit outputs that I ran returned an X,Y,Z of 838.203, 840.662, 268.477 (LocalIntersectPoint), but the texture returned is NULL and of course then tc is (0,0,0). Debugging the code for getTextureLookup, the first two lines : Code: osg::Texture* LineSegmentIntersector::Intersection::getTextureLookUp(osg::Vec3 tc) const { osg::Geometry* geometry = drawable.valid() ? drawable-asGeometry() : 0; osg::Vec3Array* vertices = geometry ? dynamic_castosg::Vec3Array*(geometry-getVertexArray()) : 0; show that drawable.valid is true, but then the value of vertices is always all zeroes. ... Thank you! Cheers, Mike[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64903#64903 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LOS materail query
Hi, using the example, osgparticleeffects.cpp, I added the following lines of code to the pick function (inside the //MGREENE section): Code: void pick(osgViewer::Viewer* viewer, const osgGA::GUIEventAdapter ea) { osg::Group* root = dynamic_castosg::Group*(viewer-getSceneData()); if (!root) return; osgUtil::LineSegmentIntersector::Intersections intersections; if (viewer-computeIntersections(ea,intersections)) { const osgUtil::LineSegmentIntersector::Intersection hit = *intersections.begin(); //MGREENE std::cout hit = hit.getWorldIntersectPoint().x() , hit.getWorldIntersectPoint().y() , hit.getWorldIntersectPoint().z() std::endl; osg::Vec3 tc(0,0,0); osg::ref_ptrosg::Texture myTexture = hit.getTextureLookUp(tc); std::cout tc = tc.x() , tc.y() , tc.z() std::endl; //END MGREENE bool handleMovingModels = false; ... but the values of tc are always 0,0,0. Thank you! Cheers, Mike[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64894#64894 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LOS materail query
Thank you guys very much! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64867#64867 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] LOS materail query
Hi, I am wanting to do a dust cloud when an entity (helicopter) lands on a terrain. Ideally, would like the color of the dust cloud to be similar to the material/texture that the entity is on. Is there a way to do a material/texture color query based on an entity position, kind of like an LOS intersector test? Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64857#64857 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg/CameraNode not in 3.4?
Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64544#64544 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg/CameraNode not in 3.4?
Sorry, I guess I should have asked - wrt OSG - the include file osg/CameraNode has vanished in the latest version (at least compared to 3.2.1). Has this functionality been replaced or superceded? Mike Greene __ -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64530#64530 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to programmatically clear trackball manipulator's mouse queue
I have some source code where I use a trackballmanipulator to rotate a terrain. If I drag the mouse I can set the terrain spinning. How do I programatically stop this (i.e., without clicking the mouse again)? I tried setting Manipulator-setRotation(last_saved_angles), which does reset it , but it looks like the previous dragging motion queues up lots of mouse events that then continue to rotate the terrain on subsequent render loops. Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] MFC and keyboard handling
I have an MFC/OSG app that works well as far as mouse/manipulator functionality is concerned. But it seems as if the standard way I do keyboard handling does not. Does MFC intercept keyboard commands? Is there an example somewhere of how to passthrough the OSG keyboard commands? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgmovie http streaming over wireless on Windows
I've seen some answers for using ffmpeg on Linux systems. I would like to use my mobile Nokia N900's camera to stream (http or rtsp) over wireless to a Windows XP machine and then use the stream as an input to osgmovie, something like osgmovie --interactive http://10.1.1.1:8080;. Is this possible? As of now, the plugin gives me the message saying it doesn't know how to handle that type of file. I can transcode the stream into an mpeg 2 or 4 format. Could I somehow just mod the QT plugin so that is will accept a url as a file name with no extension? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to render last with multiple cameras
I think I wasn't clear on my question: The HUD works fine, as does the other regular 3D camera (behind the HUD). What I'd like to be able to do is have some items in the background camera appear on top of the HUD while others remain behind it. I thought I could use renderbins, but since the HUD and the 3D cameras are separate, that doesn't seem to be working. Mike Greene 010/1/6 Mike Greene mgre...@hiwaay.net mailto:mgre...@hiwaay.net I have a view with two cameras - a HUD camera and a regular 3D perspective camera. I have my scene set up so that I can vary the alpha of the HUD (drawn with a polygon) so that I can see the 3D view behind at various intensities. What I would like to be able to do is have some of the 3D components drawn at full brightness while the HUD is also fully opaque. I tried using renderbins, but I think the problem is that the HUD and the 3D items are seen with different cameras. Is there a way to accomplish this? The important calls for setting up a hud camera are: camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera-setClearMask(GL_DEPTH_BUFFER_BIT); camera-setRenderOrder(osg::Camera::POST_RENDER); camera-setViewport(x, y, w, h); And maybe also: camera-setAllowEventFocus(false); If that doesn't resolve it, you'll need to post some code and a screenshot. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to render last with multiple cameras
I have a view with two cameras - a HUD camera and a regular 3D perspective camera. I have my scene set up so that I can vary the alpha of the HUD (drawn with a polygon) so that I can see the 3D view behind at various intensities. What I would like to be able to do is have some of the 3D components drawn at full brightness while the HUD is also fully opaque. I tried using renderbins, but I think the problem is that the HUD and the 3D items are seen with different cameras. Is there a way to accomplish this? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Alpha question with osggeometry
Hopefully a simple question: In the demo, osggeometry, I changed all the color values to have an alpha of 0.1 instead of 1.0 (4th component of Vec4). It didn't have any effect. What else needs to be added in order for the transparency to appear? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Easy Question? - returning points after PositionAttitudeTransform applied
I have a linesegment defined by two points, say X1Y1 and X2Y2. If I then place this linesegment under a PositionAttitudeTransform in the tree and do a rotate (setAttitude) and translate (setPosition), how do I then get these new values of the points that have been transformed (X1nY1n and X2nY2n)? I tried returning the bounding box on the linesegment but it returned the same values both before and after I did the transform. Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgmovie streaming
I currently have a Windows XP OSG application working with a live HD feed (1920 x 1080) texture mapped to a quad. I use a BlackMagic video capture card as the input device. It has a builtin QuickTime driver which I believe is required for the osgmovie example (using the quicktime plugin) to work. I run it by using the command: osgmovie 0:1.livewhich is the device that gets assigned to the card. I've also gotten it to work using a regular Firewire stream in NTSC resolution using the AbstractPlane DirectShow to Quicktime convertor: http://www.abstractplane.com/ Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimization and lots of objects
Robert Osfield wrote: /Hi Mike, Um... I guess you haven't read the thread about managing ten's of thousands of osg::Box's yesterday So go read the last two days emails as a back ground. In the case of sphere's I'd see if you can get away with point sprites, if you can then this will be the most efficient way forward. Personally I'd create a set of osg::Geometry containing as many points as you have targets, or perhaps even just one to be lazy, and then use point sprites to make this points/or textured targets. Then just update the positions of the points per frame when required. Robert. /Actually, I did read the previous posts. My problem is that I have to dynamically scale the spheres (ellipsoids) as they are representing actual 3D error covariance values that change depending on the number of hits made by the sensor (they typically start out large and get smaller as more accurate measurements are made). And, I have both a in the truck view and a God's Eye view, so the appeance of the ellipsoids will change depending on viewing angle. Would sprites work for this case? I may be out of luck in speeding this up, but just wanted to make sure that there was not a more efficient way that I'm missing. Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimization
What happens if you need to periodically update size, position, orientation of objects? Without using a PAT and putting everything in a single geometry is this possible? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Optimization and lots of objects
I guess I need to be a little more detailed in my project: I am simulating a vehicle driving down a test range with a sensor looking for targets. As a target is found, I add a geode-shapeDrawable(sphere) for each discovered target. As more hits are made by the sensor, the orientation, position, and scale of each of these spheres can change dynamically. So I have a PAT as the parent of each geode to facilitate the transforms for each target. The problem is frame rate drops significantly as I add more and more targets (I may need up to 1 of them!). I tried using the detailRatio on the sphere to reduce the number of polygons which helped a little, but not significantly. I have also tried using just a six-sided box as representative instead of the sphere, but still saw drastic frame rate drops. The osgStats show that most of the time is spent in the CULL process. My question - is there a better way of handling a large number of objects that must each be individually manipulated dynamically for the duration of the program (i.e., not static)? Im using a fairly Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to speed up osg:Shapedrawable with many instances
I have an OSG application where I am using osg::Shapedrawable(new osg::Sphere(...)) to represent errors ellipsoids (all have various sizes and locations) for targets on a terrain. Prior to their introduction into the scene, I am getting around 40 frames per second. After introducing 1000 of them, my frame rate goes down to 4-5 frames per second. I am using osg::Optimizer on my root node. Exactly how many polygons are drawn by default for osg::Sphere? Is there a way to reduce this? Is there a better way to draw thousands of these (noting that I have to apply a Position/Attitude/Size transform to each one)? I am using a Nvidia Quadro FX 570 in an Intel 3.0Ghz Duo Core processor runing Windows XP Pro. My viewer is set up in an overhead view, so I see them all every frame (i.e., I don't think culling will help here). And also, their PATs have to occassionally be updated (i.e., not static size, orientation, position). Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Event Adapter getXNormalized doesn't return normalized value
I have a OSG 2.3.7 application with an OSG viewer and two slave cameras. The first camera is a normal drive type view. The other is rotated 90 degrees so that it looks down on a terrain. I am using a pick event adapter with code gleaned from on of the OSG examples. The pick works fine on the first camera. When I switch to the other camera (which I have set up via a keyboard command to encompass the same viewport as the first), the event adapter function ea.getXnormalized does not return a normalized value - it returns something on the order of -13.0 from my second camera. Is this correct? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] esc key handler
Where in the osg source code is the close down section for when the user hits the esc key? I need to be able to replicate the code via a custom function, so I'd like to have it as a baseline. Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Disabling HUD in one camera
I currently have a setup with one viewer with two cameras. I add a HUD to the scene (as a child to the root node) and it shows up in both camera views. Is there an easy way to disable seeing it in one view? Some camera-Set... that will do this? (based on depth or something?) Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgmovie with mpgs or avis on windows
I have it working with both avis and mpgs on Windows. You need to make copies of the osgdb_qtd.dll (in the plugins directory) and rename them osgdb_mpgd.dll and osgdb_avid.dll . Then you can give either of these types of files as arguments to osgmovie. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Scribe outline only
Trying to modify the osgscribe example. I want to display the scribe lines, without the underlying model beneath it. The code does the following: root-addChild(decorator); decorator-addChild(loadedModel); The decorator setups up the scribe mode. If I then set the nodeMask of the loadedModel to 0 : loadedModel-setNodeMask(0), nothing appears. Intuitively, I would have thought this would show the scribe lines only. How do I achieve this effect? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] error in viewer.frame
Paul - Thanks! That fixed the problem. Can you explain why this was needed? /Paul Martz wrote: Try forcing SingleThreaded, either in your app by calling Viewer::setThreadModel, or with the env var OSG_THREADING=SingleThreaded. -Paul / ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Error in Viewer.Frame()
Using Windows XP, VS2005 debug, OSG 2.3.7. Getting an exception inviewer.frame(OSGSimTime); the first time through the render loop. Looking at the auto variable values, it appears that BoundingSphere has returned an error. I do call : terrainGroup-addChild(terrainNode); const osg::BoundingSphere bs = terrainNode-getBound(); but not in the actual render loop. Its value seem OK. The actual exception occurs in vector at this line here: _Myt operator++() {// preincrement _-- this line_ _SCL_SECURE_VALIDATE(this-_Mycont != NULL); _SCL_SECURE_VALIDATE_RANGE(_Myptr ((_Myvec *)(this-_Mycont))-_Mylast); ++_Myptr; return (*this); }- VStudio Auto variable values: _Mycont0x {_Myfirstiter=??? }const std::_Container_base * _MyfirstiterCXX0017: Error: symbol not found -this{_ptr=0x } std::_Vector_const_iteratorosg::ref_ptrosg::Node,std::allocatorosg::ref_ptrosg::Node * const -ptr{_ptr=0x }osg::ref_ptrosg::Node -_ptr0x {_initialBound={...} _computeBoundCallback={...} _boundingSphere={...} ...}osg::Node * +osg::Object{_name={...} _dataVariance=??? _userData={...} }osg::Object +_initialBound{_center={...} _radius=??? } osg::BoundingSphere +_computeBoundCallback{_ptr=??? } osg::ref_ptrosg::Node::ComputeBoundingSphereCallback -_boundingSphere{_center={...} _radius=??? } osg::BoundingSphere -_center{_v=0x004b }osg::Vec3f -_v0x004bfloat [3] [0]CXX0030: Error: expression cannot be evaluated [1]CXX0030: Error: expression cannot be evaluated [2]CXX0030: Error: expression cannot be evaluated _radiusCXX0030: Error: expression cannot be evaluated _boundingSphereComputedCXX0030: Error: expression cannot be evaluated _parents{_Myfirst=??? _Mylast=??? _Myend=??? } std::vectorosg::Group *,std::allocatorosg::Group * +_updateCallback{_ptr=??? }osg::ref_ptrosg::NodeCallback _numChildrenRequiringUpdateTraversalCXX0030: Error: expression cannot be evaluated +_eventCallback{_ptr=??? }osg::ref_ptrosg::NodeCallback _numChildrenRequiringEventTraversalCXX0030: Error: expression cannot be evaluated +_cullCallback{_ptr=??? }osg::ref_ptrosg::NodeCallback _cullingActiveCXX0030: Error: expression cannot be evaluated _numChildrenWithCullingDisabledCXX0030: Error: expression cannot be evaluated _numChildrenWithOccluderNodesCXX0030: Error: expression cannot be evaluated _nodeMaskCXX0030: Error: expression cannot be evaluated _descriptions{_Myfirst=??? _Mylast=??? _Myend=??? } std::vectorstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,std::allocatorstd::basic_stringchar,std::char_traitschar,std::allocatorchar +_stateset{_ptr=??? }osg::ref_ptrosg::StateSet Stack Trace : osg33-osgd.dll!std::_Vector_const_iteratorosg::ref_ptrosg::Node,std::allocatorosg::ref_ptrosg::Node ::operator++() Line 117 + 0x33 bytesC++ osg33-osgd.dll!std::_Vector_iteratorosg::ref_ptrosg::Node,std::allocatorosg::ref_ptrosg::Node ::operator++() Line 337C++ osg33-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Line 60 + 0x8 bytesC++ osg33-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Line 181 + 0x1c bytesC++ osg33-osgUtild.dll!osgUtil::GLObjectsVisitor::apply(osg::Node node={...}) Line 36 + 0xf bytesC++ osg33-osgd.dll!osg::NodeVisitor::apply(osg::Group node={...}) Line 236 + 0x22 bytesC++ osg33-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Line 38 + 0x41 bytesC++ osg33-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Line 62 + 0x25 bytesC++ osg33-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Line 181 + 0x1c bytesC++ osg33-osgUtild.dll!osgUtil::GLObjectsVisitor::apply(osg::Node node={...}) Line 36 + 0xf bytesC++ osg33-osgd.dll!osg::NodeVisitor::apply(osg::Group node={...}) Line 236 + 0x22 bytesC++ osg33-osgd.dll!osg::NodeVisitor::apply(osg::Transform node={...}) Line 248 + 0x22 bytesC++ osg33-osgd.dll!osg::NodeVisitor::apply(osg::Camera node={...}) Line 249 + 0x22 bytesC++ osg33-osgd.dll!osg::Camera::accept(osg::NodeVisitor nv={...}) Line 46 + 0x41 bytesC++ osg33-osgUtild.dll!osgUtil::GLObjectsOperation::operator()(osg::GraphicsContext * context=0x033a6dc0) Line 174 + 0x2f bytesC++ osg33-osgd.dll!osg::GraphicsOperation::operator()(osg::Object * object=0x033a6dc0) Line 50 + 0x19 bytesC++ osg33-osgd.dll!osg::OperationThread::run() Line 413 + 0x26 bytes C++
[osg-users] How to set Texturerect to BGRA?
Hi, I have the following simple program (modified texture rectangle sample). I'm reading a set of large (1920x1080) bitmaps from disk and swapping each callback loop. My problem is that the bmps need to be in BGRA instead of RGBA format. Can I change the TextureRectangle in OSG to compensate for this? Mike Greene //code #include osg/Notify #include osg/TextureRectangle #include osg/Geometry #include osg/Geode #include osg/TexMat #include osg/Group #include osg/Projection #include osg/MatrixTransform #include osgText/Text #include osgDB/Registry #include osgDB/ReadFile #include osgViewer/Viewer osg::Image* img = new osg::Image(); osg::TextureRectangle* texture = new osg::TextureRectangle(); long texturecounter = 0; class TextureChangeCallback : public osg::NodeCallback { public: TextureChangeCallback( double delay = 0.05) : _phaseS(35.0f), _phaseT(18.0f), _phaseScale(5.0f), _delay(delay), _prevTime(0.0) { } virtual void operator()(osg::Node*, osg::NodeVisitor* nv) { if (texturecounter == 0) img = osgDB::readImageFile(c:\\mgreene\\data\\mach00.bmp); if (texturecounter == 1) img = osgDB::readImageFile(c:\\mgreene\\data\\mach01.bmp); if (texturecounter == 2) img = osgDB::readImageFile(c:\\mgreene\\data\\mach02.bmp); if (texturecounter == 3) img = osgDB::readImageFile(c:\\mgreene\\data\\mach03.bmp); if (texturecounter == 4) img = osgDB::readImageFile(c:\\mgreene\\data\\mach04.bmp); if (texturecounter == 5) img = osgDB::readImageFile(c:\\mgreene\\data\\mach05.bmp); texture-setImage(img); texturecounter+=1; if (texturecounter == 6) texturecounter = 0; } private: float _phaseS, _phaseT, _phaseScale; double _delay; double _prevTime; }; int main(int argc, char** argv) { // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(argc,argv); osg::Group* root = new osg::Group; osg::BoundingBox bb(0.0f,0.0f,0.0f,1.0f,1.78f,1.78f); / osg::Vec3 top_left(bb.xMin(),bb.yMax(),bb.zMax()); osg::Vec3 bottom_left(bb.xMin(),bb.yMax(),bb.zMin()); osg::Vec3 bottom_right(bb.xMax(),bb.yMax(),bb.zMin()); osg::Vec3 top_right(bb.xMax(),bb.yMax(),bb.zMax()); // create geometry osg::Geometry* geom = new osg::Geometry; osg::Vec3Array* vertices = new osg::Vec3Array(4); (*vertices)[0] = top_left; (*vertices)[1] = bottom_left; (*vertices)[2] = bottom_right; (*vertices)[3] = top_right; geom-setVertexArray(vertices); osg::Vec2Array* texcoords = new osg::Vec2Array(4); (*texcoords)[0].set(0.0f, 0.0f); (*texcoords)[1].set(1.0f, 0.0f); (*texcoords)[2].set(1.0f, 1.0f); (*texcoords)[3].set(0.0f, 1.0f); geom-setTexCoordArray(0,texcoords); osg::Vec3Array* normals = new osg::Vec3Array(1); (*normals)[0].set(0.0f,-1.0f,0.0f); geom-setNormalArray(normals); geom-setNormalBinding(osg::Geometry::BIND_OVERALL); osg::Vec4Array* colors = new osg::Vec4Array(1); (*colors)[0].set(1.0f,1.0f,1.0f,1.0f); geom-setColorArray(colors); geom-setColorBinding(osg::Geometry::BIND_OVERALL); geom-addPrimitiveSet(new osg::DrawArrays(GL_QUADS, 0, 4)); // disable display list so our modified tex coordinates show up geom-setUseDisplayList(false); // load image img = osgDB::readImageFile(c:\\mgreene\\data\\mach00.bmp); // setup texture texture-setImage(img); osg::TexMat* texmat = new osg::TexMat; texmat-setScaleByTextureRectangleSize(true); // setup state osg::StateSet* state = geom-getOrCreateStateSet(); state-setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON); state-setTextureAttributeAndModes(0, texmat, osg::StateAttribute::ON); // turn off lighting state-setMode(GL_LIGHTING, osg::StateAttribute::OFF); // install 'update' callback osg::Geode* geode = new osg::Geode; geode-addDrawable(geom); geode-setUpdateCallback(new TextureChangeCallback()); // root-addChild(geode); // construct the viewer. osgViewer::Viewer viewer; // create a model from the images. osg::Node* rootNode = root;//createModel((arguments.argc() 1 ? arguments[1] : b:\\test00.jpg));//Images/lz.rgb)); // add model to viewer. viewer.setSceneData(rootNode); viewer.realize(); while( !viewer.done() ) { viewer.run(); } return 0; // return viewer.run(); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph 2.4 released
In the QuickTime Live feed stuff, has anything changed from 2.3.7 (maybe a ? for Colin). I'm still having some issues with an HD live feed with 2.3.7 and was just curious if anything has changed since? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Building VirtualPlanetBuilder and osgdem on Windows
Robert Osfield wrote : Hi Mike, Could you try the SVN version of VPB as this may fix the CSLSetNameValue issue. The other errors suggest that your Windows files as different than other Windows users have. Could you specify the OS version etc. Robert. Well, I downloaded the April 1, 2008 SVN version. I'm using Windows XP Pro and Visual Studio 2005. The suggested dependency package, osgtoy.svn.sourceforge.net/svnroot/osgtoy/3rdParty/branches/ does not include GDAL. If I download the latest GDAL, the included Visual Studio 2005 (Version 8) build solution does not work correctly. Is there a new dependency package somewhere that contains ALL the necessary components and that has been checkout on Windows with the latest svn versions? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Building VirtualPlanetBuilder and osgdem on Windows
I have OSG 2.3.5 installed and running correctly. I have downloaded and tried to build VPB 0.9.5, 0.9.6, and 0.9.7 all to no avail. I get 3 undefines : getcwd chdir CSLSetNameValue The first two I can't find anywhere in my OSG directory structure in any of the include files... The last one is found in cpl_string.h b ut this is not included in the source files. I used the included CMAKE files and built the Visual 2005 solution files, and satisfied all the required environment vars. What am I missing? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quicktime plugin live streaming documentation/examples
Colin, Success! Using the later version of VDIG that you referenced, I was able to get a live stream to work with osgmovie. I'm using a KOCOM camera running video through a Canopus ADVC 110 A/D video convertor into a firewire cable. This is on Windows XP, OSG 2.3.5, Visual Studio 2005 debug, Quicktime SDK 7.3. Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quicktime plugin live streaming documentation/examples
OK, I've hooked a video input source up to my firewire card. I've made sure that the qt plugin can recognize (.live) extensions. When I run osgmovied.exe --devices, I get messages about QT QTML, QT Movies, and QT QTML (again) starting up and closing down successfully. But the last line output is : available Video DigitizerComponents : 0 I know the video is working because I have a VideoLan Client instance running and it shows the output of the camera feed. Is there there something else (maybe relative to QuickTime) that I need to specify? Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quicktime plugin live streaming documentation/examples
Further progress : used WinVIDG to make the bridge between DirectShow devices and quicktime. Seemed to work. Ran osgmovied --devices - got this output: QT QTML: Starting up... QT QTML: initialized successfully QT Movies: Starting up... QT Movies: initialized successfully QT Movies: Closing down... QT Movies: closed successfully QT QTML: Closing down... QT QTML: Closed successfully QT QTML: Starting up... QT QTML: initialized successfully QT Movies: Starting up... QT Movies: initialized successfully available Video DigitizerComponents : 1 Component Name: Microsoft DV Camera and VCR-WDM Desc: Direct Show Proxy for QuickTime Digitizers DigitizerInfo: Digitizer Type : Basic (no clipping) Hardwre Slot : 0 Input Capability: NTSC : true PAL : true Composite : true Component : true SVideo: false Input Current: NTSC : true PAL : true Composite : true Component : true SVideo: false Min destination width,height : 160 120 Max destination width,height : 720 480 NTSC : true PAL : true Composite : true Component : true SVideo: false GenLock : false SECAM : true VTR_Broadcast : false Color : true BW: false *SignalLock* : true VDGetPreferredImageDimensions(aComponent, pref_width, pref_height) - ERROR Number of inputs: 0 VDGetInputName(aComponent,(long)i, name) - ERROR Format of input : compositeIn Currently active input : 0 QT Movies: Closing down... QT Movies: closed successfully QT QTML: Closing down... QT QTML: Closed successfully QT QTML: Starting up... QT QTML: initialized successfully QT Movies: Starting up... QT Movies: initialized successfully available SequenceGrabber Components : 1 Component Name: Movie Grabber Desc: Assists applications recording QuickTime movies SrcVideoBounds: 720 480 Could not get DeviceAndInput names from Video SG ChannelDeviceAndInputNamesNumber: Microsoft DV Camera and VCR-WDM : : 0 DeviceList from Video SG ok DeviceList : 1 devices in total DeviceList : 0 is current device Device ID : 0 : DeviceNameStr : Microsoft DV Camera and VCR-WDM InputList : 1 inputs in total InputList : 0 is current input InputNameStr : 0 Could not get DeviceAndInput names from Sound SG ChannelDeviceAndInputNamesNumber: Microsoft DV Camera and VCR-WDM : : 0 DeviceList from Sound SG ok DeviceList : 1 devices in total DeviceList : 0 is current device Device ID : 0 : DeviceNameStr : waveIn InputList : 1 inputs in total InputList : 0 is current input InputNameStr : 0 Default QT Movies: Closing down... QT Movies: closed successfully QT QTML: Closing down... QT QTML: Closed successfully Then I ran osgmovied 0:0.live --- got this output QT QTML: Starting up... QT QTML: initialized successfully QT Movies: Starting up... QT Movies: initialized successfully QT Movies: Closing down... QT Movies: closed successfully QT QTML: Closing down... QT QTML: Closed successfully QT QTML: Starting up... QT QTML: initialized successfully QT Movies: Starting up... QT Movies: initialized successfully SrcVideoBounds: 720 480 QT Movies: Closing down... QT Movies: closed successfully QT QTML: Closing down... QT QTML: Closed successfully VDGetDigitizerInfo(aComponent, vid_info) - ERROR Error: Thread 01C66FCC still running in destructor The app starts up an OSG window, but it is all gray. Any help/ideas? I have seen a few net hits about incompatible versions of Quicktime. I'll look into that next. Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Quicktime plugin live streaming documentation/examples
I've been using the QT plugin for sometime now with a pre-recorded movie (.mov). I now want to send it live streams. Is there any documentation/examples on how to do this? I use VideoLan Client to start a multicast stream (udp://@2xx.xxx.xxx.xxx:1234) and can see it remotely, so I know it is streaming correctly. How do I tell the plugin what to look for as far as URL for the incoming stream? I tried using the straight QuickTime player just to see if it would open the stream and have been unsuccessful thus far in giving a correctly formed URL. I glanced through the QT plugin code and saw something about a .live file? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Simple Mailing list question - message numbers
In other mailing lists that I subscribe to, the message number is given in the header of the actual message as it corresponds to the topic summary. In the OSG mailings, although the message number is given in the top summary, it does not appear in the actual message itself, thus making it fairly difficult to quickly scroll down and find a particular message. Is this an option that could easily be turned on? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org