Re: [osg-users] play animation backwards?
Hi Paul, Thank your for your suggestion. Decrementing the simulation time in Viewer::frame() would probably allow to play one animation backwards. But I would be stuck if I wanted to play two different animations at the same time, one being played backwards and one in the normal direction? Cheers, Thilo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48640#48640 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] [SOLVED] osgPlugins DAE (collada) ReaderWriterDAE.cpp, daeReader.h VS2010 compile errors
Hi, OSG 3.0.1 Release, I didn't make changes to src. Cmake build a solution. Compile ReaderWriterDAE.cpp I got many errors (about 60), first was: 13 ReaderWriterDAE.cpp 13...\src\osgplugins\dae\daeReader.h(161): error C2146: syntax error: missing ';' before identifier getAssetUpAxis Please, tell me, how can I build dae pluging. Thank you! Cheers, formusic -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48597#48597 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgPlugins DAE (collada) ReaderWriterDAE.cpp, daeReader.h VS2010 compile errors
I used Collada dom 2.4. But in OSG WiKi: As of December 2011, testing indicates that the plugin still does not work with the COLLADA DOM version 2.3.x, but does work with the 2.2. With COLLADA DOM version 2.2. it works fine (almost :D ) In ..\src\osgPlugins\dae\daeWSceneObjects.cpp we have 292: if ((node.getCenterMode()==osg::LOD::USER_DEFINED_CENTER)||(node.getCenterMode()==osg::LOD::UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED)) but OSG 3.0.1 doesn't have osg::LOD::UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48636#48636 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSGAndroidExample - 3D model disappears when device goes to sleep
Hi, I successfully compiled OSG for Android on Windows using the nice tutorial from this forum ([Tutorial] Building osgAndroidExampleGLES1/2 on Ubuntu 11.10). The example runs pretty well (especially if you ignore everything Eclipse says). My problem is that my 3D Model dissapears from the viewer when the device goes to sleep or when I go to the home screen and go back in the App. The model is still in the App (I can delete it from the scene) but it doesn't show. The problem also appears when the SurfaceView is resized. I've been looking for an answer for a week now and didn't find any real solution. Setting up PreserveEGLContextOnPause (public void setPreserveEGLContextOnPause (boolean preserveOnPause) Control whether the EGL context is preserved when the GLSurfaceView is paused and resumed. ) didn't do anything for me... I also tried to reload the objects by deleting/loading them. That looks like a bad idea to me... anyway it doesn't work properly. I'm using a Tegra3 Android 4.0.3 Device. Is it an Android problem ? A basic OSG problem ? An OSG on Android problem ? I simply wanted to know if any of you already had (and hopefully solved) this problem or if you could show me the right direction. Thank you! Cheers, Keep up the good work, Emil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48632#48632 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] How to acquire the current location information of a drawable object? And how to calculate the distance between an object and the viewpoint?
Hi all, I'm quite new to OSG and have no OPENGL background. I want to know how to acquire the current location information of a drawable object? Actually the initial position of the geometry is set by me. But when I move the objects with mouse, the spatial information changes, right? So I want to acquire such information. For the second question, how to calculate the distance between an object and the viewpoint? Because I want to differentiate the 'stateset' when objects are far away from the viewpoint and when they are close to the camera. And I don't even know where the camera viewpoint is! Regards and thank you! Cheers, Fan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48628#48628 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGAndroidExample - 3D model disappears when device goes to sleep
Nah, it's just it's default behaviour. Every time the context is regenerated (open application, change screen orientation, go to desktop and resume, etc) it creates again the viewer for the new conditions and the scene is emptied. It's a toy example and there are a lot of cases that have to be accounted in a real world application and that i didn't put there. The logic step it's to preserve the root node of the scene in some way, like passing a reference pointer to the java section or maintain a variable in the native path, but beware of global pointers to such work because they tend to be unrealiable. Good luck 2012/7/2 Emil Le sur emilien.le...@global-vision-systems.com Is it an Android problem ? A basic OSG problem ? An OSG on Android problem ? I simply wanted to know if any of you already had (and hopefully solved) this problem or if you could show me the right direction. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
Hi Chris, xe...@alphapixel.com Use the Google cache. The original wiki seems to be getting over-run by crap now. Off topic, but the culprit is a Microsoft bot, a crawler for bing. I doublechecked the IP's and all of them belong to microsoft . I have tried to disallow the indexing of this robot, we will see. Anyway there are many people getting spoofed by this crawler...sic. Cheers. Thanks, Michael -- ** ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
Download it from here: http://www.openscenegraph.org/projects/VirtualPlanetBuilder/ -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48652#48652 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] AlphaPixel (and OSG?) swag and apparel?
Will the UK site ship to the US of A? there is no OpenSceneGraph at the US site that I can find! robertosfield wrote: Hi Chris, You do know we already have a cafepress entry for OpenSceneGraph: http://www.cafepress.co.uk/openscenegraph Robert. On 26 June 2012 02:01, Chris Hanson wrote: Hey, I just finished setting up a CafePress store for AlphaPixel apparel and logo stuff (mostly so I could make myself some). http://www.cafepress.com/alphapixel I set the margins down really low, so I think I get about 50 cents of profit on typical items, but if any of you want to show your support for AlphaPixel, go buy yourself some stuff. Maybe I'll earn enough to buy myself a few more shirts. It occurred to me when I was done that I could set up a similar set of customized logo stuff for the OpenSceneGraph logo. Would anyone want that sort of thing? Would anyone be offended if I did so? I don't recall exactly what license the OSG logo is under, but I don't want to step on any toes here. -- Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum David Glenn --- D Glenn 3D Computer Graphics amp; Media Systems. www.dglenn.com -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48655#48655 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
On Tue, Jul 3, 2012 at 1:54 AM, Jordi Torres jtorresfa...@gmail.com wrote: Hi Chris, Use the Google cache. The original wiki seems to be getting over-run by crap now. Off topic, but the culprit is a Microsoft bot, a crawler for bing. I doublechecked the IP's and all of them belong to microsoft . I have tried to disallow the indexing of this robot, we will see. Anyway there are many people getting spoofed by this crawler...sic. Are you saying a Microsoft bot/IP is posting spam to the wiki? If you have evidence of this you should be contacting Bing / Microsoft Abuse immediately. Cheers. Thanks, Michael -- ** ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
2012/7/3 Chris Hanson xe...@alphapixel.com On Tue, Jul 3, 2012 at 1:54 AM, Jordi Torres jtorresfa...@gmail.comwrote: Hi Chris, Use the Google cache. The original wiki seems to be getting over-run by crap now. Off topic, but the culprit is a Microsoft bot, a crawler for bing. I doublechecked the IP's and all of them belong to microsoft . I have tried to disallow the indexing of this robot, we will see. Anyway there are many people getting spoofed by this crawler...sic. Are you saying a Microsoft bot/IP is posting spam to the wiki? Nope, they are not posting spam, but eating all the resources of the trac til the extenuation. But it seems they are not following the rules of the game w.r.t robots.txt. Our trac is not working well since a couple of years ago, so any overhead on the server results in a fall down of the server. This week I'll do some changes and I hope it will be running better. If you have evidence of this you should be contacting Bing / Microsoft Abuse immediately. If they continue with this kind of DoS attack I will put a rule in the firewall to prevent this issue, and of course I'll contact them. Cheers. Cheers. Thanks, Michael -- ** ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
Nope, they are not posting spam, but eating all the resources of the trac til the extenuation. But it seems they are not following the rules of the game w.r.t robots.txt. Our trac is not working well since a couple of years ago, so any overhead on the server results in a fall down of the server. This week I'll do some changes and I hope it will be running better. If they continue with this kind of DoS attack I will put a rule in the firewall to prevent this issue, and of course I'll contact them. Ahh. was referring to the spam on pages like these: http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/X-RayRecycling http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/GiftBaskets -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
2012/7/3 Chris Hanson xe...@alphapixel.com Nope, they are not posting spam, but eating all the resources of the trac til the extenuation. But it seems they are not following the rules of the game w.r.t robots.txt. Our trac is not working well since a couple of years ago, so any overhead on the server results in a fall down of the server. This week I'll do some changes and I hope it will be running better. If they continue with this kind of DoS attack I will put a rule in the firewall to prevent this issue, and of course I'll contact them. Ahh. was referring to the spam on pages like these: http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/X-RayRecycling http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/GiftBaskets This is because the VPB wiki is open (I don't know why), I will contact Robert when he returns and I'll ask to him if there is any reason to have this open. Cheers. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] build issue: android/osgViewer/svn trunk
I just grabbed the trunk recently from the subversion repository and tried to undergo the android build. However, I was coming upon build errors when it gets to the osgViewer package, specifically it seems to not be able to find X11 headers. I was able to circumvent this by changing the OSG_WINDOWING_SYSTEM from X11 to nothing [just a blank field], which produced some warnings through cmake. When I compiled OpenSceneGraph-3.0.1 for android this variable was set to X11 and it didn't seem to produce any build errors. Anyway just thought this was something that someone should take note of... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48660#48660 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] build issue: android/osgViewer/svn trunk
also seems to be segfaulting on me whenever i try to load a model not so with 3.0.1 -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48662#48662 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Issue adding transparency to a simple model
Hi. I have a simple model I wanted to apply transparency to. I load the model data into a geometry node, and set my scene up. To get a transparent effect, I apply an alpha value to gl_FragColor in my fragment shader. The shaders are trivial: Vertex: void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } Fragment: void main() { gl_FragColor = vec4(1,0,0,0.5); } I get a strange output that sort of works, but renders a different result based on the camera position. It's hard to describe so I attached a short youtube clip. It seems like certain triangles are only rendered at certain camera angles. http://youtu.be/fQUFSff-uuU I played around with some of the settings I thought might be relevant but I still get the effect that the video shows. osg::StateSet *ss = geodeMesh-getOrCreateStateSet(); ss-setAttributeAndModes(shProgram,osg::StateAttribute::ON); ss-setMode(GL_BLEND,osg::StateAttribute::ON); // options i tried changing around //ss-setMode(GL_DEPTH_TEST,osg::StateAttribute::ON); //ss-setMode(GL_DEPTH_WRITEMASK,osg::StateAttribute::OFF); //ss-setMode(GL_CULL_FACE,osg::StateAttribute::OFF); //ss-setRenderingHint(osg::StateSet::TRANSPARENT_BIN); Any advice would be appreciated. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Issue adding transparency to a simple model
What are you doing to ensure that the triangles are rendered in back-to-front order? -Paul On 7/3/2012 2:06 PM, Preet wrote: Hi. I have a simple model I wanted to apply transparency to. I load the model data into a geometry node, and set my scene up. To get a transparent effect, I apply an alpha value to gl_FragColor in my fragment shader. The shaders are trivial: Vertex: void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } Fragment: void main() { gl_FragColor = vec4(1,0,0,0.5); } I get a strange output that sort of works, but renders a different result based on the camera position. It's hard to describe so I attached a short youtube clip. It seems like certain triangles are only rendered at certain camera angles. http://youtu.be/fQUFSff-uuU I played around with some of the settings I thought might be relevant but I still get the effect that the video shows. osg::StateSet *ss = geodeMesh-getOrCreateStateSet(); ss-setAttributeAndModes(shProgram,osg::StateAttribute::ON); ss-setMode(GL_BLEND,osg::StateAttribute::ON); // options i tried changing around //ss-setMode(GL_DEPTH_TEST,osg::StateAttribute::ON); //ss-setMode(GL_DEPTH_WRITEMASK,osg::StateAttribute::OFF); //ss-setMode(GL_CULL_FACE,osg::StateAttribute::OFF); //ss-setRenderingHint(osg::StateSet::TRANSPARENT_BIN); Any advice would be appreciated. ___ 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] Issue adding transparency to a simple model
On Tue, Jul 3, 2012 at 4:45 PM, Paul Martz pma...@skew-matrix.com wrote: What are you doing to ensure that the triangles are rendered in back-to-front order? -Paul Nothing! How can I preprocess the data to achieve that? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Issue adding transparency to a simple model
If you're unable to decompose your con-convex model into convex components, then you'll need an order-independent solution such as depth peeling. One possible implementation of depth peeling in OSG is demonstrated with the osgoit example. -Paul On 7/3/2012 3:10 PM, Preet wrote: On Tue, Jul 3, 2012 at 4:45 PM, Paul Martz pma...@skew-matrix.com wrote: What are you doing to ensure that the triangles are rendered in back-to-front order? -Paul Nothing! How can I preprocess the data to achieve that? ___ 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] constant size overlay
My initial implementation with AutoTransform is not fast enough for my application. I have thousands of MatrixTransforms sharing a single AutoTransform with a child Geode, containing a geometry with two lines. I was getting around 17 fps. Removing the AutoTransforms improved the framerate to 20-25 fps (20 is sufficient for my application). Since I still need the constant size, I am attempting to use an alternate implementation with PointSprites to see if that performs any better. I used the osgpointsprite example as a guide. However, I'm having trouble getting transparency to work. I want a white 'X' to overlay the rest of the scene at each point. What I am getting is a black opaque box at each point, with the white X inside the box. I've set the alpha to 0 in the point color array, and in the texture outside the X. Can someone help me figure out what I'm doing wrong? Here's the code: Code: osg::ref_ptrosg::Geode geode = new osg::Geode; osg::ref_ptrosg::Geometry geom = new osg::Geometry; osg::ref_ptrosg::Vec3Array vertices = new osg::Vec3Array; vertices-push_back(osg::Vec3(0.0, 0.0, 10.0)); osg::ref_ptrosg::Vec4Array colors = new osg::Vec4Array; colors-push_back(osg::Vec4(0.0, 0.0, 0.0, 0.0)); geom-setVertexArray(vertices); geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POINTS, 0, 1)); geom-setColorArray(colors); geom-setColorBinding(osg::Geometry::BIND_PER_VERTEX); geode-addDrawable(geom); // Give it an initial bound so it doesn't get culled (osg can't calculate a bounding volume for a single point) geode-setInitialBound( osg::BoundingSphere( osg::Vec3(0.0, 0.0, 0.0), 100.0 ) ); const int pixelsX = 50; const int pixelsY = 50; const int bytesPerPixel = 4; unsigned char *buf = new unsigned char[pixelsX * pixelsY * bytesPerPixel]; memset(buf, 0x00, pixelsX*pixelsY*bytesPerPixel); for (int i = 0; i pixelsX; i++) { for (int j = 0; j pixelsY; j++) { if (i == j || pixelsX - i - 1 == j) { for (int k = 0; k bytesPerPixel; k++) { buf[i * pixelsY * bytesPerPixel + j * bytesPerPixel + k] = 0xFF; } } } } osg::ref_ptrosg::Image img = new osg::Image; img-setImage(pixelsX, pixelsY, 1, GL_RGBA8,// internal format GL_RGBA, // pixel format GL_UNSIGNED_INT_8_8_8_8_REV, // pixel data type buf, // data buffer osg::Image::USE_NEW_DELETE); // allocation mode osg::ref_ptrosg::Texture2D tex = new osg::Texture2D; tex-setImage(img); tex-setBorderColor(osg::Vec4(0.0, 0.0, 0.0, 0.0)); osg::ref_ptrosg::PointSprite sprite = new osg::PointSprite; osg::ref_ptrosg::Point point = new osg::Point; point-setSize(100.0); osg::ref_ptrosg::StateSet ss = geode-getOrCreateStateSet(); ss-setTextureAttributeAndModes(0, sprite, osg::StateAttribute::ON); ss-setTextureAttributeAndModes(0, tex, osg::StateAttribute::ON); ss-setAttribute(point); ss-setMode(GL_LIGHTING, osg::StateAttribute::OFF); osg::ref_ptrosg::TexEnv texenv = new osg::TexEnv; texenv-setMode(osg::TexEnv::DECAL); ss-setTextureAttribute(0, texenv); Thanks, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48668#48668 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] constant size overlay
You have to enable blending. Try this: [code] ss-setRenderingHint(osg::StateSet::TRANSPARENT_BIN); ss-setMode(GL_BLEND,osg::StateAttribute::OVERRIDE | osg::StateAttribute::PROTECTED | osg::StateAttribute::ON); [/code] Thank you! Cheers, Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48670#48670 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org