[osg-users] Whole Earth TerraPage video (all OSG and SilverLight)
Hey community, this is da promised video. Cedric, thanks for the Earth manipulator !!! http://www.youtube.com/watch?v=5SXMaP6Kvl0 Cheers !! p.s. me da Nick from nikolov.tra...@gmail.com, trajce.nikolov...@gmail.com, n...@rop.mk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] available for short term stuff
Guys, any stuff you can hand off to me? I have short term vacancy? Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] I am back
Hello community, I am back :) .. and looking forward to work with you again :) I want to do a game. With opensource .. Who is with me? Cheers ! -nick p.s Greets from Abu Dhabi, UAE ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Happy New Year !
so quiet these days :) .. Happy New Year osgers ! -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] draw a 3D pipe
hi lucie, here is something with geometry shaders ... might get you inspired -Nick On Wed, Dec 22, 2010 at 6:42 PM, lucie lemonnier lucielemonn...@hotmail.frwrote: Hi, I want to draw a 3D curved pipe from a list of points. I looked at osgModeling but I don't know how to do this. Would you have an idea using osgModeling or something else? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35083#35083 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org #include osg/Notify #include osg/ref_ptr #include osg/Geode #include osg/Geometry #include osg/Vec3 #include osg/Vec4 #include osg/Program #include osg/Shader #include osg/Uniform #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osgGA/StateSetManipulator /// static const char* vertSource = { void main(void)\n {\n gl_Position = gl_Vertex; \n gl_FrontColor = gl_Color; \n }\n }; static const char* geomSource = { #version 120 \n #extension GL_EXT_geometry_shader4 : enable \n uniform int numCylinderSegments;\n uniform float cylinderRadius; \n vec3 rotateVec3(vec4 q,vec3 v) \n {\n vec3 uv, uuv;\n vec3 qvec = vec3(q.x, q.y, q.z); \n uv = cross(qvec,v); \n uuv = cross(qvec,uv); \n uv *= ( 2.0 * q.w ); \n uuv *= 2.0; \n return v + uv + uuv; \n }\n void main(void)\n {\n { \n vec4 q1 = gl_FrontColorIn[0]; \n vec4 p1 = gl_PositionIn[0];\n vec4 p2 = gl_PositionIn[1];\n vec4 q2 = gl_FrontColorIn[1]; \n { \n for (int i=0; i=numCylinderSegments; ++i) \n { \n float a = 3.14159265358979323846*2.0 / float(numCylinderSegments);\n \n float x = cos(a*float(i))*cylinderRadius; \n float y = sin(a*float(i))*cylinderRadius; \n float z = 0.0; \n \n float clr = cos(a*float(i)+1.57079632679489661923);\n vec3 vx = vec3(x,y,z); \n \n gl_Position = gl_ModelViewProjectionMatrix * vec4(rotateVec3(q2,vx)+p2.xyz,1.0);\n gl_FrontColor = vec4(clr,clr,clr,1.0); \n EmitVertex(); \n \n gl_Position = gl_ModelViewProjectionMatrix * vec4(rotateVec3(q1,vx)+p1.xyz,1.0);\n gl_FrontColor = vec4(clr,clr,clr,1.0); \n EmitVertex(); \n } \n EndPrimitive(); \n } \n } \n }\n }; static const char* fragSource = { void main(void)\n {\n gl_FragColor = gl_Color; \n }\n }; /// osg::Program* createShader(int numVxs) { osg::Program* pgm = new osg::Program; pgm-setName( osgshader2 demo ); pgm-addShader( new osg::Shader( osg::Shader::VERTEX, vertSource ) ); pgm-addShader( new osg::Shader( osg::Shader::FRAGMENT, fragSource ) ); pgm-addShader( new osg::Shader( osg::Shader::GEOMETRY, geomSource ) ); pgm-setParameter( GL_GEOMETRY_VERTICES_OUT_EXT, numVxs ); pgm-setParameter( GL_GEOMETRY_INPUT_TYPE_EXT, GL_LINES ); pgm-setParameter( GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_TRIANGLE_STRIP ); return pgm; } /// class CatMullRomCurve : public osg::Geometry { public: CatMullRomCurve(int numCurveSegments = 100, int numCylinderSegments = 35,float cylinderRadius = 0.035f) { std::vectorosg::Vec3 vxs; vxs.push_back( osg::Vec3(0,0,0) ); vxs.push_back( osg::Vec3(1,1,0) ); vxs.push_back( osg::Vec3(0.5,0.5,0.5) ); vxs.push_back( osg::Vec3(1.0,1.0,1.0) ); vxs.push_back( osg::Vec3(1.5,1.5,0.5) ); osg::Vec3Array* vAry = new osg::Vec3Array; setVertexArray( vAry ); osg::Vec4Array* quatsIncolorArray = new osg::Vec4Array; setColorArray(quatsIncolorArray); setColorBinding(BIND_PER_VERTEX); for (unsigned int i=0; ivxs.size()-1; ++i) { int idx0 = i0?i-1:0; int idx1 = i; int idx2 = i+1; int idx3 = idx2(int)vxs.size()-1?idx2+1:idx2; osg::Vec3 p0 = vxs.at(idx0); osg::Vec3 p1 = vxs.at(idx1); osg::Vec3 p2 = vxs.at(idx2); osg::Vec3 p3 = vxs.at(idx3); for (int j=0; jnumCurveSegments; ++j) { float t =
Re: [osg-users] Setting camera Viewmatrix with TrackBallManipulator Matrix gives nothing but black screen
if this is your code (with all the comments) then here is what you should do: - forget about your osg::Camera* camera = new Camera; // there is already a Camera attached to the View - use view.getCamera()-setProjectionMatrixAsPerspective(45,1,1,1000); - no need to attach any CameraManipulator if you want to set the view matrix by your own (although that is the purpose of the CameraManipulator, to change the view matrix - probably you do it this way when you get more familiar with the code) - in your loop you do viewer.getView(0)-getCamera()-setViewMatrixAsLookAt(eye,center,up) -Nick On Wed, Dec 15, 2010 at 7:02 PM, Bart Jan Schuit osgfo...@tevs.eu wrote: Hi, I'm trying to setup some cameras without a manipulator. When I assign a Trackballmanipulator on the vies, I get the cow projected on the screen. But as soon as I manually setup the cameras, I get a completely black screen. I extract eye, center and up from Tman (Trackballmanipulator) by Tman-getMatrix().lookat(eye, center, up). This gives some nice coordinates, but when I put these in a camera without a manipulator like Tman, I just get a black screen. What am I doing wrong here? Code: int main( int argc, char **argv ) { // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(argc,argv); osg::Group* scene = new osg::Group(); osg::Node* groundNode = NULL; groundNode = osgDB::readNodeFile(cow.osg); scene-addChild(groundNode); osgViewer::CompositeViewer viewer(arguments); if (arguments.read(-2)) { // view one { osg::Vec3d eye = osg::Vec3d(0,0,250); osg::Vec3d center = osg::Vec3d(0,0,250); osg::Vec3d up = osg::Vec3d(0,0,-1); osg::Quat rotation; osg::Matrixd viewmat; osg::Camera* camera = new osg::Camera; osgViewer::View* view = new osgViewer::View; view-setName(View one); viewer.addView(view); //camera-setProjectionMatrix( osg::Matrix::ortho2D(0,512,0,512) ); //not doing anything //camera-setReferenceFrame( osg::Transform::ABSOLUTE_RF ); //camera-setViewMatrix( osg::Matrix::identity() ); view-setCameraManipulator(Tman); //Tman-setAutoComputeHomePosition(false); view-setUpViewOnSingleScreen(0); view-setSceneData(scene); //view-setCamera(camera); } // view two { osg::Matrixd viewmat; osg::Camera* camera = new osg::Camera; osgViewer::View* view = new osgViewer::View; view-setName(View two); viewer.addView(view); view-setUpViewOnSingleScreen(1); view-setSceneData(scene); //view-setCamera(camera); view-setCameraManipulator(Tman); view-setName(right); osg::Vec3d eye = osg::Vec3d(0,0,25); osg::Vec3d center = osg::Vec3d(0,0,25); osg::Vec3d up = osg::Vec3d(0,0,-1); } } viewer.realize(); while(!viewer.done()) { osg::Vec3d eye = osg::Vec3d(0,0,50); osg::Vec3d center = osg::Vec3d(0,0,50); osg::Vec3d up = osg::Vec3d(0,0,-1); Tman-setHomePosition(eye,center,up); //not working. Doesn't matter how I set eye, center etc. viewer.frame(); } } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34890#34890 ___ 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] osgdb_txp recent fixes
Hello community, Robert asked me to make a call for testing the terrapage loader for those of you using it. Lately there were some fixes, and just the last one was kind of minimal but important - should fix some visual anomalities with the smart mesh seams. I have let the old code sitting around there still (#ifdeffed 0) and I would like to hear your feedback - if positive I will clean the code to be ready for the upcommng stable release Thanks ! -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgdb_txp recent fixes - Call for tests
Hello community, Robert asked me to make a call for testing the terrapage loader for those of you using it. Lately there were some fixes, and just the last one was kind of minimal but important - should fix some visual anomalities with the smart mesh seams. I have let the old code sitting around there still (#ifdeffed 0) and I would like to hear your feedback - if positive I will clean the code to be ready for the upcommng stable release Thanks ! -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Easy Way to Subdivide Quad w/ Texture for Lighting Purposes
Hi, the same way you created your quad you can create many quads ( have a look at osggeometry example ) or quad strip. Then run osgUtil::SmoothingVisitor on your Geode to get nice normals. It should be enough for what you want to do -Nick On Wed, Dec 8, 2010 at 4:35 AM, Alden Peterson aldenpeter...@gmail.comwrote: Hi, What I am trying to do is draw a large quad (purpose to use ground, using a high res google earth jpg). I have been doing this by specifying the end points of the square, and then putting the texture onto it. This works fine. However this results in only one lighting condition being applied to the entire square/ground. I would like to allow lighting to be variable across the surface - ie if I have a spotlight on the surface, the entire ground will light up in the same color instead of having a gradient across it (as if the ground was subdivided into many polygons with their own lighting calculations). It would seem there would be an easy way to get OSG to do this - but I do not know it. Any advice in this regard would be greatly appreciated! Thank you! Cheers, Alden -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34596#34596 ___ 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] Easy Way to Subdivide Quad w/ Texture for Lighting Purposes
Or you can use osg::HeightField ... much easier to use . have a look at osg::HeightField (osgshape.cpp example) -Nick On Wed, Dec 8, 2010 at 5:48 AM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hi, the same way you created your quad you can create many quads ( have a look at osggeometry example ) or quad strip. Then run osgUtil::SmoothingVisitor on your Geode to get nice normals. It should be enough for what you want to do -Nick On Wed, Dec 8, 2010 at 4:35 AM, Alden Peterson aldenpeter...@gmail.comwrote: Hi, What I am trying to do is draw a large quad (purpose to use ground, using a high res google earth jpg). I have been doing this by specifying the end points of the square, and then putting the texture onto it. This works fine. However this results in only one lighting condition being applied to the entire square/ground. I would like to allow lighting to be variable across the surface - ie if I have a spotlight on the surface, the entire ground will light up in the same color instead of having a gradient across it (as if the ground was subdivided into many polygons with their own lighting calculations). It would seem there would be an easy way to get OSG to do this - but I do not know it. Any advice in this regard would be greatly appreciated! Thank you! Cheers, Alden -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34596#34596 ___ 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] why the model always flicker ?
probably you have to override OnEraseBackground (or something like that) to do nothing -Nick On Fri, Dec 3, 2010 at 6:42 PM, Duan Linghao linghaod...@gmail.com wrote: Hi, I wrote a program use MFC based on dialog,and I use a slider to rotate the model.I wonder why the model always flicker when I draging the slider? My code is setViewMatrix(); frame(); Thank you! Cheers, Duan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34492#34492 ___ 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] rain/snow accumulation on the screen
Thanks Steven .. good hint! -Nick On Thu, Dec 2, 2010 at 11:56 PM, Steven Powers stevenapow...@gmail.comwrote: I'd use a pixel shader for the effects. Pass in the texture that represents the snow overlay and have the shader scale the alpha up and down as it accumulates. Rain would be handled the same way but you'd have to come up with a way to make the water droplets move around on the screen. That should be possible in the shader as well. Thank you! Cheers, Steven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34455#34455 ___ 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] rain/snow accumulation on the screen
Hi Community, any ideas/hints how to implement rain/snow accumulation on the screen (like for a driving sim)? -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rain/snow accumulation on the screen
Hahahahahahah ... thanks Robert !!! -Nick On Wed, Dec 1, 2010 at 2:44 PM, Kim Bale kcb...@googlemail.com wrote: Genius. :) K. On 1 December 2010 10:24, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On Wed, Dec 1, 2010 at 10:15 AM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: any ideas/hints how to implement rain/snow accumulation on the screen (like for a driving sim)? Bring a laptop to Scotland and sit outside. Right now you'll get an accumulation of snow on the screen. Waiting another week and we might be able to provide an accumulation of rain, although it's likely to ruin the laptop. Still you'd have achieved your mission :-) Robert. ___ 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] rain/snow accumulation on the screen
actually, not a a bad idea ... people with John Nesh fortune could probably figure out the algorithm then ;-) -Nick On Wed, Dec 1, 2010 at 4:43 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hahahahahahah ... thanks Robert !!! -Nick On Wed, Dec 1, 2010 at 2:44 PM, Kim Bale kcb...@googlemail.com wrote: Genius. :) K. On 1 December 2010 10:24, Robert Osfield robert.osfi...@gmail.comwrote: Hi Nick, On Wed, Dec 1, 2010 at 10:15 AM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: any ideas/hints how to implement rain/snow accumulation on the screen (like for a driving sim)? Bring a laptop to Scotland and sit outside. Right now you'll get an accumulation of snow on the screen. Waiting another week and we might be able to provide an accumulation of rain, although it's likely to ruin the laptop. Still you'd have achieved your mission :-) Robert. ___ 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] rain/snow accumulation on the screen
Thank you !!! Andrew, your approach was the first that crossed my mind But not too much of a fan of it. More into what Michael is proposing ... Thanks again -Nick On Wed, Dec 1, 2010 at 7:56 PM, Michael Robb msar2...@gmail.com wrote: Pixelmaps or billboard textures might be the OpenGL terminology. Animation studios might use the term Particle Systems. 1980's game programmers would probably use the term sprites, especially if their motion changed when you moved. In this case blowing off as the vehicle moved. For snow, they would be partially transparent at the edges (alpha -0 ) and darker in the middle, so that when they were pasted on top together, they would make that area of the screen go dark. Not sure about the description of rain accumulation - if it were the effect of water trickling down the window, Doing trickling raindrops would be tricky - you would definitely need a particle system with a surface threshold algorithm (marching cubes/triangles) and some surface tension physics to generate the geometry to do refraction. On the inside of the window, you'd want condensation effects - that would just be partially transparent gray. On Wed, Dec 1, 2010 at 3:17 PM, Andrew Lowe a...@wht.com.au wrote: On 1/12/2010 6:15 PM, Trajce (Nick) Nikolov wrote: Hi Community, any ideas/hints how to implement rain/snow accumulation on the screen (like for a driving sim)? -Nick A company I used to work for which did driving sims, mining trucks in fact, just used a series of bitmaps - I might be using totally the wrong buzzwords here, I've had my after work beer and the correct terms escape me. The bit maps were generated by the graphics people and we just loaded them up and overlayed them as needed. There was a series of overlays that corresponded to: 1) A few drops 2) More drops 3) Even more drops 4) quite a few drops ... ... ... ... n) That many drop that in combination with a dusty windscreen, remember this is of a mining truck in an iron ore mine in Australia, that the windscreen has become mud. Then the user would turn on the wipers and a new set of overlays would be used which corresponded to the windscreen wipers going. These overlays were created by our graphic artists and we just dumped them into the scene at the speed we needed to simulate the rain. In other words the screen/rain/mud was not done dynamically with a snazzy algorithm, it was basically good old page flipping animation. Nick, does this make sense? If not I'll revisit the topic in the morning, it's currently 11.15pm, and try and make more sense. Regards, Andrew ___ 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] osgCal animated mesh, possible overlit problem
no that . I forced the rendering on the software (so it is not a fix, but a work around) . This cal3d seams to not be supported anymore. I advice FBX instead ... -Nick 2010/11/23 Arif Yetkin Sarı arifyet...@gmail.com Hi, ty for the fix Nick. For those that need/will need help in a similar situation, (as far as I can tell) osgUtil::SmoothingVisitor added to osgCal models solved the overlit problem. (And a little bit material adjustment for the mesh made it lit at a normal level) Arif -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33967#33967 ___ 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] osgocean agressive memory leaks
Hi Daniel, can you post your code ? (send it to my email). I remember mimicing the osgocean example I was not able to make it either, but found a work around -Nick On Tue, Nov 23, 2010 at 8:20 PM, Daniel Correia doncorr...@yahoo.com.brwrote: Hi Nick, I am new to OSG and I'm trying to use OsgOcean with Silverlining. I am using the osgocean example and removed the skydome, and now I'm trying to add the code of silverlining example to to my new project. The project builds and run, but no sky is visible. I think it has something to do with the right time to render the sky, but I'm a little lost in what to do next. Can you help me? Thanks! Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33990#33990 ___ 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] osgCal animated mesh, possible overlit problem
@Jan - Silverlining is the toolkit for ephemeris used in this project ( www.sundog-soft.com) I have sent Arif fix -Nick On Mon, Nov 22, 2010 at 9:18 PM, Jan Ciger jan.ci...@gmail.com wrote: 2010/11/22 Arif Yetkin Sarı arifyet...@gmail.com: Hello again. ... Why light slot 0 is problematic ? When i completely delete my light, i still get visual (not complete darkness in the scene). So it means i have another light source ? Probably my sun and the other light is both assigned as light0, so this may be the cause of the overlit problem ? I think that the light 0 is used as a skylight/headlight attached to the camera. So if you want to use that light, you have to turn the default light off. I dont have any lights other then mSun, but i see that in the code osgEphemeris is used. It has internal moon and sun light, so they are probably overlapping with my manual sun light ? No idea what that nodekit does - they may well define their own lights. And also, i heard that Silverlining can illuminate your scene like osgEphemeris, if so, it has also internal lights too ? How can i understand which light slots ephemeris and silverlining is using ? What do you mean by Silverlining? Did I understand the light slot concept correct ? : U can use 8 lights, and u need to assign them properly to make it work as expected ? OpenGL defines up to 8 user definable lights. Unless you set something up yourself, you get only the default skylight/headlight created by OSG, nothing else. In plain OpenGL you would have no lights at all (ergo totally dark scene). So you need to define your own lighting rig if you want the scene to be lit. Regards, Jan ___ 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] Modifying geometry on the fly?
if you want only to remove/show blocks, you can use the nodeMask -Nick On Sun, Nov 21, 2010 at 4:01 PM, David Wilson spam...@gmail.com wrote: Hi everyone, I'm working on a game engine using OSG in which I can load very large game worlds and have it run at a high framerate. My game world is made up of cubes, and I am building vertex arrays for each cell in the level - each cell is 64x64x64 blocks in size. Now I would like to be able to add and remove blocks in-game with minimal impact on my framerate. At the moment I am doing this by destroying the cell's geometry and recreating it again - adding it back into the scenegraph using setVertexArray() (and setNormalArray, setNormalIndices, etc.) This is quite a horrendous operation but remarkably it only takes about 100ms or so. Still, my framerate takes a very noticeable hit when this occurs. How would I best modify my vertex/face/etc. arrays on the fly without the dip in framerate? Should I be looking to farm this operation out to another thread? Is there a way to add and remove vertex data from my arrays so that I do not have to push such a large chunk of data to the video card each time this happens? Apologies if my terminology isn't correct - I'm still learning how OSG (and graphics rendering in general) works! And thanks to all who have put so much work into OSG, I hope to make an F1 racer of a game engine with it someday! Cheers, David Wilson -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33898#33898 ___ 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] render a node last
Hi Lucie, you can add the node you want to draw last under new camera,and set the render order to big number (see Camera::setRenderOrder). You would then need to sync the new camera matrices with the main camera (probably via update callback). This is how I did it and it works -Nick On Fri, Oct 8, 2010 at 7:36 PM, Paul Martz pma...@skew-matrix.com wrote: It looks like you need to turn on backface culling for the sphere. But if you're going to draw non-convex objects, then turning off depth testing won't work, and instead you'll need to leave it enabled and clear the depth buffer before you draw the objects that must always be in front. For this you'll want to look at using nested Camera nodes. Take a look at osghud. -Paul On 10/8/2010 6:36 AM, lucie lemonnier wrote: Hi, I put this line of code for render my model last : mModel = osgDB::readNodeFile(mFileToLoad); osg::StateSet* state = mModel-getOrCreateStateSet(); state-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); state-setRenderBinDetails(20,Render_Bin); But I get a odd render (see attachment). I am trying to put the sphere over the plane. Did I miss something in my code? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32559#32559 Attachments: http://forum.openscenegraph.org//files/render_172.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ 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] [osgPlugins] export from lightwave format *. IVE
you can convert .. osgconv model.lwo model.ive -Nick On Wed, Oct 6, 2010 at 2:29 AM, Pierre Bixquert pie...@japp3d.com wrote: Hi, there is a plugin to export from lightwave format *. IVE? someone what to do? ... Thank you! Cheers, pierre |-) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32426#32426 ___ 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] Lighting shader problem
the viewer by default is attaching a light. Setup your viewer with NO_LIGHT (or something like that, look in the code), and then create and control your own light -Nick On Mon, Oct 4, 2010 at 11:19 AM, Aitor Ardanza aitoralt...@terra.es wrote: ledocc wrote: bug fix: - ViewDirection = normalize(eyePosition - fvObjectPosition.xyz); + ViewDirection = normalize( - fvObjectPosition.xyz); I already had tried before, but does not solve the problem. If you disable the shader, with the standard osg lighting, gives me no problems, the model normals are well. If approached the camera at a distance close enough to the model, everything is fine, but if you walk away a bit, whole model is lit regardless of the position of the light ... Thanks for the answer! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32342#32342 ___ 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] Lighting shader problem
maybe better to put something in while we can compile and test and see if can help - including the model -Nick On Mon, Oct 4, 2010 at 5:37 PM, Aitor Ardanza aitoralt...@terra.es wrote: ledocc wrote: Is you normal of your model well defined and normalized ? Whitout shaders model looks perfect, and you can see the changes moving the light of the site. ledocc wrote: I suppose you used an osg::Light to define your light. Have you put it in a osg::LightSource ? Code: int const LIGHTS = 1; osg::StateSet *lightStateSet = scene-getOrCreateStateSet(); osg::Geode *lightMarker[LIGHTS]; osg::LightSource *lightSource[LIGHTS]; // Create Lights osg::Vec4 lightColors[] = {osg::Vec4(1.0,1.0,1.0,1.0), osg::Vec4(0.0, 1.0, 0.0, 1.0), osg::Vec4(0.0, 0.0, 1.0, 1.0)}; for (int i = 0; i LIGHTS; i++) { lightMarker[i] = new osg::Geode(); lightMarker[i]-addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0, 40.0, 0.0), 5.0))); osg::Material *light_material = new osg::Material(); light_material-setDiffuse(osg::Material::FRONT, osg::Vec4(1.0, 1.0, 1.0, 1.0)); light_material-setSpecular(osg::Material::FRONT, osg::Vec4(0.1, 0.1, 0.1, 1.0)); light_material-setEmission(osg::Material::FRONT, lightColors[i]); lightMarker[i]-getOrCreateStateSet()-setAttribute(light_material); lightSource[i] = new osg::LightSource(); osg::Light *light = new osg::Light(); // each light must have a unique number light-setLightNum(0); // we set the light's position via a PositionAttitudeTransform object light-setPosition(osg::Vec4(0.0, 40.0, 0.0, 0.3)); light-setSpecular(osg::Vec4(0.1,0.1,0.1,1.0)); light-setAmbient( osg::Vec4(0.2,0.2,0.2,1.0)); light-setDiffuse(lightColors[i]); lightSource[i]-setLight(light); lightSource[i]-setLocalStateSetModes(osg::StateAttribute::ON); lightSource[i]-setStateSetModes(*lightStateSet, osg::StateAttribute::ON); lightTransform[i] = new osg::PositionAttitudeTransform(); lightTransform[i]-addChild(lightSource[i]); lightTransform[i]-addChild(lightMarker[i]); lightTransform[i]-setPosition(osg::Vec3(0, 0,200)); //lightTransform[i]-setScale(osg::Vec3(0.1,0.1,0.1)); scene-addChild(lightTransform[i]); } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32364#32364 ___ 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] Keypress broken since rev 11749
Hi Brad, did you tried my change with adding the new extra line in GraphicsWindowWin32.cpp ? I think it will fix it. This way the key that was being translated to WM_CHAR will be passed as WM_KEYDOWN as well -Nick On Mon, Sep 20, 2010 at 5:51 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Brad, Robert- One issue with including both the translated and untranslated keys in the event is that there is not a one to one mapping. In windows sometimes 3 key presses will translate to one WM_CHAR (translated key) message and they don’t even need to be pressed at the same time (in the case of dead keys). Whereas I believe there is a one-to-one between WM_KEYDOWN and key presses… I don't think that's a problem, in that case there will be 3 keydown events: - the first two would have an untranslated key code but the translated code would be invalid (say -1 so the app can recognize it and just do nothing if it only wants translated codes) - and the third event would have both a translated and untranslated codes (both would be valid). Thus apps that want raw keypresses could get them, and apps (or osgWidget::Input) that need translated keys could just ignore keypresses where the translated code is invalid. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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] Keypress broken since rev 11749
Hi Brad, Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window you could override CDialog::PreTranslateMessage( MSG* msg ) and do it the same way is CView from the osgviewerMFC example -Nick On Mon, Sep 20, 2010 at 5:29 PM, Brad Huber br...@procerusuav.com wrote: Gentlemen, I apologize for being inactive on the thread these last few days. I was on vacation at the Reno Air Races J. Trajce- to address your point about how to make MFC “work properly”. The example code IS NOT a dialog based MFC app. My app IS a dialog based MFC app. Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window. Of course there are other work arounds that address my particular problem (I believe I’ve already fixed it), but I’m trying to bring up the point that this may be a fundamental issue in the key handling. Robert- One issue with including both the translated and untranslated keys in the event is that there is not a one to one mapping. In windows sometimes 3 key presses will translate to one WM_CHAR (translated key) message and they don’t even need to be pressed at the same time (in the case of dead keys). Whereas I believe there is a one-to-one between WM_KEYDOWN and key presses… Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Friday, September 17, 2010 10:57 AM *To:* osg-users@lists.openscenegraph.org *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Robert, I find some time to dig into this. And here are my observations ( I am working with Vivien's submission, with osgviewerMFC ) I put break points in GraphicsWindowWin32.cpp: Line: 2476 case WM_KEYDOWN: case WM_SYSKEYDOWN : { int keySymbol = 0; Line: 2451 / case WM_CHAR : / { // if event was not handled by WM_KEYDOWN then we take care of it here // this method gives directly the utf16 char back so just need to add it as it is if(!_keypresshandled) { // first check if key is already registered on the map case WM_KEYDOWN/WM_SYSKEYDOWN : get its chance to handle every single key you press, even a dead key. So, for my czech character 'č', I have to press: SHIFT, '+', and 'c', in this order, and for each of these three I get WM_KEYDOWN. The only difference is that when I complete this sequence, on top of all WM_KEYDOWNs, it gets to case WM_CHAR: with my 'č'. This is how the system is managing these events. To reflect this behavior into OSG, only one single line needs to be added, I think, and that will fix Brad's issue as well: else { // was no special key, let WM_CHAR handle it _keypresshandled = false; _lastkeysymbol = keySymbol; /* the new line */ getEventQueue()-keyPress(keySymbol, eventTime); } This was the key that was waste (being 'eaten' :) ..). So to me it sounds that, with Vivien's submission, only the dead key + 'something' was not firing an event in osg - for the rest it should work as before, not as Brad states above that the key events stopped work. I am very curious what he was actually doing. Cheers, -Nick On Fri, Sep 17, 2010 at 8:04 PM, Vivien Delage vdel...@gmail.com wrote: Hi guys, I understand you Robert. I have no problem with reverting the code for now if this causes issues for other people. I will go and experiment a bit more on how to fix the dead key problem. Maybe I can find a solution which is not using the WM_CHAR message. I will let you know how it goes on my side. Cheers, Vivien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31778#31778 ___ 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] Keypress broken since rev 11749
Hi Brad, I hate arguing :) ... For me it works. I put a break point on the Sleep and I get there BOOL CDialogDlg::PreTranslateMessage( MSG *pMsg ) { if (pMsg-message == WM_CHAR ) { // will I get here Sleep(10); } return CDialog::PreTranslateMessage(pMsg); } -Nick On Mon, Sep 20, 2010 at 9:28 PM, Brad Huber br...@procerusuav.com wrote: Nick, According to my understanding and experience, CDialog::PreTranslateMessage(MSG *msg) does not receive WM_CHAR messages so I cannot do anything about that. In the MFC documentation there is a CWnd::GetDlgCode method which tells the framework which key messages (like WM_CHAR) your class would like to receive but again this does not work for CDialog classes. GetDlgCode does not get called and PreTranslateMessage does not ever get WM_CHAR. Therefore I cannot use any WM_CHAR based mechanism with my existing CDialog based app. I can use a work around (ie don’t rely on any WM_KEYDOWN) and use WM_KEYUP instead. I could also investigate inserting a control on top of the dialog which would allow receipt of WM_CHAR messages. Anyway there is apparently nothing I can do to force WM_CHAR to work with CDialog. Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 11:06 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Brad, Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window you could override CDialog::PreTranslateMessage( MSG* msg ) and do it the same way is CView from the osgviewerMFC example -Nick On Mon, Sep 20, 2010 at 5:29 PM, Brad Huber br...@procerusuav.com wrote: Gentlemen, I apologize for being inactive on the thread these last few days. I was on vacation at the Reno Air Races J. Trajce- to address your point about how to make MFC “work properly”. The example code IS NOT a dialog based MFC app. My app IS a dialog based MFC app. Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window. Of course there are other work arounds that address my particular problem (I believe I’ve already fixed it), but I’m trying to bring up the point that this may be a fundamental issue in the key handling. Robert- One issue with including both the translated and untranslated keys in the event is that there is not a one to one mapping. In windows sometimes 3 key presses will translate to one WM_CHAR (translated key) message and they don’t even need to be pressed at the same time (in the case of dead keys). Whereas I believe there is a one-to-one between WM_KEYDOWN and key presses… Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Friday, September 17, 2010 10:57 AM *To:* osg-users@lists.openscenegraph.org *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Robert, I find some time to dig into this. And here are my observations ( I am working with Vivien's submission, with osgviewerMFC ) I put break points in GraphicsWindowWin32.cpp: Line: 2476 case WM_KEYDOWN: case WM_SYSKEYDOWN : { int keySymbol = 0; Line: 2451 / case WM_CHAR : / { // if event was not handled by WM_KEYDOWN then we take care of it here // this method gives directly the utf16 char back so just need to add it as it is if(!_keypresshandled) { // first check if key is already registered on the map case WM_KEYDOWN/WM_SYSKEYDOWN : get its chance to handle every single key you press, even a dead key. So, for my czech character 'č', I have to press: SHIFT, '+', and 'c', in this order, and for each of these three I get WM_KEYDOWN. The only difference is that when I complete this sequence, on top of all WM_KEYDOWNs, it gets to case WM_CHAR: with my 'č'. This is how the system is managing these events. To reflect this behavior into OSG, only one single line needs to be added, I think, and that will fix Brad's issue as well: else { // was no special key, let WM_CHAR handle it _keypresshandled = false; _lastkeysymbol = keySymbol; /* the new line */ getEventQueue()-keyPress(keySymbol, eventTime); } This was the key that was waste (being 'eaten' :) ..). So to me it sounds that, with Vivien's submission, only the dead key + 'something' was not firing an event in osg
Re: [osg-users] Keypress broken since rev 11749
Hi again Brad, http://msdn.microsoft.com/en-us/library/619z63f5(VS.80).aspx http://msdn.microsoft.com/en-us/library/619z63f5(VS.80).aspxnote the Note. This makes me think you are using older MFC that is not doing that . -Nick On Mon, Sep 20, 2010 at 9:37 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hi Brad, I hate arguing :) ... For me it works. I put a break point on the Sleep and I get there BOOL CDialogDlg::PreTranslateMessage( MSG *pMsg ) { if (pMsg-message == WM_CHAR ) { // will I get here Sleep(10); } return CDialog::PreTranslateMessage(pMsg); } -Nick On Mon, Sep 20, 2010 at 9:28 PM, Brad Huber br...@procerusuav.com wrote: Nick, According to my understanding and experience, CDialog::PreTranslateMessage(MSG *msg) does not receive WM_CHAR messages so I cannot do anything about that. In the MFC documentation there is a CWnd::GetDlgCode method which tells the framework which key messages (like WM_CHAR) your class would like to receive but again this does not work for CDialog classes. GetDlgCode does not get called and PreTranslateMessage does not ever get WM_CHAR. Therefore I cannot use any WM_CHAR based mechanism with my existing CDialog based app. I can use a work around (ie don’t rely on any WM_KEYDOWN) and use WM_KEYUP instead. I could also investigate inserting a control on top of the dialog which would allow receipt of WM_CHAR messages. Anyway there is apparently nothing I can do to force WM_CHAR to work with CDialog. Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 11:06 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Brad, Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window you could override CDialog::PreTranslateMessage( MSG* msg ) and do it the same way is CView from the osgviewerMFC example -Nick On Mon, Sep 20, 2010 at 5:29 PM, Brad Huber br...@procerusuav.com wrote: Gentlemen, I apologize for being inactive on the thread these last few days. I was on vacation at the Reno Air Races J. Trajce- to address your point about how to make MFC “work properly”. The example code IS NOT a dialog based MFC app. My app IS a dialog based MFC app. Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window. Of course there are other work arounds that address my particular problem (I believe I’ve already fixed it), but I’m trying to bring up the point that this may be a fundamental issue in the key handling. Robert- One issue with including both the translated and untranslated keys in the event is that there is not a one to one mapping. In windows sometimes 3 key presses will translate to one WM_CHAR (translated key) message and they don’t even need to be pressed at the same time (in the case of dead keys). Whereas I believe there is a one-to-one between WM_KEYDOWN and key presses… Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Friday, September 17, 2010 10:57 AM *To:* osg-users@lists.openscenegraph.org *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Robert, I find some time to dig into this. And here are my observations ( I am working with Vivien's submission, with osgviewerMFC ) I put break points in GraphicsWindowWin32.cpp: Line: 2476 case WM_KEYDOWN: case WM_SYSKEYDOWN : { int keySymbol = 0; Line: 2451 / case WM_CHAR : / { // if event was not handled by WM_KEYDOWN then we take care of it here // this method gives directly the utf16 char back so just need to add it as it is if(!_keypresshandled) { // first check if key is already registered on the map case WM_KEYDOWN/WM_SYSKEYDOWN : get its chance to handle every single key you press, even a dead key. So, for my czech character 'č', I have to press: SHIFT, '+', and 'c', in this order, and for each of these three I get WM_KEYDOWN. The only difference is that when I complete this sequence, on top of all WM_KEYDOWNs, it gets to case WM_CHAR: with my 'č'. This is how the system is managing these events. To reflect this behavior into OSG, only one single line needs to be added, I think, and that will fix Brad's issue as well: else { // was no special key, let WM_CHAR handle it _keypresshandled = false
Re: [osg-users] Keypress broken since rev 11749
Hi Brad, VS 8.0. Is that 2005? -Nick On Mon, Sep 20, 2010 at 11:52 PM, Brad Huber br...@procerusuav.com wrote: Nick, Thanks for the extra input. I’m using VC80. I’ve previously hooked up Spy++ and noticed that my window does not receive either WM_CHAR or WM_GETDLGCODE. In addition I tried something like what you’ve mentioned and it doesn’t ever get a WM_CHAR. It does get WM_KEYDOWN and others. Anyway I’ve also come across several posts online saying the CDialog is different wrt WM_CHAR. You’re example says differently and I haven’t tried a stripped down version like that. I don’t want to belabor the point. The issue is essentially fixed for me (regardless of which way we do translated / raw messages). I guess we’ll see which direction Robert would like to take it vis-à-vis translated/untranslated, dead keys, etc. Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 12:15 PM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi again Brad, http://msdn.microsoft.com/en-us/library/619z63f5(VS.80).aspx note the Note. This makes me think you are using older MFC that is not doing that . -Nick On Mon, Sep 20, 2010 at 9:37 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hi Brad, I hate arguing :) ... For me it works. I put a break point on the Sleep and I get there BOOL CDialogDlg::PreTranslateMessage( MSG *pMsg ) { if (pMsg-message == WM_CHAR ) { // will I get here Sleep(10); } return CDialog::PreTranslateMessage(pMsg); } -Nick On Mon, Sep 20, 2010 at 9:28 PM, Brad Huber br...@procerusuav.com wrote: Nick, According to my understanding and experience, CDialog::PreTranslateMessage(MSG *msg) does not receive WM_CHAR messages so I cannot do anything about that. In the MFC documentation there is a CWnd::GetDlgCode method which tells the framework which key messages (like WM_CHAR) your class would like to receive but again this does not work for CDialog classes. GetDlgCode does not get called and PreTranslateMessage does not ever get WM_CHAR. Therefore I cannot use any WM_CHAR based mechanism with my existing CDialog based app. I can use a work around (ie don’t rely on any WM_KEYDOWN) and use WM_KEYUP instead. I could also investigate inserting a control on top of the dialog which would allow receipt of WM_CHAR messages. Anyway there is apparently nothing I can do to force WM_CHAR to work with CDialog. Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 11:06 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Brad, Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window you could override CDialog::PreTranslateMessage( MSG* msg ) and do it the same way is CView from the osgviewerMFC example -Nick On Mon, Sep 20, 2010 at 5:29 PM, Brad Huber br...@procerusuav.com wrote: Gentlemen, I apologize for being inactive on the thread these last few days. I was on vacation at the Reno Air Races J. Trajce- to address your point about how to make MFC “work properly”. The example code IS NOT a dialog based MFC app. My app IS a dialog based MFC app. Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window. Of course there are other work arounds that address my particular problem (I believe I’ve already fixed it), but I’m trying to bring up the point that this may be a fundamental issue in the key handling. Robert- One issue with including both the translated and untranslated keys in the event is that there is not a one to one mapping. In windows sometimes 3 key presses will translate to one WM_CHAR (translated key) message and they don’t even need to be pressed at the same time (in the case of dead keys). Whereas I believe there is a one-to-one between WM_KEYDOWN and key presses… Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Friday, September 17, 2010 10:57 AM *To:* osg-users@lists.openscenegraph.org *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Robert, I find some time to dig into this. And here are my observations ( I am working with Vivien's submission, with osgviewerMFC ) I put break points in GraphicsWindowWin32.cpp: Line: 2476 case WM_KEYDOWN: case WM_SYSKEYDOWN : { int keySymbol = 0; Line: 2451
Re: [osg-users] Keypress broken since rev 11749
okay .. that explains things. Looks like as per the latest MSDN there are changes. Main thing it works for you though ... Cheers, -Nick On Tue, Sep 21, 2010 at 12:24 AM, Brad Huber br...@procerusuav.com wrote: Nick, Yes. -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 2:23 PM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Brad, VS 8.0. Is that 2005? -Nick On Mon, Sep 20, 2010 at 11:52 PM, Brad Huber br...@procerusuav.com wrote: Nick, Thanks for the extra input. I’m using VC80. I’ve previously hooked up Spy++ and noticed that my window does not receive either WM_CHAR or WM_GETDLGCODE. In addition I tried something like what you’ve mentioned and it doesn’t ever get a WM_CHAR. It does get WM_KEYDOWN and others. Anyway I’ve also come across several posts online saying the CDialog is different wrt WM_CHAR. You’re example says differently and I haven’t tried a stripped down version like that. I don’t want to belabor the point. The issue is essentially fixed for me (regardless of which way we do translated / raw messages). I guess we’ll see which direction Robert would like to take it vis-à-vis translated/untranslated, dead keys, etc. Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 12:15 PM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi again Brad, http://msdn.microsoft.com/en-us/library/619z63f5(VS.80).aspx note the Note. This makes me think you are using older MFC that is not doing that . -Nick On Mon, Sep 20, 2010 at 9:37 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hi Brad, I hate arguing :) ... For me it works. I put a break point on the Sleep and I get there BOOL CDialogDlg::PreTranslateMessage( MSG *pMsg ) { if (pMsg-message == WM_CHAR ) { // will I get here Sleep(10); } return CDialog::PreTranslateMessage(pMsg); } -Nick On Mon, Sep 20, 2010 at 9:28 PM, Brad Huber br...@procerusuav.com wrote: Nick, According to my understanding and experience, CDialog::PreTranslateMessage(MSG *msg) does not receive WM_CHAR messages so I cannot do anything about that. In the MFC documentation there is a CWnd::GetDlgCode method which tells the framework which key messages (like WM_CHAR) your class would like to receive but again this does not work for CDialog classes. GetDlgCode does not get called and PreTranslateMessage does not ever get WM_CHAR. Therefore I cannot use any WM_CHAR based mechanism with my existing CDialog based app. I can use a work around (ie don’t rely on any WM_KEYDOWN) and use WM_KEYUP instead. I could also investigate inserting a control on top of the dialog which would allow receipt of WM_CHAR messages. Anyway there is apparently nothing I can do to force WM_CHAR to work with CDialog. Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick) Nikolov *Sent:* Monday, September 20, 2010 11:06 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Keypress broken since rev 11749 Hi Brad, Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window you could override CDialog::PreTranslateMessage( MSG* msg ) and do it the same way is CView from the osgviewerMFC example -Nick On Mon, Sep 20, 2010 at 5:29 PM, Brad Huber br...@procerusuav.com wrote: Gentlemen, I apologize for being inactive on the thread these last few days. I was on vacation at the Reno Air Races J. Trajce- to address your point about how to make MFC “work properly”. The example code IS NOT a dialog based MFC app. My app IS a dialog based MFC app. Dialogs in MFC do not capture/receive the WM_CHAR message and that is why I cannot properly pass it on to the OSG window. Of course there are other work arounds that address my particular problem (I believe I’ve already fixed it), but I’m trying to bring up the point that this may be a fundamental issue in the key handling. Robert- One issue with including both the translated and untranslated keys in the event is that there is not a one to one mapping. In windows sometimes 3 key presses will translate to one WM_CHAR (translated key) message and they don’t even need to be pressed at the same time (in the case of dead keys). Whereas I believe there is a one-to-one between WM_KEYDOWN and key presses… Thanks -Brad *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce (Nick
Re: [osg-users] Hint for appropriate export format?
Hi Werner, the OpenFlight writer seam to work good, and lately there were improvements posted for the 3ds as well. The first one format is pretty well supported in the vis-sim, the later is well supported in 3D in general -Nick On Sun, Sep 19, 2010 at 4:34 PM, Werner Modenbach werner.modenb...@texion.eu wrote: My application is creating a scene with standard Geodes (vertex arrays, normal arrays etc.) I would like to export the 3D structure for further processing in external programs like ansys or to convert it in external converter programs into appropriate formats. I was advised to use IGES as export format but I think it is rarely supported nowadays. What about VRML? Is anybody out there who can give me some info for at least having a starting point? Thanks for any hint and also many thanks to the osg team for the great work! Werner ___ 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] Keypress broken since rev 11749
Hi, the code from 11749 works just great with the latest osgviewerMFC. If this revision fixes issues for Vivien, I would put again his changes, there are no regression. I just give it a shot to make sure it does work. I think Brad can really rely on this example as a guide how to implement his own things, as well the hint I gave him could work for him as well . -Nick On Fri, Sep 17, 2010 at 5:47 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Robert, I'm not clear on what solution should be used going forward. The GraphicsWindowWin32.cpp code had been in play for a few years without problems being reported on this topic and to get a report or new problem after merging Vivien's changes make me concerned that we may have broken more apps usage than might have fixed. Could this be the case? Or is Brad's experience unique? I think Nick's message shows that it may be Brad's app's message passing that's the cause of his problem. If the osgViewerMFC example works, and it demonstrates proper integration between OSG and MFC, and furthermore, the other OSG examples and apps that come with it work fine on Windows (when GraphicsWindowWin32 is used) then I think the changes to GraphicsWindowWin32 are OK. I'm inclined for the 2.9.9 dev release to revert the changes, and then let us discuss possible solutions. I don't think that's necessary at this point. As I said above, the changes seem fine. There may be other changes going forward, for sure, but I think the code is safe as it is. In the past we've talked about the idea of having raw key codes as well as translated keycodes in the GUIEventAdapter, would this help here? Perhaps, the raw key codes would be the keyup and keydown messages from the OS, and the translated code would be the accented character in the case dead keys were being used. Brad gave an example of a game that wants to check a given key directly, it would use the raw key codes, and a text editor/e-mail app (or osgWidget::Input) would use the translated key code. It would be a flexible solution. Now, where will we find a developer to implement this? :-) J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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] Keypress broken since rev 11749
Hi Robert, I actually like the idea of having osg working with dead keys thus being capable of handling language specific characters (you can type your text in osgWidget::Input in your natural language). I think this is very good feature, what Vivien has implemented. On the other side I totally understand you too, but Brad is the only one so far reporting issues and for me is likely he is doing something wrong (ehm ... maybe strong word, but he hasn't been replying lately so no idea if he fixed it). The OSG MFC example is a good guide how to properly implement things, and my hint is very standard and trivial, not a hack or work around. You might be right with your view on how actually Vivien implemented this new cool feature, improvements can always be done I think. Me being you , would let Vivien's work in, again I find it very cool. But .. you are the boss :) Cheers, -Nick On Fri, Sep 17, 2010 at 7:27 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Vivien, JS, Nick et.al, I'm not really happy with the technique that Vivien took, eating a key down till a WM_CHAR occurs then dispatching one seems rather convoluted and with extra complication comes the danger of bugs being introduced as the code evolves, and obviously also forces the app to generate the WM_CHAR, which not all apps will do. I'm sure Brad's not alone in this. There might be a workaround for Brad and others to address this, but this all will require end users to come across odd regressions and then have to investigate and if they are lucky come across this or subsequent threads. It certainly is an issue that is ripe for arising again and again as new users stumble on the same issue. I do not what the best solution would be, but we do at least need to try harder to address the problem without introducing regressions. Robert. ___ 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] Keypress broken since rev 11749
Hi Robert, I find some time to dig into this. And here are my observations ( I am working with Vivien's submission, with osgviewerMFC ) I put break points in GraphicsWindowWin32.cpp: Line: 2476 case WM_KEYDOWN: case WM_SYSKEYDOWN : { int keySymbol = 0; Line: 2451 / case WM_CHAR : / { // if event was not handled by WM_KEYDOWN then we take care of it here // this method gives directly the utf16 char back so just need to add it as it is if(!_keypresshandled) { // first check if key is already registered on the map case WM_KEYDOWN/WM_SYSKEYDOWN : get its chance to handle every single key you press, even a dead key. So, for my czech character 'č', I have to press: SHIFT, '+', and 'c', in this order, and for each of these three I get WM_KEYDOWN. The only difference is that when I complete this sequence, on top of all WM_KEYDOWNs, it gets to case WM_CHAR: with my 'č'. This is how the system is managing these events. To reflect this behavior into OSG, only one single line needs to be added, I think, and that will fix Brad's issue as well: else { // was no special key, let WM_CHAR handle it _keypresshandled = false; _lastkeysymbol = keySymbol; /* the new line */ getEventQueue()-keyPress(keySymbol, eventTime); } This was the key that was waste (being 'eaten' :) ..). So to me it sounds that, with Vivien's submission, only the dead key + 'something' was not firing an event in osg - for the rest it should work as before, not as Brad states above that the key events stopped work. I am very curious what he was actually doing. Cheers, -Nick On Fri, Sep 17, 2010 at 8:04 PM, Vivien Delage vdel...@gmail.com wrote: Hi guys, I understand you Robert. I have no problem with reverting the code for now if this causes issues for other people. I will go and experiment a bit more on how to fix the dead key problem. Maybe I can find a solution which is not using the WM_CHAR message. I will let you know how it goes on my side. Cheers, Vivien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31778#31778 ___ 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] Keypress broken since rev 11749
Hi Brad, that is what I was expecting while reading this thread, that you have the GraphicsWindowWin32 into some framework ... You need to pass the event from MFC to the window. In your OnKeyDown you get the window handle and pass thru the event. If you need details let me know This is how I made it work ... way back when -Nick On Thu, Sep 16, 2010 at 11:54 PM, Vivien Delage vdel...@gmail.com wrote: Hi Brad, I totally aggree with what you said. This is also what I proposed to Robert in the submission thread. Basically the best would be to have a new event of type UnicodeCharEntered or something like this. This way we could leave the keydown and keyup events as they were and only using wm_chat for the new type of event. However, this change is too big to do it by ourself I guess? This touch the core functionnality and does not only impact win32 version. This is why I provided the fix as it is now. Vivien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31729#31729 ___ 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] latest NVIDIA drivers
our GLSL code is bug free ... no need of debugging .. *smile* -Nick On Tue, Sep 14, 2010 at 5:06 PM, Fred Smith osgfo...@tevs.eu wrote: robertosfield wrote: The desktop market is already rather stagnant in comparison to the growth of mobile device, mindshare and market share are moving away from the desktop to mobile, with this sea change Microsoft and hence DirectX will be loosing ground. I am appalled to see that GLSL development tools are almost non-existent. Microsoft historically succeeded by attracting developers, and I think this might also be true for DirectX. Look at shader debugging tools. I'm not talking about small tools used to play for a few minutes with your shader, but real debuggers with breakpoints. Apart from glslDevil and its very limited capabilities there is just no development tool available. HLSL has plenty of support from Microsoft (PIX), nVidia (FX Composer and now Parralel nSight) and ATI (GPU PerfStudio). ATI does not plan to support GLSL debugging in the near term I was told. nVidia doesn't look much more interested. Also, their latest Optimus technology isn't compatible with Linux yet, which doesn't help... That's a pity. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31587#31587 ___ 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] osgQt error
not a qt guru, but this seem a file generated by the moc preprocessor. try removing it. It will create a new one from you -Nick On Thu, Sep 9, 2010 at 7:03 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hello Lucie, When I compile osgQt, I have this error : 1moc_QGraphicsViewAdapter.cxx 1.\__\__\include\osgQt\moc_QGraphicsViewAdapter.cxx(11) : fatal error C1189: #error : The header file 'QGraphicsViewAdapter' doesn't includeQObject. How do I solve it? Is this on trunk updated today? Which OS/compiler? (seems Visual Studio but which version?) Try adding the required header, though I didn't need it and I'm also on Windows... J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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] How can I rotate a image
what do you mean by rotating an image? Could you tell what you are actually trying to do? More info you provide more chances to get some advice -Nick 2010/9/7 Martin Großer grosser.mar...@gmx.de Hello, I would like rotate a image. Because I want to rotate the separate images from my sky box. I think it is difficult to change the texture coordinates of my sphere. I my idea is to rotate the images at the beginning. Example ::osg::Image* image = osgDB::readImageFile(c_posX.Filename); // rotate image _cubeMap-setImage(::osg::TextureCubeMap::POSITIVE_X, image); I hope someone can help me. Cheers Martin -- GMX DSL SOMMER-SPECIAL: Surf Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl ___ 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] How can I rotate a image
so yo have a skybox model (probably a dome). and you want to render something in cube map and apply that to the skybox, correct? -Nick 2010/9/7 Martin Großer grosser.mar...@gmx.de Ok, also I have create a sky box like the sky box in the vertexprogramm example of osg. But in my scene the up vector is in the z direction and not in the y direction. Now I have rotate my sky box 90 degrees around the x axis. Is it understandable? But now, the images on the sky box are in the wrong orientation. For example the image in the positiv x direction is 90 degrees rotated. And I want to correct this rotation. Is it understandable? I am not sure. Cheers Martin Original-Nachricht Datum: Tue, 7 Sep 2010 14:57:24 +0400 Von: Trajce (Nick) Nikolov nikolov.tra...@gmail.com An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] How can I rotate a image what do you mean by rotating an image? Could you tell what you are actually trying to do? More info you provide more chances to get some advice -Nick 2010/9/7 Martin Großer grosser.mar...@gmx.de Hello, I would like rotate a image. Because I want to rotate the separate images from my sky box. I think it is difficult to change the texture coordinates of my sphere. I my idea is to rotate the images at the beginning. Example ::osg::Image* image = osgDB::readImageFile(c_posX.Filename); // rotate image _cubeMap-setImage(::osg::TextureCubeMap::POSITIVE_X, image); I hope someone can help me. Cheers Martin -- GMX DSL SOMMER-SPECIAL: Surf Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- GMX DSL SOMMER-SPECIAL: Surf Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl ___ 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] How can I rotate a image
are in the wrong orientation. For example the image in the positiv x direction is 90 degrees rotated. And I want to correct this rotation. Is it understandable? I am not sure. Cheers Martin Original-Nachricht Datum: Tue, 7 Sep 2010 14:57:24 +0400 Von: Trajce (Nick) Nikolov nikolov.tra...@gmail.com An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] How can I rotate a image what do you mean by rotating an image? Could you tell what you are actually trying to do? More info you provide more chances to get some advice -Nick 2010/9/7 Martin Großer grosser.mar...@gmx.de Hello, I would like rotate a image. Because I want to rotate the separate images from my sky box. I think it is difficult to change the texture coordinates of my sphere. I my idea is to rotate the images at the beginning. Example ::osg::Image* image = osgDB::readImageFile(c_posX.Filename); // rotate image _cubeMap-setImage(::osg::TextureCubeMap::POSITIVE_X, image); I hope someone can help me. Cheers Martin -- GMX DSL SOMMER-SPECIAL: Surf Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- GMX DSL SOMMER-SPECIAL: Surf Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl ___ 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] latest NVIDIA drivers
nice reading ... :) .. I agree about the DirectX part .. Let start talking to Robert to make OSG DirectX compatible :) -Nick On Fri, Sep 3, 2010 at 7:29 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Wojtek, I think that breaking gl_LightSource usage in fragment shaders is actually a major problem. On this forum there are three of us who admitted it affected them. Probably few more did not mention it. How many OpenGL developers outside OSG community do pixel lighting ? I bet there thousands if not tens of thousands who were or can be affected in the future. I agree, and in fact in my case the error happened in a vertex shader when doing a loop over light sources to do per-vertex lighting, so it's not just limited to per-pixel lighting shaders. I bet any code that loops over gl_LightSource[] in any shader will cause this error. I also agree with your other points. Hopefully soon OSG will allow us to choose which path we use, OpenGL 2.x or OpenGL 3.x+/4.x, and will help ease our transition. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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] latest NVIDIA drivers
hi J-S, I was just kidding :) .. I think I know Robert's view on Microsoft. My opinion is, even the fact the DirectX is kind of further then OpenGL, what osg is on top of opengl is my favorite, and not only osg but all the rest of opensource projects around that are on top of it (vpb, osgEarth, osgOcean ... ) as well ... -Nick On Fri, Sep 3, 2010 at 10:23 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Nick, nice reading ... :) .. I agree about the DirectX part .. Let start talking to Robert to make OSG DirectX compatible :) -Nick Haven't you been here for a while now? You should know by now that's not going to happen :-) Search the archives if you're interested, this has been discussed in the past. But let's not let this thread go into API wars, please. We're using one API, and this thread just discussed bugs in parts of that API which are deprecated but should still be supported by the vendor in question. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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] Creating and exporting OSG Switches from 3ds max
Hi I think I have seen OpenFlight exporter for max. You can build your hierarchy with it including the switches ... -Nick On Fri, Sep 3, 2010 at 9:40 AM, Luke Daly melbdemon...@hotmail.com wrote: Hi, I was wondering if there was any tutorials that anyone knows of for the creation and exporting of OSG models with Switch nodes. I am working on a driving simulator that for the creation of objects such as traffic lights, the different colour lights must be created with OSG switches. Only I have never used these before. I have installed OSGexp for 3ds max 2010, and I know how to add an OSG_Switch to the scene, but there my knowledge ends. So if anyone knows of a noob or beginner tut for this, I would really apprecitate it. ... Thank you! Cheers, Luke -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31290#31290 ___ 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] Granular LOD control
I would like to be able to increase or decrease the LODScale for just the globe portion without disturbing everything else. Write NodeVisitor that will control the osg::LOD range -Nick On Wed, Sep 1, 2010 at 9:53 PM, Brad Huber br...@procerusuav.com wrote: Hello, I am interested in granularly controlling the LODScale for different parts of my scene graph. For example I have one part of the graph rendering a globe (osgEarth) and another part rendering items on the globe. I would like to be able to increase or decrease the LODScale for just the globe portion without disturbing everything else. The CullSettings are typically attached to the Camera. I wasn’t sure initially that creating two separate cameras was the right solution. I still want the depth buffering and render order stuff to be preserved the way it is now (the globe and the items on the globe render to the same depth buffer). Thoughts? Thanks -Brad ___ 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] Getting the List of Triangles from an osg model
I assume you are on Windows, as from what are you experiencing sounds familiar to me, all these stl issues. What I would do is, make sure Debug links to debug libraries, Relase to release. And do a clean build. -Nick On Wed, Sep 1, 2010 at 2:57 AM, Sanat Talmaki sanat.sch...@gmail.comwrote: Hi Nick, Jean The problem was because I was using the Release version of osg. I used the Debug instead and both size and numElements give the same value. I had turned optimization off but it seems as though you cannot run through the code even then. Thanks Sincerely, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31230#31230 ___ 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] Getting the List of Triangles from an osg model
good :) -Nick On Wed, Sep 1, 2010 at 8:31 PM, Sanat Talmaki sanat.sch...@gmail.comwrote: Hi Nick, Yes, Windows and VS 2008. I had to do exactly that. The debugger works normally (as expected) now Thanks, Sanat. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31245#31245 ___ 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] [osgOcean] increase ocean view range
LOD - Level Of Detail. Obviously when you build a terrain database, you build it in few different level of details. What is close is more detailed what is further is less detailed. All of the terrain generation tools are aware of this and they build the final scene graph using LODs. They often build it as quad tree structure. So what you would need is, different representation of the ocean that will change based on the range. And that is done with LOD node. So your ocean can be polygonal for far range, and a hole for closer range (the hole will become your osgocean) The terrain tools like TerraVista, can do this easy. When you build your database, you would have vector culture (ESRI shape. etc) for your ocean. And you specify how this culture will be represented in your final terrain database. So you make it polygonal for lower LODs and a hole for the highest LOD. Then you set the range of your osgocean to be the same as your highest LOD range That is how I build the bosphores database with TerraVista. I am not very familiar with vpb (well, I used it couple of times to generate the whole earth with the blue marble dataset). You would need to see if vpb can work with vector culture. Or go with some commercial tolls, TerraVista, TerraSim ... etc. There are some contractors as well you can outsource the terrain generation to them. Maybe you explain what is your final database (also, what kind of sources you have) and we see if we can give better guidance. I expect some of the rest from the community might have faced and resolved this issue differently then me. -Nick On Tue, Aug 31, 2010 at 12:54 PM, issam boughanmi amigof...@gmail.comwrote: can you explain more in details this please ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31188#31188 ___ 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] [osgOcean] increase ocean view range
yes. look in the setup code for the oceansurface (I think. Dont have the code with me at the moment, but as far I can recall you can do that). -Nick On Tue, Aug 31, 2010 at 2:15 PM, issam boughanmi amigof...@gmail.comwrote: Hi nick and thanks for your support ;) i can investigate for your suggestion about lod node , shape files integration ... etc but for now i have a simple question : can i simply increase the ocean grid size surface ? if yes how ? my terrain is built like i said with vpb using srtm elevation file and landsat geotiff images + some high res geotiff files of some regions i am using this in a flight sim app the terrain database work perfectelly and now i want to integrate osgocean for the sea side region of my map -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31194#31194 ___ 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] Getting the List of Triangles from an osg model
to me looks like you are trying to debug in release -Nick On Tue, Aug 31, 2010 at 10:46 PM, Sanat Talmaki sanat.sch...@gmail.comwrote: Hi Jean, I was not able to understand this behavior: When I had a vec3Array and I queried it using vec3 = vec3Array-at(0) I would get an exception. Why does it give that exception ? I needed to use (*Vec3Array)[i] to get each Vec3. But then at i = 14113, I got an Unhandled exception: at 0x00402207 in OSG_examples.exe: 0xC005: Access violation reading location 0x00ba9000. And size has a value much higher = 4176061468 when I query the vec3Array for size I get a very large number and much large than Vec3Array-numElements() size = 4176061468 numElements = 7772 Which of these represents the number of vertices in the model ? Thanks Sincerely, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31222#31222 ___ 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] Displaying text as Bold, Italicized and underlined in osg
you can do it by changing the font. obviously there is file per style. For example, for Courier New font, the regular font is cour.ttf, for bold you have courbd.ttf and so on -Nick On Mon, Aug 30, 2010 at 5:45 PM, Jeremy Moles jer...@emperorlinux.comwrote: On Mon, 2010-08-30 at 12:27 +0200, Mangesh Joshi wrote: Hi, Is there any way in osg to display the text in bold and italicized style and underline or strikethrough the text? You can mix these kinds of decorations in a single string in osgPango, though I haven't added support for underline yet. http://osgpango.googlecode.com If you need to only use osgText, perhaps someone here will have some advice. Thank you! Cheers, mangesh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31148#31148 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Follow us on Twitter! http://twitter.com/emperorlinux EmperorLinux, Inc. http://www.emperorlinux.com 1-888-651-6686 ___ 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] [osgOcean] increase ocean view range
I think the endless option will not produce real endless ocean you can see it from any range. I think it is rather following your eyepoint and render enough so you can see it all the time. Just my thoughts, might be good to check it actually -Nick On Mon, Aug 30, 2010 at 1:24 PM, issam boughanmi amigof...@gmail.comwrote: hi back to the original question here two screens that describe the problem i am facing [Image: http://img90.imageshack.us/img90/183/fsim1.th.jpg ] ( http://img90.imageshack.us/i/fsim1.jpg/) [Image: http://img521.imageshack.us/img521/439/fsim2.th.jpg ] ( http://img521.imageshack.us/i/fsim2.jpg/) especially in the second screen the effect is more visible i have just a small square area of sea even with the enableEndless option and when the main player is in hight altitude the sea disappears any help or orientation is welcome -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31146#31146 ___ 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] [osgOcean] increase ocean view range
I guess you would need to put some LOD on the ocean culture. -Nick On Mon, Aug 30, 2010 at 6:44 PM, issam boughanmi amigof...@gmail.comwrote: yes from i have read the endless option adapt only the point of view to simulate endless effect that's said : how to get endless effect with osgocean especially in high altitude thanks and good day -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31159#31159 ___ 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] Getting the List of Triangles from an osg model
you need to write a node visitor and when you hit a Geode, then go over the drawables. There is a functor somewhere that gets you triangles from the drawables (have a look at TriangleFunctor) -Nick On Mon, Aug 30, 2010 at 9:07 PM, Sanat Talmaki sanat.sch...@gmail.comwrote: Hi, I am having trouble figuring out how I can get the list of triangles (vertices) that make up an osg object to use in another algorithm that needs a list of triangle vertices that make up the model. (I have seen the models I intend to use in osgviewer using the 'w' key and they are made up of only triangles. So if I am using either a .osg model or a model loaded through osgDB::readNodeFile(...), I would like to store in memory the list as above. I was hoping to get some tips on how I can start approaching this. (I hope I have been able to explain my problem clearly enough) Thank You Sincerely, Sanat. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31163#31163 ___ 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] [osgOcean] increase ocean view range
with osgocean there is an example coming which shows you how to add your own terrain. in the sample, the file loaded is called island.ive. Mimic the code and put there your database. That is what I did -Nick On Sun, Aug 29, 2010 at 5:39 PM, issam boughanmi amigof...@gmail.comwrote: nice screens ! can you show me your graph structure i tried every combination : ocean as a child, as a parent of the terrain parent, in the same level Hello, I havent tried with a database built with vpb, but I did it with database built with TerraVista. The key was to cut out the ocean (make a hole) to be later replaced by osgOcean. do you mean make a hole in the terrain ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31129#31129 ___ 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] [osgOcean] increase ocean view range
do you mean make a hole in the terrain ? yes -Nick On Sun, Aug 29, 2010 at 5:39 PM, issam boughanmi amigof...@gmail.comwrote: nice screens ! can you show me your graph structure i tried every combination : ocean as a child, as a parent of the terrain parent, in the same level Hello, I havent tried with a database built with vpb, but I did it with database built with TerraVista. The key was to cut out the ocean (make a hole) to be later replaced by osgOcean. do you mean make a hole in the terrain ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31129#31129 ___ 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] [osgPlugins] png plugin not working
make sure the 3rd party dlls are in your system path -Nick On Sun, Aug 8, 2010 at 4:53 PM, Nir Putter nirput...@walla.com wrote: Hi All, I'm trying to open an OSG file that uses a PNG file as texture and it keeps failing, informing me that it failed loading png plugin or something like that. Now, I've rebuilt the sample projects, both the plugin and the osgViewer, numerous times and still it wont load my lovely model. What am I missing here ? Thank you! Cheers, Nir -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30616#30616 ___ 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] latest NVIDIA drivers
Hi community, anyone has experienced some weirdness with the latest drivers from NVIDIA? My shaders just stopped working with them without any warning/error from OSG ... -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] latest NVIDIA drivers
Hi Wojtek, looks like that is it. The shader failing is the lighting shader ... Thanks ! -Nick On Thu, Aug 5, 2010 at 11:51 AM, Wojciech Lewandowski lewandow...@ai.com.pl wrote: Hi Trajce, I have noticed issues with Shader compilation on 256 (and above) series on Windows 7. Some fragment shaders using gl_LightSource fields were generating internal compiler errors. In fact I also posted a bug report to NVidia. These errors were normally reported by OSG with compilation log showing assembly cg output that was causing trouble for compiler. You don't see any compilation errors even with OSG_NOTIFY_LEVEL=DEBUG_INFO ? I have attached the bug report I posted to NVidia you can check if it could related. Cheers, Wojtek *From:* Trajce (Nick) Nikolov nikolov.tra...@gmail.com *Sent:* Thursday, August 05, 2010 8:47 AM *To:* OpenSceneGraph Users osg-users@lists.openscenegraph.org *Subject:* [osg-users] latest NVIDIA drivers Hi community, anyone has experienced some weirdness with the latest drivers from NVIDIA? My shaders just stopped working with them without any warning/error from OSG ... -Nick -- ___ 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] Different textures on each face of a geometry?
Hi Ku, well, you will only see one side of the face at a time - front or back. So to not go very complex, you can add cull callback where based on the face normal you change the texture and the uvs. I think this can work -Nick On Mon, Aug 2, 2010 at 1:18 PM, Ku Krapox kukra...@gmail.com wrote: Hi Nick, If you mean using osg::Geometry::setTexCoordArray, that's what I was doing until now, but I can't anymore since I want to put 2 textures on a single Geometry AND show different parts of them... But if this is not possible without modifying the geometry, I could get by with a simple method to put half of an image into a texture, which I'd display completely. This seemed easier to me, but I don't know if it is doable and how to do it? Thanks for any advice! Cheers, Ku -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30472#30472 ___ 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] Different textures on each face of a geometry?
you can control the part of the image you want to display thru the uv coordinates in your geometry -Nick On Fri, Jul 30, 2010 at 6:33 PM, Ku Krapox kukra...@gmail.com wrote: Hi Robert, Thanks for your reply. :) Your solution looks great, I think it'll do the trick! I have another question : Is there a way to create an osg::Texture2D containing only one part of an image, instead of loading the whole image? Typically I want to create textures with only one half of an image. Is this doable? Or is there an easier way to display only one half of an image on my geometry, by configuring the StateSet maybe?... Thanks! Cheers, Ku -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30431#30431 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] .osg model converted to flt would not load in 3rd party software
Hi Macher, can you share your model? I might have some time to have a look -Nick On Thu, Jul 29, 2010 at 11:18 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Macher, You will have say what the problem is when looking at the model with the various 3rd party software, there is pretty well nothing others can add without you describing what the problem is in more detail. Robert. On Thu, Jul 29, 2010 at 8:08 AM, Mach Bhai sar...@dsi.co.ae wrote: Hi, I have some models in native .osg format and i converted them to .flt using the osgconv utility. These models load fine with the osgviewer but with other softwares namely, 1) Deep Exploration 5.7 2) NVIDIA ScenixViewer 6.0 3) Remo 3D Is there a problem with a flt plugin or is there something that i am missing. I am using the following command for the conversion. osgconv -e flt in.osg out.flt I used osg 2.8.3. I would appreciate any help that may come my way. Thanks Macher -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30371#30371 ___ 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] Footprint algorithm
Hi Sukender, have you tried this one? http://www.naadsm.org/opensource/gpc http://www.naadsm.org/opensource/gpc -Nick On Thu, Jul 29, 2010 at 12:54 PM, Sukender suky0...@free.fr wrote: Hi all, Does anyone knows a (preferably free/open source) code computing either: - The footprint polygons of a building (intersection with terrain) - The footprint polygons of a building (intersection with a single plane) - The conntour polygons of a projected building ? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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] Optimizer is awesome!
you can save your model after optimization and load it optimized no need to wait 20 seconds then -Nick On Thu, Jul 29, 2010 at 10:39 PM, Cory Riddell c...@codeware.com wrote: I'm getting to the point where I have to start tuning my app a bit and so I added a call to Optimizer::optimize() today. Wow! On a typical model, my app was able to push just under 40 fps at 1920x1200 (debug build). After running the optimizer, it's pushing around 100 fps. The trade off of course is that it takes 20 seconds to run through all optimizations. That's a little long, but now I can start looking at the individual optimizations and see what the cost and benefit of each is. Cory ___ 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] What will OSG 3.0.0 be?
Hi Donlin, look in the archive. Robert is talking about things like shader composition - which I think will be the key feature. -Nick 2010/7/29 xyc508 xyc...@163.com Hi,all osger osg 3.0.0 is coming,Could someone tell What will OSG 3.0.0 be? what's the main changes and revolutionary updates? donlin -- 网易邮箱,没有垃圾邮件的邮箱。 http://mail.163.com/?from=fe1 ___ 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] How to set new PAT position for every traversal run ?
probably if you post the whole code someone might help you better. My advice is to use the updateCallback of the PAT node - you make sure then you are working on the right node. -Nick On Thu, Jul 22, 2010 at 2:41 PM, Sanat Talmaki sanat.sch...@gmail.comwrote: Hi, I am trying to set new values for the position of my PAT node for every run of while(!viewer.done()) Code: while( !viewer.done() ) { osg::Vec3d positionVector; // fire off the cull and draw traversals of the scene. viewer.frame(); viewer.updateTraversal(); receiveSignal(gpsInstance, gpsLat, gpsLon); setBackhoe(gpsLat, gpsLon, mapNode, surface, objectPlacer, backhoe1PAT); return 0; } And in my function: Code: void setBackhoe(double gpsLat, double gpsLon, osgEarth::MapNode* mapNode, osg::Node *surface, osgEarthUtil::ObjectPlacer* objectPlacer, osg::PositionAttitudeTransform* backhoe1PAT //osg::Vec3d positionVector ) { osg::Matrixd positionMatrix1; objectPlacer-createPlacerMatrix(gpsLat, gpsLon, 131, positionMatrix1); static double latitude; static double longitude; static double height; //static double x, y; static double X1 = positionMatrix1.getTrans().x(); static double Y1 = positionMatrix1.getTrans().y(); static double Z1 = positionMatrix1.getTrans().z(); //get SpatialReferenceSystem SRS for terrain (i.e. map) and lat-long. const SpatialReference* terrain_srs = mapNode-getMap()-getProfile()-getSRS(); const SpatialReference* latlong_srs = terrain_srs-getGeographicSRS(); //convert from projected to lat-long: terrain_srs-transform(X1, Y1, latlong_srs, longitude, latitude ); //to go from lat-long to projected: latlong_srs-transform(longitude, latitude, terrain_srs, X1, Y1); //set backhoe 1 exactly over terrain: letting the callback do that work. //set the PAT value of backhoe1: backhoe1PAT-setPosition(osg::Vec3d(X1, Y1, 0.0)); return ; } The problem I'm having is the my PAT node resets to (0,0,0) as soon as the function is exited. But since I was passing in by pointer a PAT node which I created in my main(), I thought this would not happen. How can I keep the current position value in my PAT node till it is updated in the next run ? Been stuck on this for quite a while so was hoping to get some advise. Thanks. Best, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30176#30176 ___ 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] 3D objects that don't rescale
Yes. You can use osg::AutoTransform I think -Nick On Thu, Jul 22, 2010 at 2:09 PM, benedikt naessens benedikt.naess...@spaceapplications.com wrote: Can you make 3D objects that don't rescale in OSG ? To clarify : if you move the camera closer and further, they will still have the same size. Still, they need to rotate and translate according to the movement of the camera. An example of that is the OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT character size mode for text. Here the text always has the same font size, independent of how far you are from the text geode. What I would like to have is something similar for for example points, lines and boxes. Thank you! Kind regards, Benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30175#30175 ___ 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] Retrieve MatrixTransform of a loaded model
Hi lucie, you do something like this class CollectMatrixTransformNodeVisitor : public osg::NodeVisitor { public: CollectMatrixTransformNodeVisitor() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} virtual void apply(osg::MatrixTransform node) { matrixTransforms.push_back(node); } std::vectorosg::MatrixTransform* matrixTransforms; }; then CollectMatrixTransformNodeVisitor nv; root-accept(nv); nv.matrixTransforms vector should have all your MatrixTransforms -Nick On Wed, Jul 21, 2010 at 4:39 PM, lucie lemonnier lucielemonn...@hotmail.frwrote: Hi, I know how to create a node visitor but I don't know how to traverse the node and simultaneously retrieve and store the MatrixTransform. Can you help me? Thank you! lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30163#30163 ___ 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] Retrieve MatrixTransform of a loaded model
you would want to add traverse(node); in the apply method. forgot this -Nick On Wed, Jul 21, 2010 at 9:48 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hi lucie, you do something like this class CollectMatrixTransformNodeVisitor : public osg::NodeVisitor { public: CollectMatrixTransformNodeVisitor() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} virtual void apply(osg::MatrixTransform node) { matrixTransforms.push_back(node); } std::vectorosg::MatrixTransform* matrixTransforms; }; then CollectMatrixTransformNodeVisitor nv; root-accept(nv); nv.matrixTransforms vector should have all your MatrixTransforms -Nick On Wed, Jul 21, 2010 at 4:39 PM, lucie lemonnier lucielemonn...@hotmail.fr wrote: Hi, I know how to create a node visitor but I don't know how to traverse the node and simultaneously retrieve and store the MatrixTransform. Can you help me? Thank you! lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30163#30163 ___ 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] txp::TXPNode coordinate system
do search for Y up to Z up in the archive. -Nick On Wed, Jul 21, 2010 at 3:53 AM, Guy Volckaert guy.volcka...@meggitt.comwrote: While analyzing the TXNode class, I noticed that it makes a suttle assumption that the coordinate system is Z up. Almost everyhere else in OSG it make no such assumption (or it provides a CoordinateFrame class to convert from one coordinate system to another such as from Z up to Y up). Here is a small code snipit of TxpNode: Code: void TXPNode::updateEye(osg::NodeVisitor nv) { [...] // This code assumes Z up. trpg2dPoint loc; loc.x = nv.getEyePoint().x() - _originX; loc.y = nv.getEyePoint().y() - _originY; [...] } Is there an easy to make this work with other coordinate systems (like Y up). Cheers, Guy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30152#30152 ___ 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] Select node on screen
Have a look at the osgpick example -Nick On Thu, Jul 15, 2010 at 4:53 PM, Tufan Taş tas.tu...@gmail.com wrote: Hi, I have nodes on screen and I want to select a node by clicking on it using mouse. Do you know any samples about this subject? ... Thank you! Cheers, Tufan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30027#30027 ___ 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] Disable maximize button in Win32 window
::SetWindowLong( hwnd-getHWND(), GWL_STYLE, ::GetWindowLong(hwnd-getHWND(),GWL_STYLE) ~WS_MAXIMIZEBOX ); -Nick On Tue, Jul 13, 2010 at 10:25 AM, Saravanan Sivaprahasam saransivapraha...@rediffmail.com wrote: Hi, I've tried using the following code to disable the maximize button in the window. osgViewer::ViewerBase::Windows wins; viewer-getWindows(wins); osgViewer::GraphicsHandleWin32* hwnd = dynamic_castosgViewer::GraphicsHandleWin32*(wins[0]); HMENU hMenu = ::GetSystemMenu(hwnd-getHWND(), FALSE); ::EnableMenuItem(hMenu, SC_MAXIMIZE, MF_BYCOMMAND | (MF_DISABLED | MF_GRAYED)); The above code is not working for maximize button, but it works well for close button. Is there any other way to achieve this -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29947#29947 ___ 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] automatically minimize the viewer window
are you under windows? If so there is a way to do that by setting a new style with WS_MINIMIZE http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx -Nick On Wed, Jul 7, 2010 at 3:45 AM, Thomas Canipel thomas.cani...@gmail.comwrote: Hi, Is there a way to modify the behavior of the window, like minimize it , programmatically ? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29760#29760 ___ 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] missing posts on the mailing lists.
some emails might end up in the junk -Nick On Tue, Jul 6, 2010 at 8:05 PM, Martin Naylor martin.nay...@dsl.pipex.comwrote: Hi all, I am either going crazy or more likely my outlook email is. Is anyone else missing replies on posts? An example: Jose posted with the subject “light through walls” I see J-S’s reply but I don’t see Nicks, the only reason why i noticed is that Jose thanks Nick and J-S, but I don’t see Nick’s reply. Mmmm I did see something in submissions in the other day from another poster who is having similar problems. Maybe it’s just me! Martin Naylor. ___ 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] light through walls
do a search in the archive for light lobes. There is a code posted that do what you ask for -Nick On Wed, Jun 9, 2010 at 7:01 PM, Jose Rincon jm.rincon.pe...@gmail.comwrote: Hi, I'm working with a light (spotlight) concretely. I would like that this light didn't go through walls. How can I obtain this effect? Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=28747#28747 ___ 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] OT: NASA immersive 3D graphics
http://www.nasa.gov/offices/education/programs/national/ltp/games/moonbasealpha/index.html http://www.nasa.gov/offices/education/programs/national/ltp/games/moonbasealpha/index.html -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] cross axes
could you post a working code of it? I will have a look at -Nick On Thu, Jul 1, 2010 at 1:35 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Thanks Nick, I implement it but some modifications caused another problem I don't understand. In the old code I created a cross axes with size=1.5 for each axis. The ortho camera was defined as follows: camera-setProjectionMatrix(osg::Matrix::ortho2D(-1.7, 17.75, -1.7, 13.86)); Then I had to fix the resize problem as you suggested. So, on resize event I used the actual viewer width and height. Here is basically the call: camera-setProjectionMatrix(osg::Matrix::ortho2D(-axisSize, iWidth-axisSize, -axisSize, iHeight-axisSize)); but the axis size=1.5 was to small in this case and I had to increase it to 70 to be seen. Now the problem. On top of each axis an osgText to diplays the labels X, Y and Z. When an axis points towards out of the screen (more or less) the label disappears. In the previous implementation with axis size=1.5 it worked correctly. Can you please explain me why? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29579#29579 ___ 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] cross axes
cool. I ll have a look later today and get back to you -Nick On Thu, Jul 1, 2010 at 2:51 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Nick, here is a working code showing the label disappearing problem: Code: #include osgViewer/Viewer #include osgText/Text #include osg/LineWidth #include osg/Geometry #include osgGA/TrackballManipulator osgText::Text* createAxisLabel(const std::string iLabel, const osg::Vec3 iPosition) { osgText::Text* text = new osgText::Text; text-setFont(arial.ttf); text-setText(iLabel); text-setPosition(iPosition); text-setCharacterSize(17); text-setAutoRotateToScreen(true); text-setColor(osg::Vec4(204, 204, 0, 1)); text-setCharacterSizeMode(osgText::Text::SCREEN_COORDS); return text; } osg::Geometry* createArrow(const osg::Matrixd iTransform, const osg::Vec4 iColor, double iHeight) { osg::Geometry* geometry = new osg::Geometry; double pyramidBaseZ = iHeight/3.0*2.0; double outerBaseRadius = iHeight/9.0; osg::Vec3Array* vertices = new osg::Vec3Array(7); (*vertices)[0].set(iTransform.preMult(osg::Vec3d(outerBaseRadius, 0.0, pyramidBaseZ))); (*vertices)[1].set(iTransform.preMult(osg::Vec3d(0.0, outerBaseRadius, pyramidBaseZ))); (*vertices)[2].set(iTransform.preMult(osg::Vec3d(-outerBaseRadius, 0.0, pyramidBaseZ))); (*vertices)[3].set(iTransform.preMult(osg::Vec3d(0.0, -outerBaseRadius, pyramidBaseZ))); (*vertices)[4].set(iTransform.preMult(osg::Vec3d(0.0, 0.0, iHeight))); (*vertices)[5].set(iTransform.preMult(osg::Vec3d(0.0, 0.0, iHeight))); (*vertices)[6].set(iTransform.preMult(osg::Vec3d(0.0, 0.0, 0.0))); osg::UByteArray* indices = new osg::UByteArray(20); (*indices)[0]=0; (*indices)[1]=1; (*indices)[2]=4; (*indices)[3]=1; (*indices)[4]=2; (*indices)[5]=4; (*indices)[6]=2; (*indices)[7]=3; (*indices)[8]=4; (*indices)[9]=3; (*indices)[10]=0; (*indices)[11]=4; (*indices)[12]=1; (*indices)[13]=0; (*indices)[14]=3; (*indices)[15]=2; (*indices)[16]=1; (*indices)[17]=3; (*indices)[18]=5; (*indices)[19]=6; geometry-setVertexArray(vertices); geometry-setVertexIndices(indices); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(iColor); geometry-setColorArray(colors); geometry-setColorBinding(osg::Geometry::BIND_OVERALL); geometry-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES, 0, indices-size()-2)); geometry-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, indices-size()-2, 2)); return geometry; } osg::Geometry* createXAxis(double iHeight) { osg::Matrixd transform = osg::Matrix::rotate(osg::inDegrees(90.0f), 0.0f, 1.0f, 0.0f); osg::Vec4 color(0.5f,0.125f,0.125f,1.0f); osg::Geometry* geometry = createArrow(transform, color, iHeight); return geometry; } osg::Geometry* createYAxis(double iHeight) { osg::Matrixd transform = osg::Matrix::rotate(osg::inDegrees(-90.0f), 1.0f, 0.0f, 0.0f); osg::Vec4 color(0.125f,0.5f,0.125f,1.0f); osg::Geometry* geometry = createArrow(transform, color, iHeight); return geometry; } osg::Geometry* createZAxis(double iHeight) { osg::Matrixd transform = osg::Matrix::identity(); osg::Vec4 color(0.125f,0.125f,0.5f,1.0f); osg::Geometry* geometry = createArrow(transform, color, iHeight); return geometry; } osg::Geode* createAxesGeometry() { osg::Geode* geode = new osg::Geode; osg::LineWidth* lineWidth = new osg::LineWidth(2); geode-getOrCreateStateSet()-setAttributeAndModes(lineWidth, osg::StateAttribute::ON); geode-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::OFF); double length = 70.0; geode-addDrawable(createXAxis(length)); geode-addDrawable(createYAxis(length)); geode-addDrawable(createZAxis(length)); geode-addDrawable(createAxisLabel(X, osg::Vec3(length*1.05, 0, 0))); geode-addDrawable(createAxisLabel(Y, osg::Vec3(0, length*1.05, 0))); geode-addDrawable(createAxisLabel(Z, osg::Vec3(0, 0, length*1.05))); return geode; } class AxisCameraUpdateCallback:public osg::NodeCallback { public: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { if(nv-getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) { osg::Camera* camera = dynamic_castosg::Camera*(node); if (camera) { osg::View* view = camera-getView(); if (view view-getNumSlaves() 0) { osg::View::Slave* slave = view-getSlave(0); if(slave-_camera.get() == camera) { osg::Camera* masterCam = view-getCamera(); osg::Vec3 eye, center, up; masterCam-getViewMatrixAsLookAt(eye, center, up, 30); osg::Matrixd matrix; matrix.makeLookAt(eye-center, osg::Vec3(0, 0, 0), up); // always look at (0, 0, 0) camera-setViewMatrix(matrix); } } } }
Re: [osg-users] cross axes
Gianni, I would follow Davide's hints and see if it works -Nick On Thu, Jul 1, 2010 at 5:36 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Thanks Davide. I considered that but since I would prefer to fix the axes origin to (0,0,0), I tried setting big values for zNear/zFar parameters for camera as follows: setProjectionMatrixAsOrtho(-80, 1280-80, -80, 1024-80,-800, 800); but nothing changed. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29604#29604 ___ 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] Loader Plugin callback mechanism
You are right about this. I would welcome more as attribute support though (like descriptions is implemented. There was some discussion abiyt having attributes in the nodes I remember, but sure if it is implemented. -Nick On Wed, Jun 30, 2010 at 1:27 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi, Some file formats like OpenFlight can contain various data, which might not be directly related to rendering but can be important in other contexts. While I fully agree that the loaders can and should skip this information when constructing the scene-graph, I would find it extremly useful to have some callback mechanism for those skipped entities. @Robert: Can you think of a general concept that could be integrated into the loader-infrastructure? My idea was to use a callback mechanism that can be installed and registered to the loader implementation. Those callbacks would textually tell me what kind of non-render-related data was read for which node/geom etc. For instance flt can contain things like surface material codes and featured ids. I imagine having a callback functions like this: class LoadCallback { virtual void customData(const std::string element_data, osg::Node node, int data) virtual void customData(const std::string element_data, osg::Node node, float data) ... various overloads } Those could be called inside the loader: ... _loadcallback.customData(OpenFlight::SMC, current_node, readuint(16)) ... Do you think that such extension would be general enough to be applied to loaders? Would you mind If I try to include such concept? cheers Sebastian ___ 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] Understanding Transparent Textures with an transparent image with alpha channels
attach a screenshot of what you are seeing -Nick On Wed, Jun 30, 2010 at 6:25 PM, Tim Larson tlar...@hunter.com wrote: Thank you. I've experimented with enabling blending by calling pStateSet-setMode(GL_BLEND) on my geometry. I've also experimented with creating a material for the geometry that has an alpha value. Unfortunately, this does not have the desired effect. Applying an alpha value to the material for the geometry makes the entire geometry and image partially transparent. I would like to have the transparency level determined by the alpha values within my image. The image has some areas that are completely transparent and some areas that are completely opaque. The Image is a TGA image with alpha transparency. I can confirm that the transparency of the image is intact, because if I change the color of the geometry's material, I can see that color behind the image. But, my goal is to have the geometry on which the image placed be invisible so that all that is seen is the image. And, the user can see through the transparent elements of the image to the background or to other geometries that may be behind. I've attached the small source file and my actual image. Thank you for your assistance. Tim J.P. Delport wrote: Hi, did you enable blending in your scene? What format texture are you loading? jp On 29/06/10 23:34, Tim Larson wrote: I am attempting to utilize a transparent image as a texture map. I can successfully display the transparent image as a texture on a simple rectangular geometry. But, I would like to be able to see through to the background wherever the image is transparent. I've utilized the osgHelp program GeometryTexture as a baseline and I can load my image, but the transparent parts of the image show through to the default gray material of the underlying geometry. I see a gray rectangle with my image on top of it. Even though my image has many transparent areas. I would like to be able to see through the transparent areas of the image into the background. i.e. If all I have on the screen is a single rectangular geometry with my transparent image, then I'd like to see the blue background through the transparent parts of my image. Can anyone give me a pointer or advise? Thanks in Advance. Tim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29503#29503 ___ osg-users mailing list 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 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29521#29521 ___ 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] cross axes
exactly. make your ortho with the new window size -Nick On Wed, Jun 30, 2010 at 7:21 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Hi Nick, I'm using Qt and reimplemented the virtual method: virtual void resizeGL( int width, int height ) that is called on every window resize. I get the ortho camera and called getProjectionMatrixAsOrtho(left, right, bottom, top, zNear, zFar); just to verify the values. Do you mean I should change those parameters depending on the actual width height of the window? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29528#29528 ___ 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] setting a color to material
yes. You can set the color directly for the Geometry and the Material as a State -Nick On Tue, Jun 29, 2010 at 5:37 PM, Nitin Rangari rangari.niti...@gmail.comwrote: hi all, can i set a both color array and material in one geometry? thanks, Nitin ___ 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] Quero ser seu amigo no Quepasa.com
yea ... I used to work on amiga long time ago : how did this get into here? -Nick 2010/6/28 Edgar Moraes Diniz edg...@gmail.com [image: Quepasa.com]http://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1519.html?url=http://www.quepasa.com/pt_BR/ *Clique aqui*http://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1528.html?url=http%3A%2F%2Fwww.quepasa.com%2Fpt_BR%2Fuser%2FcancelQPAlerts.php%3Fsign%3D3a8a758a202ab22d0b2475bcecef2ba1%26alert%3D4%26email%3Dosg-users%40lists.openscenegraph.org%26id%3D-1para cancelar a inscrição. OpenSceneGraph, Eu gostaria de ser seu amigo(a) no Quepasa.com. Você gostaria de adicionar-mehttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1436.html?url=http://www.quepasa.com/qp/96040823.htmlmail=osg-us...@lists.openscenegraph.orghash=f6a830a13ee70816cc8daf86fc30454b20100628como amigo(a)? SIMhttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1439.html?url=http://www.quepasa.com/qp/96040823.htmlmail=osg-us...@lists.openscenegraph.orghash=f6a830a13ee70816cc8daf86fc30454b20100628 NÃOhttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1440.html?nofriend=trueurl=http://www.quepasa.com/pt_BR/ Obrigado! Edgar Moraes Diniz Para evitar que continue recebendo notificações em seu email por parte dos seus amigos do Quepasa.com, clique aquihttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1433.html?url=http%3A%2F%2Fwww.quepasa.com%2Fpt_BR%2Fuser%2FcancelQPAlerts.php%3Fsign%3D3a8a758a202ab22d0b2475bcecef2ba1%26alert%3D4%26email%3Dosg-users%40lists.openscenegraph.org%26id%3D-1. Mudar Preferências de Correiohttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1898.html?url=http%3A%2F%2Fwww.quepasa.com%2Fpt_BR%2Fhome%2Femail.phpmail=osg-us...@lists.openscenegraph.orghash=f6a830a13ee70816cc8daf86fc30454b20100628/ Recuperar Senhahttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1529.html?url=http%3A%2F%2Fwww.quepasa.com%2Fpt_BR%2Fuser%2FsendPassword.php/ Termos e Condiçõeshttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1521.html?url=http%3A%2F%2Fwww.quepasa.com%2Ftos_pt_BR.html/ Políticas de Privacidadehttp://www.quepasa.com/metric/email/click/d31589a0052ffe4b42687e6a5b3aa09e/7271921561/1522.html?url=http%3A%2F%2Fwww.quepasa.com%2Fcommon%2Fprivacypolicy_pt_BR.html/ Suport supp...@quepasacorp.com Quepasa Corporation 324 Datura Street, Suite 114, West Palm Beach, FL, 33401. Você recebe esta mensagem porque seu amigo(a) é membro do Quepasa. Para garantir que receba estes correios eletrônicos, adicione i...@quepasa.com na sua lista de contatos. ___ 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] cross axes
if you are doing it thru ortho camera, then you have to change the camera settings to fit your new window size on resize -Nick On Fri, Jun 25, 2010 at 11:50 AM, Gianni Ambrosio ga...@vi-grade.comwrote: Another question. Now the axes works fine in the left bottom corner but if I resize the viewer window (I use QT embedding the viewer inside) the cross axes object is deformed accordingly. How can I prevent that? I mean, I agree to resize the axes but in a homogeneous way for every axis. Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29405#29405 ___ 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] Extracting Node Names from NodePath
Hi John, the node path stores all the nodes from the root to the node containing the geometry (a Geode). In your case, if you picked node1, the nodepath will be root;PAT1;node1. You can iterate over them and get the name with node-getName(). The lead node would be nodepath.back() -Nick On Wed, Jun 23, 2010 at 9:54 AM, John Galt manu9ak...@gmail.com wrote: Hi, I have my scene set up as follows: osg::Node* node1; osg::Node* node2; osg::Node* node3; I have loaded node1, node2 and node3 using readNodeFromFile function. Then I have my nodes attached to my root as follows: root-addChild(PAT1); PAT1-addChild(node1); root-addChild(PAT2); PAT1-addChild(node2); root-addChild(PAT3); PAT1-addChild(node3); Then I got a HitList and extracted Hits out of it. For each particular hit, I have extracted the NodePath. What exactly does the NodePath store? How do I extract the names of the Nodes that contain the geometry i.e., how do I use the NodePath to return the bottom most (leaf node?) node (node1, node2 or node3) in my scene graph? Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29291#29291 ___ 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] geometry
Hi Gianni, here is working code snippet with the line *osg::Geometry* createPyramid(const osg::Matrixd iTransform, const osg::Vec4 iColor)* *{* * osg::Geometry* geom = new osg::Geometry;* * * * osg::Vec3Array* vertices = new osg::Vec3Array(5+2);* * (*vertices)[0].set(iTransform.preMult(osg::Vec3d(8.0f, 0.0f, 0.0f)));* * (*vertices)[1].set(iTransform.preMult(osg::Vec3d(0.0f, 8.0f, 0.0f)));* * (*vertices)[2].set(iTransform.preMult(osg::Vec3d(-8.0f, 0.0f, 0.0f)));* * (*vertices)[3].set(iTransform.preMult(osg::Vec3d(0.0f, -8.0f, 0.0f)));* * (*vertices)[4].set(iTransform.preMult(osg::Vec3d(0.0f, 0.0f, 25.0f)));* * * * (*vertices)[5].set(iTransform.preMult(osg::Vec3d(0.0f, 0.0f, 25.0f))); //4line* * (*vertices)[6].set(iTransform.preMult(osg::Vec3d(0.0f, 0.0f, -50.0f))); //4line* * * * osg::UByteArray* indices = new osg::UByteArray(20);* * (*indices)[0]=0; (*indices)[1]=1; (*indices)[2]=4;* * (*indices)[3]=1; (*indices)[4]=2; (*indices)[5]=4;* * (*indices)[6]=2; (*indices)[7]=3; (*indices)[8]=4;* * (*indices)[9]=3; (*indices)[10]=0; (*indices)[11]=4;* * (*indices)[12]=1; (*indices)[13]=0; (*indices)[14]=3;* * (*indices)[15]=2; (*indices)[16]=1; (*indices)[17]=3;* * * * (*indices)[18]=5;* * (*indices)[19]=6;* * * * geom-setVertexArray(vertices);* * geom-setVertexIndices(indices);* * * * osg::Vec4Array* colors = new osg::Vec4Array;* * colors-push_back(iColor);* * geom-setColorArray(colors);* * geom-setColorBinding(osg::Geometry::BIND_OVERALL);* * * * geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES, 0, indices-size()-2));* * * * geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, indices-size()-2, 2)); //4line* * * * return geom;* *}* -Nick On Wed, Jun 23, 2010 at 5:32 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Hi, what's wrong in the following code? Code: osg::Geometry* createPyramid(const osg::Matrixd iTransform, const osg::Vec4 iColor) { osg::Geometry* geom = new osg::Geometry; osg::Vec3Array* vertices = new osg::Vec3Array(5+2); (*vertices)[0].set(iTransform.preMult(osg::Vec3d(8.0f, 0.0f, 0.0f))); (*vertices)[1].set(iTransform.preMult(osg::Vec3d(0.0f, 8.0f, 0.0f))); (*vertices)[2].set(iTransform.preMult(osg::Vec3d(-8.0f, 0.0f, 0.0f))); (*vertices)[3].set(iTransform.preMult(osg::Vec3d(0.0f, -8.0f, 0.0f))); (*vertices)[4].set(iTransform.preMult(osg::Vec3d(0.0f, 0.0f, 25.0f))); (*vertices)[5].set(iTransform.preMult(osg::Vec3d(0.0f, 0.0f, 25.0f))); //4line (*vertices)[6].set(iTransform.preMult(osg::Vec3d(0.0f, 0.0f, -50.0f))); //4line osg::UByteArray* indices = new osg::UByteArray(18); (*indices)[0]=0; (*indices)[1]=1; (*indices)[2]=4; (*indices)[3]=1; (*indices)[4]=2; (*indices)[5]=4; (*indices)[6]=2; (*indices)[7]=3; (*indices)[8]=4; (*indices)[9]=3; (*indices)[10]=0; (*indices)[11]=4; (*indices)[12]=1; (*indices)[13]=0; (*indices)[14]=3; (*indices)[15]=2; (*indices)[16]=1; (*indices)[17]=3; geom-setVertexArray(vertices); geom-setVertexIndices(indices); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(iColor); geom-setColorArray(colors); geom-setColorBinding(osg::Geometry::BIND_OVERALL); geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES, 0, indices-size())); geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 5, 2)); //4line return geom; } I added the three //4line lines of code to explain my problem. In this case I would add a line starting from the top of the pyramid downwards but I just see the pyramid instead. Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29322#29322 ___ 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] geometry
I think you can not mix index based geometry with non-index based geometry within one geometry (I might be wrong here! ). If you want to draw a line outside the pyramid, then attach another geometry to the geode doing just the line in a way you want. Are yo after drawing an arrow? If so, your approach will rebuild the arrow geometry for each matrix transform - change. -Nick On Wed, Jun 23, 2010 at 6:08 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Thanks Nick for the code. Now I would like to understand why I must add the indices in this case since for a simple line I just need to insert the vertices in the geometry node. In fact I would like to add the line to the geometry outside of the createPyramid method, where the line is created without the use of indices, just vertices. Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29326#29326 ___ 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] geometry
Here is what I would do: 1) Create the whole arrow in one geometry including the line - by default let say make it fixed pointing up (0,0,1). Here is your createArrow thing that will give you the whole arrow 2) Add MatrixTransform on top of this geometry - with this, you can control the position, direction and scale 3) Use quaternions for the arrow orientation osg::Quat This way would not need to rebuilt it for each change or build the arrow completely in geometry shader - you would need to pass only a line this way - only two vertices -Nick On Wed, Jun 23, 2010 at 6:32 PM, Gianni Ambrosio ga...@vi-grade.com wrote: OK, thanks Nick for the explanation suggestion. At first I started adding the geometry to a geode separately but I would like to add the entire arrow to the geode instead of adding the two parts. I mean somethig like that: osg::Geode g; g-addDrawable(createArrow()); osg::Geometry* createArrow() { // here use createPyramid() and then add the line } Is it possible? I dont like to do as follows: osg::Geode g; g-addDrawable(createPyramid()); g-addDrawable(createLine()); I mean, I would like to create the arrow as a single geometry but calling the createPyramid() method. Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29328#29328 ___ 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] geometry
ah .. ok -Nick On Wed, Jun 23, 2010 at 11:18 PM, Gianni Ambrosio ga...@vi-grade.comwrote: Nick, I didn't get the second solution, anyway I think my case is a little bit particular. I don't need to move the arrow around but it is just part of a cross axes I have to add to the scene. It is fixed under a separate camera. So the transformation you can see as first parameter of createPyramid() method is just to generalize the creation of the three axes (X, Y and Z). Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29338#29338 ___ 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] HitLists
This should be STL vector. for (unsigned int i=0; iHitList.size(); ++i) myHit = HitList.at(i); -Nick On Tue, Jun 22, 2010 at 8:06 AM, John Galt manu9ak...@gmail.com wrote: Hi, If my HitList contains multiple hits, how do I extract all of them starting from the first to the last? I can extract the first and the last hits using HitList.front() and HitList.back() but I am having trouble with extracting the other hits in between them. Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29242#29242 ___ 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] Virtual walk on my scene
Hi Elmar, have a look at osgviewer. or you can do viewer.setCameraManipulator( new osgGA::FirstPersonManipulator ) - that is only you need -Nick On Mon, Jun 21, 2010 at 8:04 AM, Elmar Alizade elmar_aliz...@hotmail.comwrote: Hi Trajce, Where I can get samples about using osgGA::FirstPersonManipulator? ... Thank you! Cheers, Elmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29187#29187 ___ 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] [build] Building
Hi Robert, yes, it is possible. I have build the whole OSG project with Visual Studio express 2008 -Nick On Tue, Jun 15, 2010 at 9:30 AM, Robert Oliver robertool2...@yahoo.comwrote: Hi, Is it possible to build using VS Express Edition ?. I' ve used some headers from Open Foundation Classes, but it is not enough to build all Thank you! Cheers, Robert -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=28918#28918 ___ 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] How to know if a pre render pass has finished rendering
Hi, have a look at osghud example. It shows how to use postDrawCallbacks to save the rendered image into a file -Nick On Fri, Jun 18, 2010 at 7:49 PM, Prakhar Jain mindfields@gmail.comwrote: [quote=Paul Martz]Prakhar Jain wrote: I wish to do a Render to Texture in which I have set the render target for the camera to be an osg image. Is there a way by which I can know if the prerender pass has finished or not ?. Attach a post-draw callback to the Camera. See the Camera header file. Thank you for the answers. How can I do this, can you give me a rough idea ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29159#29159 ___ 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] Virtual walk on my scene
Hi Elmar, what do you mean by virtual walk? interactively to mo move thru your scene? Animate the camera ? when you run osgviewer with your model, press 'h', help will show on your screen., There are couple of Camera Manipulators available - obviousely the keys 1-5, these allow you to move with the mouse, keyboard. -Nick On Thu, Jun 17, 2010 at 11:29 AM, Elmar Alizade elmar_aliz...@hotmail.comwrote: Hi, I want to create visualization of my scene with terrain, my objects, sky, light and etc. I want to virtual walk on my scene. Where I can find sample about this? Generally is it possible with OSG? ... Thank you! Cheers, Elmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29065#29065 ___ 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] Virtual walk on my scene
Hi Elmar, then I would suggest to have a look at osgGA::FirstPersonManipulator and get familiar with the examples as they are good to walk you thru different aspect of osg. Also do a search in the archive. Collision detection was discussed a lot -Nick On Thu, Jun 17, 2010 at 2:45 PM, Elmar Alizade elmar_aliz...@hotmail.comwrote: Hi, Trajce I want to move through in my scene. First of all I want to create player combined camera and create collision between this player and my objects. ... Thank you! Cheers, Elmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29083#29083 ___ 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] How I can set background?
Hi your question is answered in the archive ... do a search for Background image... -Nick On Sat, Jun 12, 2010 at 8:03 AM, Elmar Alizade elmar_aliz...@hotmail.comwrote: Hi, How I can set the image as background to my scene? Maybe there is information about my question. If there is then send me link. ... Thank you in advance! Cheers, Elmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=28848#28848 ___ 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] normals in geometry shader
Please ignore this question. After researching and understanding how things works it is rather non-sense ;-) -Nick On Wed, Jun 16, 2010 at 11:25 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hello community, till now, I have had some experience with geometry shaders, but not too serious. I am after generating normals for the vertices generated in the geometry shader. I did some research on this but not very happy with what I have found so far. Any hints from you? Thanks a lot -Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] different behavior on the trackball manipulator
Hi John, I just ran an old code. In the older version, the model was centered on the screen. with the new manipulators it is not. I use the default behavior -Nick On Sat, Jun 12, 2010 at 2:28 PM, PCJohn pec...@fit.vutbr.cz wrote: Hi Nick, there are two major changes to CameraManipulator::computeHomePosition(): - the computation uses bounding box by default (the model center is located more precisely) - the computation considers the camera fov to make sure that the model nicely fits to the screen (small fov may make the model larger than screen while big fov too small). If there is a bug, you see some problems with the approach, or you would like some adjustments, we can discuss them further. John Trajce (Nick) Nikolov wrote: Hi community, I updated osg from the trunk today (after a month) and I am seeing different behavior on the trackball manipulator - the scene starts far away from my model. I was following the thread of the reengineering of this piece of the code which happened lately. Anyone experiencing the same/similar ? -Nick -- ___ osg-users mailing listosg-us...@lists.openscenegraph.orghttp://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] different behavior on the trackball manipulator
it is using some sample with osgviewer., I can post you the code if you are interested. -Nick On Sat, Jun 12, 2010 at 2:53 PM, PCJohn pec...@fit.vutbr.cz wrote: Strange. Unfortunately, all my models gets centered on the screen, so I can not reproduce the problem on my side. Can you investigate further what is happening and whether the problem is not in your code? Is the problem happening with osgviewer as well? John Trajce (Nick) Nikolov wrote: Hi John, I just ran an old code. In the older version, the model was centered on the screen. with the new manipulators it is not. I use the default behavior -Nick On Sat, Jun 12, 2010 at 2:28 PM, PCJohn pec...@fit.vutbr.cz wrote: Hi Nick, there are two major changes to CameraManipulator::computeHomePosition(): - the computation uses bounding box by default (the model center is located more precisely) - the computation considers the camera fov to make sure that the model nicely fits to the screen (small fov may make the model larger than screen while big fov too small). If there is a bug, you see some problems with the approach, or you would like some adjustments, we can discuss them further. John Trajce (Nick) Nikolov wrote: Hi community, I updated osg from the trunk today (after a month) and I am seeing different behavior on the trackball manipulator - the scene starts far away from my model. I was following the thread of the reengineering of this piece of the code which happened lately. Anyone experiencing the same/similar ? -Nick -- ___ osg-users mailing listosg-us...@lists.openscenegraph.orghttp://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 listosg-us...@lists.openscenegraph.orghttp://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] How can I define the screen which show me my viewer?
looks in the traits for setup your viewer. osgcompositeviewer example shows usage of traits -Nick 2010/6/10 Martin Großer grosser.mar...@gmx.de Hello, I get the number of screens with the following lines: _wsi = _gc-getWindowingSystemInterface(); std::cout Detected Screens: _wsi-getNumScreens() std::endl; My question is: How can I define the screen which show me my viewer? Cheers Martin ___ 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