Re: [osg-users] Texture2D format problem
Hello, I will make my own answer : I used osg::Image to obtain the unsigned char* data array, and i use it to melt the two pictures in one. data[n] = osg::maximum(Edata[n], (unsigned char)Cdata[i]); This is not a the solution of the problem, but it can solve it, when no other solution exist. (Be carefull to the depth of the Image) If someone have anther solution, I'll be interested. Thank you. 2008/2/21, Vincent Bourdier [EMAIL PROTECTED]: Hello I am trying to put 2 Texture2D on the same geometry. The backgroud texture is a .jpg file and the foregroud texture is a .png file with opacity (clouds map). If I use them normally, the foregroud texture is in good position, but in place of the transparent's pixels the is only a dark (black) color, and in place of the clouds pixels, I can see the background picture... if I convert .png file in .jpg(without transparency) it does nothing at all. and in .gif it does something strange, with a hight level of opacity (very transparent) and the white color of the clouds is not visible... Is there some picture formats recomendations ? How to manage 2 textures on the same geometry ? (melting them) Thanks ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Texture2D format problem
Hi Robert. Perhaps i'm not very clear in what i intend to do : I want to create a sphere to simulate the earth. for texturing it, i use 2 textures : one of the sea and lands, one of the clouds. the second one can be with opacity (to keep only clouds). I would just put the 2 textures on the earth, with the opacity of the clouds map, to obtain something a little bit realistic. I am new with OSG applications so I am still searching how to do basic things like that... Thanks. 2008/2/25, Robert Osfield [EMAIL PROTECTED]: HI Vincent, Perhaps everybody else like me is a bit confused by what you are actually after. The OSG supports multi-texturing, and shaders, the plugins are all orthogonal to final readering - all in all is most likely what you are trying to do is very straightforward. I can't really glean exactly what the problem might be, perhaps you are just tackling it in an awkward way that is confusing things. Robert. On Mon, Feb 25, 2008 at 8:26 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hello, I will make my own answer : I used osg::Image to obtain the unsigned char* data array, and i use it to melt the two pictures in one. data[n] = osg::maximum(Edata[n], (unsigned char)Cdata[i]); This is not a the solution of the problem, but it can solve it, when no other solution exist. (Be carefull to the depth of the Image) If someone have anther solution, I'll be interested. Thank you. 2008/2/21, Vincent Bourdier [EMAIL PROTECTED]: Hello I am trying to put 2 Texture2D on the same geometry. The backgroud texture is a .jpg file and the foregroud texture is a .png file with opacity (clouds map). If I use them normally, the foregroud texture is in good position, but in place of the transparent's pixels the is only a dark (black) color, and in place of the clouds pixels, I can see the background picture... if I convert .png file in .jpg(without transparency) it does nothing at all. and in .gif it does something strange, with a hight level of opacity (very transparent) and the white color of the clouds is not visible... Is there some picture formats recomendations ? How to manage 2 textures on the same geometry ? (melting them) Thanks ___ 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] Texture2D format problem
Thanks, I think i have understood that TexEnvCombine is necessary. I'll try this as soon as possible. Thank you for your explanations. 2008/2/25, Robert Osfield [EMAIL PROTECTED]: HI Vincent, Have a look at the osgplanets example is has code paths that do multi-texturing on spheres. Robert. On Mon, Feb 25, 2008 at 9:01 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert. Perhaps i'm not very clear in what i intend to do : I want to create a sphere to simulate the earth. for texturing it, i use 2 textures : one of the sea and lands, one of the clouds. the second one can be with opacity (to keep only clouds). I would just put the 2 textures on the earth, with the opacity of the clouds map, to obtain something a little bit realistic. I am new with OSG applications so I am still searching how to do basic things like that... Thanks. 2008/2/25, Robert Osfield [EMAIL PROTECTED]: HI Vincent, Perhaps everybody else like me is a bit confused by what you are actually after. The OSG supports multi-texturing, and shaders, the plugins are all orthogonal to final readering - all in all is most likely what you are trying to do is very straightforward. I can't really glean exactly what the problem might be, perhaps you are just tackling it in an awkward way that is confusing things. Robert. On Mon, Feb 25, 2008 at 8:26 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hello, I will make my own answer : I used osg::Image to obtain the unsigned char* data array, and i use it to melt the two pictures in one. data[n] = osg::maximum(Edata[n], (unsigned char)Cdata[i]); This is not a the solution of the problem, but it can solve it, when no other solution exist. (Be carefull to the depth of the Image) If someone have anther solution, I'll be interested. Thank you. 2008/2/21, Vincent Bourdier [EMAIL PROTECTED]: Hello I am trying to put 2 Texture2D on the same geometry. The backgroud texture is a .jpg file and the foregroud texture is a .png file with opacity (clouds map). If I use them normally, the foregroud texture is in good position, but in place of the transparent's pixels the is only a dark (black) color, and in place of the clouds pixels, I can see the background picture... if I convert .png file in .jpg(without transparency) it does nothing at all. and in .gif it does something strange, with a hight level of opacity (very transparent) and the white color of the clouds is not visible... Is there some picture formats recomendations ? How to manage 2 textures on the same geometry ? (melting them) Thanks ___ 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 ___ 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] Using Particle : how to add particle group to the scenegraph ?
Hi, I'm trying to make a Particle System. It looks easy but I have a little problem : my ModularEmitter, my ParticleSystemUpdater and my geode are on the same group. To have the particles on the viewer, I must add this group as a child of the root group. If I put it child of another group, nothing appear... I that normal ? Is it possible to had my particleSystemGroup as a child of any other group in the scene graph ? Thanks. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using Particle : how to add particle group to the scenegraph ?
Hi, Thank you very much, it works great. To be precise, I've added the Geode with ParticleSystem to the root node, and the ParticleSystemUpdater and the Emitter to the target node, which permit to work in relative coords and to render the particles well. Thanks, Vincent 2008/2/28, J.P. Delport [EMAIL PROTECTED]: Hi, Vincent Bourdier wrote: Hi, I'm trying to make a Particle System. It looks easy but I have a little problem : my ModularEmitter, my ParticleSystemUpdater and my geode are on the same group. To have the particles on the viewer, I must add this group as a child of the root group. If I put it child of another group, nothing appear... I that normal ? It is the current behaviour. If it's normal is another question :) Is it possible to had my particleSystemGroup as a child of any other group in the scene graph ? Yes, but you have to split up the particle system. One part must be connected to the thing that you are moving around and another part must be connected to some static point as far as I remember. Look at the osgparticleeffects example around the line if (handleMovingModels) there is some explanation. I also attach some code that I use when I load a model possibly containing a particle system. The visitor finds the particle system that you can then remove from the loaded model and attach to the root (or where you find appropriate). regards jp ---8--- CViewParticleSystemGeodeFinder psgf = CViewParticleSystemGeodeFinder(); shape-accept(psgf); if (psgf.foundGeode) { mParticleSystemGroup-addChild(psgf.foundGeode); ((osg::Group*)shape)-removeChild(psgf.foundGeode); } ---8--- #include osg/NodeVisitor #include osg/Geode #include osgParticle/ParticleSystem class CViewParticleSystemGeodeFinder : public osg::NodeVisitor { public: CViewParticleSystemGeodeFinder(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), foundGeode(0) {} virtual void apply(osg::Node node) { // if the node is a geode, check if it contains a particle system osg::Geode* geode = dynamic_castosg::Geode*(node); if (geode) { for (unsigned int i=0; igeode-getNumDrawables(); i++) { osgParticle::ParticleSystem *psDrawable = dynamic_castosgParticle::ParticleSystem*(geode-getDrawable(i)); if(psDrawable) { if (!foundGeode) foundGeode = geode; } } } traverse(node); } void reset() {foundGeode = 0;} osg::Geode *foundGeode; }; Thanks. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Complete darkness
Maybe just a setnumlight(0)... to replace default light by yours. Vincent 2008/2/29, Wojciech Lewandowski [EMAIL PROTECTED]: Sounds like default Light Model ambient Look at OpenGL docs for glLightModel GL_LIGHT_MODEL_AMBIENT. Cheers, Wojtek - Original Message - From: Necdet Can Atesman [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Sent: Friday, February 29, 2008 1:10 AM Subject: [osg-users] Complete darkness Hi folks, I am unable to create complete darkness in osg. I'm setting the only light source to not emit anything, but the objects in my scene are still visible, although very faintly. Is there something wrong with the code, or is it just osg/opengl? osg::Light* light = new osg::Light(); light-setAmbient(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f)); light-setDiffuse(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f)); light-setSpecular(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f)); osgView* view = new osg::View(); osgView-setLightingMode(osg::View::HEADLIGHT); view-setLight(light); Thanks, Necdet Can ___ 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] [Fwd: Re: to draw landscapes beginning from a matrix]
Hi Aurora, With his proposition, you can create the color that you need. Setcolor(vec4) uses RGBA (Red, Green, Blue, Alpha) color (if i remember well) so put A to 1.0 (opacity) , and the RGB can be defined using the function he gives to you... you can use it for each component if you want a greyscale color (R=G=B) or only use it on one component... try it and you will see... for greyscale image, you can try : hightcolor = 1.0 lowcolor = 0.0 and then R =(highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; G =(highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; B =(highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; this is just a simple example... Regards, Vincent. 2008/2/29, aurora restivo [EMAIL PROTECTED]: The Sukender ha scritto: Hum... I don't have a global solution, but you may set a color for each vertex with something lile : color = (highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; I apologize but I am still inexperienced. I have a HeightField associated to shapeDrawable (this because if I use Locator and GeometryTechnique I succeed in visualizing the alone ground GEOCENTRIC), therefore if I use shapeDrawable - setColor (Vec4); I don't know whether to plan the values of the Vec4 with the formula that you have sent me besides of what type it is color? Aurora You can allso do it in HSL coordinates (instead of RGB). Sukender Date: Fri, 29 Feb 2008 12:54:48 +0100 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] [Fwd: Re: to draw landscapes beginning from a matrix] Hi! does a way exists to color from the tallest altitude of a ground to the lowest with gradations of color? thanks Aurora ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Votre contact a choisi Hotmail, l'e-mail nouvelle génération. Créez un compte. http://www.windowslive.fr/hotmail/default.asp ___ 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] [Re: to draw landscapes beginning from a matrix]
I've never used a terrainnode so I can't help you on that, but on the ShapeDrawable something look strange on your code : you do a drawable-setcolor on each loop (so 410*296 times) and a the end you add it to the geode so I imagine that only the last loop is used, and it look normal to obtain a single color... Maybe you should create a vec4Array with the same size of your vertex array, and in each element of the Colorarray you put the calculated vector. Last, you make something like : drawable-setVerticeArray(your_vertex_array); drawable-setColorArray(your_color_array); (Maybe your should add normalArray too) I don't know if you understand what it intend to explain, It's a little bit difficult for me to write in english ;) Vincent 2008/3/3, aurora restivo [EMAIL PROTECTED]: Hi! if I use a ShapeDrawable I get a figure with an only color, because draw - setColor (...) it doesn't allow me to color every altitude osg::Geode* geode= new osg::Geode(); osg::ShapeDrawable* draw= new osg::ShapeDrawable(hF); double highColor=1.0; double lowColor=0.2; double R=0.0, G=0.0, B=0.0; for(int i=0; i 410; i++) { for(int j=0; j296 ;j++) { float altitude = hF-getHeight(j,i); R =(highColor - lowColor) * ((altitude - min) / max) + lowColor; G =(highColor - lowColor) * ((altitude - min) / max) + lowColor; B =(highColor - lowColor) * ((altitude - min) / max) + lowColor; draw-setColor(osg::Vec4(R,G,B,1.0)); } } geode-addDrawable(draw); if I draw a TerrainNode with GeometryTechnique and use terrainNode - setColorTransferFunction (0, tf.get()); I get a figure with an only color if I use tf - allocate (1); otherwise, if I use tf - allocate (2); I get a colored figure to two zones, etc... osg::ref_ptrosg::TransferFunction1D tf = new osg::TransferFunction1D; tf-setInputRange(min, max); //minAltitude = 0, maxAltitude = 1400 tf-allocate(1); //ortf-allocate(2); for(int i=0; i 410; i++) { for(int j=0; j296 ;j++) { float altitude = hF-getHeight(j,i); R =(highColor - lowColor) * ((altitude - min) / max) + lowColor; G =(highColor - lowColor) * ((altitude - min) / max) + lowColor; B =(highColor - lowColor) * ((altitude - min) / max) + lowColor; tf-setValue(0, osg::Vec4(R,G,B,1.0)); //tf-setValue(1, osg::Vec4(1.0,0.0,1.0,1.0)); terrainNode-setColorTransferFunction(0, tf.get()); } } how can I color every altitude with different color? I apologize for the trouble Thanks Aurora Vincent Bourdier ha scritto: Hi Aurora, With his proposition, you can create the color that you need. Setcolor(vec4) uses RGBA (Red, Green, Blue, Alpha) color (if i remember well) so put A to 1.0 (opacity) , and the RGB can be defined using the function he gives to you... you can use it for each component if you want a greyscale color (R=G=B) or only use it on one component... try it and you will see... for greyscale image, you can try : hightcolor = 1.0 lowcolor = 0.0 and then R =(highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; G =(highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; B =(highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; this is just a simple example... Regards, Vincent. 2008/2/29, aurora restivo [EMAIL PROTECTED]: The Sukender ha scritto: Hum... I don't have a global solution, but you may set a color for each vertex with something lile : color = (highColor - lowColor) * ((altitude - minAltitude) / maxAltitude) + lowColor; I apologize but I am still inexperienced. I have a HeightField associated to shapeDrawable (this because if I use Locator and GeometryTechnique I succeed in visualizing the alone ground GEOCENTRIC), therefore if I use shapeDrawable - setColor (Vec4); I don't know whether to plan the values of the Vec4 with the formula that you have sent me besides of what type it is color? Aurora You can allso do it in HSL coordinates (instead of RGB). Sukender Date: Fri, 29 Feb 2008 12:54:48 +0100 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] [Fwd: Re: to draw landscapes beginning from a matrix] Hi! does a way exists to color from the tallest altitude of a ground to the lowest with gradations of color? thanks Aurora ___ osg-users mailing list osg-users@lists.openscenegraph.org http
[osg-users] Using NodeMask...
Hi, I am working on a hide/show function, and I've read some examples concerning NodeMask. It looks like a good and easy solution to do that, but I don't understand why it doesn't work on my application : int inheritanceMask = (osg::CullSettings::ALL_VARIABLES ~osg::CullSettings::CULL_MASK); camera-setInheritanceMask(inheritanceMask); camera-setCullMask(0x1); ... earthGroup-setNodeMask(0x1); With this code I hope that the earthGroup will be alone on the view, or the opposite (invisible). Why it doesn't work ? is it the more easy way to make a hide/show function ? Thanks. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using NodeMask...
toggle the earthGroup NodeMask between 0 and 0x. it is not what i done here : ? earthGroup-setNodeMask(0x1); Is my code good concerning the camera ? is it a viewer parameter ? (to set cullMask) I preferer avoid using switch node for the moment, it would add nodes to the graph, and if another solution exist, it would be better... Thanks, Vincent. 2008/3/3, Paul Martz [EMAIL PROTECTED]: Why it doesn't work ? is it the more easy way to make a hide/show function ? A simpler solution would be to toggle the earthGroup NodeMask between 0 and 0x. Another solution would be to use a top-level Switch node. Paul Martz *Skew Matrix Software LLC* http://www.skew-matrix.com 303 859 9466 ___ 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] Using NodeMask...
Hi Art, I've tried something like that : geodeEarth-setNodeMask(0x5); pViewer-getCamera()-setCullMask(0x2); It gives me the result i was waiting for : all is visible, only the earth is not. It isn't possible for me to set all other nodes, because I load the geometries form an IVE file. If the default mask is 0x, I'm surprised that is works well... Thanks, Vincent. 2008/3/3, Art Tevs [EMAIL PROTECTED]: Hi Vincent, haven't you forgot to set all other nodes or at least the sibling nodes to the eartGroup with node mask (0x0). Otherwise the default mask is something like 0x. Hence with your current setup you still will be able to see all the nodes. Cheers, Art --- Vincent Bourdier [EMAIL PROTECTED] schrieb: toggle the earthGroup NodeMask between 0 and 0x. it is not what i done here : ? earthGroup-setNodeMask(0x1); Is my code good concerning the camera ? is it a viewer parameter ? (to set cullMask) I preferer avoid using switch node for the moment, it would add nodes to the graph, and if another solution exist, it would be better... Thanks, Vincent. 2008/3/3, Paul Martz [EMAIL PROTECTED]: Why it doesn't work ? is it the more easy way to make a hide/show function ? A simpler solution would be to toggle the earthGroup NodeMask between 0 and 0x. Another solution would be to use a top-level Switch node. Paul Martz *Skew Matrix Software LLC* http://www.skew-matrix.com 303 859 9466 ___ 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 Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail ___ 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] Camera and light problem
Hi Jon If you add your transform to the camera, it is normal that the light follow the camera.. If you want to keep the light at the same position, you have to attach it near the root node, and attach the rest of the scene a lower levels than it. Each child inherit from its parents, so if you attach a group to a transform, each child of the group (and their children) will follow the group's transformation. Vincent. 2008/3/5, Jon [EMAIL PROTECTED]: Hi all, I have currently a simple model on my scene, and I've added a light to the scene represented by a small sphere. I would like to fix light position and I don't want this one to move with the model (when I move the camera), or to move it independently from the main camera... So I decided to add a camera and to add the light to this one, this didn't solve the problem, both are moving togethers. Following is the main code that creates and place objects. I cannot use normals because I don't have geometry node. I would appreciate some help for this easy problem! Thanks in advance. Jon. { … //_modelGraph group represents the current scene //_root group will contains _modelGraph plus the light //create a group for the light _lightGraph = new osg::Group; … _root-addChild(_modelGraph.get()); //create a camera to install the light osg::ref_ptrosg::Camera camera = new osg::Camera; // just inherit the main cameras view camera-setProjectionMatrix(osg::Matrix::identity()); camera-setViewMatrix(osg::Matrix::identity()); //create the light osg::ref_ptrosg::Light light = new osg::Light; //Set options… //create a lightsource for the light osg::ref_ptrosg::LightSource lightSource = newosg::LightSource; lightSource-setLight(light.get()); lightSource-setLocalStateSetModes(osg::StateAttribute::ON); //create a transformation node that will move the node in the scene osg::ref_ptrosg::MatrixTransform transform = newosg::MatrixTransform; transform-addChild(lightSource.get()); //Position the light osg::Vec3 pos(-5.0f, 10.0f, 0.0f); transform-setMatrix(osg::Matrix::translate(pos)); //Add the transform to the camera camera-addChild(transform.get()); //create a small sphere to represent the lights position osg::ref_ptrosg::Geode geode = new osg::Geode; osg::ref_ptrosg::TessellationHints hints = newosg::TessellationHints; hints-setDetailRatio(0.3); osg::ref_ptrosg::ShapeDrawable shape = new osg::ShapeDrawable(newosg::Sphere(osg::Vec3( 0.0f, 0.0f, 0.0f), 0.6f), hints.get()); shape-setColor(lightColor); geode-addDrawable(shape.get()); transform-addChild(geode.get()); camera-addChild(_lightGraph.get()); // set the camera to render before the main camera (else just the light appears on a black screen) camera-setRenderOrder(osg::Camera::NESTED_RENDER); _root-addChild(camera.get()); } ___ 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] obj normals
Hi , I don't know if an easy way exist, but you can get your normalArray and correct it... but you have to know exactly the vertices number to get normal and invert it... Vincent. 2008/3/7, lorenzo bronzin [EMAIL PROTECTED]: hi robert, loading a wavefront .obj file is there a way to make the plugin consider the normals to be all on the same side/direction/orientation? As far as I understand they are built considering the order the vertexes define a face, so if two adiacent faces are described with clockwise vertexes and counterclockwise vertexs, they'll have opposite normals, and so different shading. Or is there a way to make(as in blender) the object double-sided? ___ 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] osgFX::Cartoon (setOutlineLineWidth)
Hi, I'm using osgFX::Cartoon to obtain an effect on the edges. I want to highlight edges of a node. (geode) I've already tried osgFX::Scribe, but I prefere Cartoon edges because it compute only the necessary edges and not all. So, my problem is when I use Cartoon, I can't set LineWidth. I can put 0.1to 20.0 it doesn't change anything. Is use this code : osg::ref_ptrosgFX::Cartoon c = new osgFX::Cartoon; c-setOutlineColor(osg::Vec4(color.x(), color.y(), color.z(), 1.0f)); c-setOutlineLineWidth(edge_width); c-addChild(copynode); Is there any reason to this problem ? how to solve it ? Thanks. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera and light problem
Hi Jon, If your light is in the model at (0,0,0) it is normal, because in the graph, the position is always relative (depends on the parent node) (if you let it by default). try something like : -ROOT ---lightsource ---tranform --geode In this case light source will be in relative coordinates but in the coordinate system of the root node (it is like being in absolute ) And light will not move with the geode, because it is not in the transform group. Note : if ROOT is not the real root node but juste the root of the scene, try this : -REAL_ROOT --- ... --... --lightsource --ROOT -tranform -geode Hoping this will help you. Vincent. 2008/3/8, Jon [EMAIL PROTECTED]: Thanks Vincent for your answer. I tried to follow your suggestion, but the problem persists. If you look at the code, I have : |_root ---|_modelGraph ---|transform -|lightsource -|geode Any suggestions ? What are my mistakes? My goal is to have a model moving with the camera and a light represented by a sphere that does not move (fixed coord). Just one precision: when I place the light in the scene, the light coordinates depends of the model: ((0,0,0) puts the light inside the model) Could this explain the problem? How can I prevent this? Thanks again. { *//_modelGraph group represents the current scene* *//_root group will contains _modelGraph plus the light* //create the light osg::ref_ptrosg::Light light = new osg::Light; //make the light a point light by setting w to 1.0 light-setPosition(osg::Vec4(-10.0f, -10.0f, 0.0f, 10.0f)); //create a lightsource for the light osg::ref_ptrosg::LightSource lightSource = new osg::LightSource; //create a transformation node that will move the node in the scene osg::ref_ptrosg::MatrixTransform transform = new osg::MatrixTransform; transform-addChild(lightSource.get()); //Position the light osg::Vec3 pos(-5.0f, 10.0f, 0.0f); transform-setMatrix(osg::Matrix::translate(pos)); //create a small sphere to represent the lights position osg::ref_ptrosg::Geode geode = new osg::Geode; osg::ref_ptrosg::TessellationHints hints = new osg::TessellationHints; hints-setDetailRatio(0.3); osg::ref_ptrosg::ShapeDrawable shape = new osg::ShapeDrawable(newosg::Sphere(osg::Vec3( 0.0f, 0.0f, 0.0f), 0.6f), hints.get()); shape-setColor(lightColor); geode-addDrawable(shape.get()); transform-addChild(geode.get()); _root-addChild(transform.get()); //add the model to the light's root group _root-addChild(_modelGraph.get()); } ___ 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] osgFX::Cartoon (setOutlineLineWidth)
Hi, No one have already had this problem ? Thanks. Vincent. 2008/3/7, Vincent Bourdier [EMAIL PROTECTED]: Hi, I'm using osgFX::Cartoon to obtain an effect on the edges. I want to highlight edges of a node. (geode) I've already tried osgFX::Scribe, but I prefere Cartoon edges because it compute only the necessary edges and not all. So, my problem is when I use Cartoon, I can't set LineWidth. I can put 0.1to 20.0 it doesn't change anything. Is use this code : osg::ref_ptrosgFX::Cartoon c = new osgFX::Cartoon; c-setOutlineColor(osg::Vec4(color.x(), color.y(), color.z(), 1.0f)); c-setOutlineLineWidth(edge_width); c-addChild(copynode); Is there any reason to this problem ? how to solve it ? Thanks. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgFX::Cartoon (setOutlineLineWidth)
Hi Nicolas, this is my code : //SCRIBE MODE osg::ref_ptrosgFX::Scribe s = new osgFX::Scribe; s-setWireframeColor(osg::Vec4(color.x(), color.y(), color.z(), 1.0f)); s-setWireframeLineWidth(edge_width);//DO NOTHING ?! s-addChild(copynode); than I attach s to the grpah, and render. (copynode is a geode with a correct geometry) the wireframecolor is good, but the lineWidth ... no. tanks. Vincent. 2008/3/11, nicolas peña [EMAIL PROTECTED]: Hi Vincent, I don't use this feature but if you attach a small example that triggers that behaviour in your machine I would test it on mine (x86_64,Linux 2.6.22 , OSG SVN HEAD). Cheers, Nicolas. 2008/3/11, Vincent Bourdier [EMAIL PROTECTED]: Hi, No one have already had this problem ? Thanks. Vincent. 2008/3/7, Vincent Bourdier [EMAIL PROTECTED]: Hi, I'm using osgFX::Cartoon to obtain an effect on the edges. I want to highlight edges of a node. (geode) I've already tried osgFX::Scribe, but I prefere Cartoon edges because it compute only the necessary edges and not all. So, my problem is when I use Cartoon, I can't set LineWidth. I can put 0.1 to 20.0 it doesn't change anything. Is use this code : osg::ref_ptrosgFX::Cartoon c = new osgFX::Cartoon; c-setOutlineColor(osg::Vec4(color.x(), color.y(), color.z(), 1.0f)); c-setOutlineLineWidth(edge_width); c-addChild(copynode); Is there any reason to this problem ? how to solve it ? Thanks. Vincent. ___ 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] Stopping a particle system after a set number of particles
Hi, I think it doesn't exist yet... (perhaps I make a mistake writing this)... But counting time left before stoping the particlesystem is not very difficult... just make a time difference and switch off your particleSystem (or remove it) from the graph... Vincent. 2008/3/11, Kim C Bale [EMAIL PROTECTED]: Is there a function to stop an osgParticle system from releasing particles after a certain number or particles have been fired or perhaps a certain amount of time has passed without creating a custom class? Leafing through the doc referance I can't seem to find a method that has a similar function. Just wondering as I don't want to start coding one up if it's already there. Cheers, Kim. * To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html * ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgFX::Cartoon (setOutlineLineWidth)
Thanks for testing :) I'll see what it can be, if it depends on drivers or not... Than you very much Regards, Vincent. 2008/3/11, nicolas peña [EMAIL PROTECTED]: Hi, It works fine on my configuration, so it does not look as a code problem nor an OSG bug. Of course I did change edge_width and color.x/y/z for a float numbers but apart from that I used the same code. Are you sure edge_width is set to the value you want? If yes may be the is a bug in the OpenGL driver or something. Hope it helps. Cheers, Nicolas. 2008/3/11, Vincent Bourdier [EMAIL PROTECTED]: Hi Nicolas, this is my code : //SCRIBE MODE osg::ref_ptrosgFX::Scribe s = new osgFX::Scribe; s-setWireframeColor(osg::Vec4(color.x(), color.y(), color.z(), 1.0f)); s-setWireframeLineWidth(edge_width);//DO NOTHING ?! s-addChild(copynode); than I attach s to the grpah, and render. (copynode is a geode with a correct geometry) the wireframecolor is good, but the lineWidth ... no. tanks. Vincent. 2008/3/11, nicolas peña [EMAIL PROTECTED]: Hi Vincent, I don't use this feature but if you attach a small example that triggers that behaviour in your machine I would test it on mine (x86_64,Linux 2.6.22 , OSG SVN HEAD). Cheers, Nicolas. 2008/3/11, Vincent Bourdier [EMAIL PROTECTED]: Hi, No one have already had this problem ? Thanks. Vincent. 2008/3/7, Vincent Bourdier [EMAIL PROTECTED]: Hi, I'm using osgFX::Cartoon to obtain an effect on the edges. I want to highlight edges of a node. (geode) I've already tried osgFX::Scribe, but I prefere Cartoon edges because it compute only the necessary edges and not all. So, my problem is when I use Cartoon, I can't set LineWidth. I can put 0.1 to 20.0 it doesn't change anything. Is use this code : osg::ref_ptrosgFX::Cartoon c = new osgFX::Cartoon; c-setOutlineColor(osg::Vec4(color.x(), color.y(), color.z(), 1.0f )); c-setOutlineLineWidth(edge_width); c-addChild(copynode); Is there any reason to this problem ? how to solve it ? Thanks. Vincent. ___ 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 ___ 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] Render a node through the other
Hi, I work on complex models, and I use the osgFX to put in relief some nodes. However, I am asking myself if it is possible to render a node through the others ... ? What I would like to obtain, is to see a node (geode) in relief (with osgFX) through the hole model (and so through the other geode). Is it possible with some OSG function ? or it is just impossible ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Assertion failure - using removeChild
Hi, Have you checked all the variables ? I have encountered the problem because my Node was not good... sometimes you get an error but it is another bug in your code... Try to verify each variable (in debug mode for example (step-by-step)) and you'll find your problem. I don't think it is an OSG problem... Regards, Vincent. 2008/3/13, Renan Mendes [EMAIL PROTECTED]: Hi, everyone. I wrote the following code: case(osgGA::GUIEventAdapter::KEYDOWN): { if(ea.getKey() == ea.KEY_Delete) { if(!vprim.empty()) { vprim_itr = vprim.begin(); while(vprim_itr != vprim.end()) { if((*vprim_itr)-checkSelection()) // No problems in this line { // HERE'S WHERE THE PROBLEM IS root-removeChild(root-getChildIndex((*vprim_itr)), 1); vprim_itr = vprim.erase(vprim_itr); } else { vprim_itr++; } } } } } where vprim is a STL vector and vprim_itr its iterator. When using the combination of the two lines below the commentary in capitals, I get an assertion failure that says: 'vector iterator not deferencable'. I don't know if removeChild() has any particular property that would mess things up, or if its just some subtle memory management aspect that I forgot to consider... I would really appreciate if someone could give me an idea of what's happening. Thanks. Renan M Z Mendes ___ 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] Matrixf and Quat problem
Hi, I am trying for hours to make a rotation with two vectors... The code is : osg::Matrixf MR = osg::Matrixf::identity();//matrix rotation MR.rotate(angle*osg::PI/180.0, _NodeTranslation^_NodeTranslationStart); osg::Quat qrotation = osg::Quat(); qrotation.set(MR); _rotation *= qrotation; coutRot : qrotation.x() qrotation.y() qrotation.z() qrotation.w()endl; And in the console, the result is : Rot : 0 0 0 1 Rot : 0 0 0 1 Rot : 0 0 0 1 ... I've checked 'angle' and it is a good value, always increasing... Is there any problem in my code ? Why the Quat doesn't change... ? Thanks, regard, Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Matrixf and Quat problem
Hi, You're right !! cross product is null ... I don't know why but now I know where is the problem. Thanks :) Vincent. 2008/3/13, Vican, Justin E. [EMAIL PROTECTED]: What are the values of _NodeTranslation and_NodeTranslationStart? If that cross product returns a zero vector (0,0,0), a NULL rotation will be computed. *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* Thursday, March 13, 2008 12:55 PM *To:* osg *Subject:* [osg-users] Matrixf and Quat problem Hi, I am trying for hours to make a rotation with two vectors... The code is : osg::Matrixf MR = osg::Matrixf::identity();//matrix rotation MR.rotate(angle*osg::PI/180.0, _NodeTranslation^_NodeTranslationStart); osg::Quat qrotation = osg::Quat(); qrotation.set(MR); _rotation *= qrotation; coutRot : qrotation.x() qrotation.y() qrotation.z() qrotation.w()endl; And in the console, the result is : Rot : 0 0 0 1 Rot : 0 0 0 1 Rot : 0 0 0 1 ... I've checked 'angle' and it is a good value, always increasing... Is there any problem in my code ? Why the Quat doesn't change... ? Thanks, regard, Vincent ___ 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] PositionAttitudeTransform question
Hi, I'm not sure to understand you problem... First of all, if you make a setScale(1,1,1) it is normal that nothing changes... After, your problem is not clear... you use a PAT for moving and scaling... and you scale the object separately ? Please be more precise... what does your scenegraph looks like ? Vincent. 2008/3/14, [EMAIL PROTECTED] [EMAIL PROTECTED]: I have a geode that I have added as a child to a osg::PositionAttitudeTransform. If I call setPosition (x,y,z), it seems to work OK. If I then call setScale with (1.,1.,1.) as arguments, it doesn't change as expected. But, if I change the scale values to something other than one, in addition to scaling the object, it also moves it. How do I separate the two so that setScale only scales after a translation, not move it to? ___ 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] Matrixf and Quat problem
I've located my problem, and this time I don't know why it doesn't change anything... osg::Matrixf MR = osg::Matrixf::identity(); MR.rotate(angle*osg::PI/180.0, rotaxis); note : rotaxis : 0.03, 0.006, -0.99 angle = 19.78 result : MR = identity... Is it me who make mistakes ? or there is a real problem ? Thanks, Vincent 2008/3/14, Vincent Bourdier [EMAIL PROTECTED]: Hi, You're right !! cross product is null ... I don't know why but now I know where is the problem. Thanks :) Vincent. 2008/3/13, Vican, Justin E. [EMAIL PROTECTED]: What are the values of _NodeTranslation and_NodeTranslationStart? If that cross product returns a zero vector (0,0,0), a NULL rotation will be computed. *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* Thursday, March 13, 2008 12:55 PM *To:* osg *Subject:* [osg-users] Matrixf and Quat problem Hi, I am trying for hours to make a rotation with two vectors... The code is : osg::Matrixf MR = osg::Matrixf::identity();//matrix rotation MR.rotate(angle*osg::PI/180.0, _NodeTranslation^_NodeTranslationStart); osg::Quat qrotation = osg::Quat(); qrotation.set(MR); _rotation *= qrotation; coutRot : qrotation.x() qrotation.y() qrotation.z() qrotation.w()endl; And in the console, the result is : Rot : 0 0 0 1 Rot : 0 0 0 1 Rot : 0 0 0 1 ... I've checked 'angle' and it is a good value, always increasing... Is there any problem in my code ? Why the Quat doesn't change... ? Thanks, regard, Vincent ___ 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] Matrixf and Quat problem
Yes !!! thank you very much :-) Vincent. 2008/3/14, Ralph Kern [EMAIL PROTECTED]: Vincent Bourdier schrieb: I've located my problem, and this time I don't know why it doesn't change anything... osg::Matrixf MR = osg::Matrixf::identity(); MR.rotate(angle*osg::PI/180.0, rotaxis); rotate is a static member which gives the rotation matrix as a result. Either use MR = osg::Matrixf::rotate( ... ) or use MR.makeRotate(...) regards Ralph ___ 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] Quat normalization
Hi all, I just have a little question, because I'm not sure of something about quat : I have to quat q1 and q2 To pass form q1 to q2 I've made q = q1.inverse()*q2 But even if the result angle looks correct... the vector or rotation looks very little : vec : 2.71051e-020, -2.71051e-020, 1.0842e-019 Sometimes it is 0 0 0... Do I have to get the vector, normalize it and set it to the quat ? or is the vector lenght important ? thanks, regards, Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quat normalization
Hi First, yes it is the vector OF rotation, sorry for the mistake... And when I speak about normalizing, I'm just thinking of making a vector.normalize()... with that operation, length of the vector will be 1, even if the vector is close to 0 0 0... I just want to use this vector to set the rotation vector of the Quat... To be more clear : I have a Quat with a rotation vector which is very very little... I ask if normalizing this vector will make a difference ? and why ? Thanks, Regards, Vincent 2008/3/19, J.P. Delport [EMAIL PROTECTED]: Hi, I'd like to help, but don't know what you are asking... Vincent Bourdier wrote: Hi all, I just have a little question, because I'm not sure of something about quat : I have to quat q1 and q2 To pass form q1 to q2 I've made q = q1.inverse()*q2 But even if the result angle looks correct... the vector or rotation looks very little : Is this vector _of_ rotation? Where is this vector coming from? vec : 2.71051e-020, -2.71051e-020, 1.0842e-019 Sometimes it is 0 0 0... Do I have to get the vector, normalize it and set it to the quat ? or is the vector lenght important ? Normalising 0 0 0 (or something close to it) is bound to give you headaches. What do you want to use the vector for? Please provide more context. jp thanks, regards, Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quat normalization
Thanks a lot, I'll try to normailize it, because epsilon is not very little in my application, so this could make zero-rotation Thanks :) Vincent. 2008/3/19, J.P. Delport [EMAIL PROTECTED]: Hi, the code from makeRotate explains it best: --8-- void Quat::makeRotate( value_type angle, value_type x, value_type y, value_type z ) { const value_type epsilon = 0.001; value_type length = sqrt( x*x + y*y + z*z ); if (length epsilon) { // ~zero length axis, so reset rotation to zero. *this = Quat(); return; } value_type inversenorm = 1.0/length; value_type coshalfangle = cos( 0.5*angle ); value_type sinhalfangle = sin( 0.5*angle ); _v[0] = x * sinhalfangle * inversenorm; _v[1] = y * sinhalfangle * inversenorm; _v[2] = z * sinhalfangle * inversenorm; _v[3] = coshalfangle; } --8-- You can see that the length of the vector you use for rotation is already accounted for, i.e. normalising the vector would not change anything. The only exception is for very small vectors, if length epsilon you will get a zero rotation. If you think your vector with length epsilon is a valid rotation vector, then normalising it before calling makeRotate could make a difference. I'd normally associate such a small rotation vector, if it is coming from other code, to indicate a zero rotation anyways, but I don't know your application. regards jp Vincent Bourdier wrote: Hi First, yes it is the vector OF rotation, sorry for the mistake... And when I speak about normalizing, I'm just thinking of making a vector.normalize()... with that operation, length of the vector will be 1, even if the vector is close to 0 0 0... I just want to use this vector to set the rotation vector of the Quat... To be more clear : I have a Quat with a rotation vector which is very very little... I ask if normalizing this vector will make a difference ? and why ? Thanks, Regards, Vincent 2008/3/19, J.P. Delport [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi, I'd like to help, but don't know what you are asking... Vincent Bourdier wrote: Hi all, I just have a little question, because I'm not sure of something about quat : I have to quat q1 and q2 To pass form q1 to q2 I've made q = q1.inverse()*q2 But even if the result angle looks correct... the vector or rotation looks very little : Is this vector _of_ rotation? Where is this vector coming from? vec : 2.71051e-020, -2.71051e-020, 1.0842e-019 Sometimes it is 0 0 0... Do I have to get the vector, normalize it and set it to the quat ? or is the vector lenght important ? Normalising 0 0 0 (or something close to it) is bound to give you headaches. What do you want to use the vector for? Please provide more context. jp thanks, regards, Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users
Re: [osg-users] Resetting particle systems
Hi, I don't understand why you want to destroy the particle... A particle System works great without killing particle manually... what do you expect from it ? Vincent. 2008/3/20, Serge Lages [EMAIL PROTECTED]: Hi, The best way I found is : for (int i = 0; i _emitter-getParticleSystem()-numParticles(); i++) { _emitter-getParticleSystem()-destroyParticle(i); } Yeah, it's a bit tricky, but it works... :) On Thu, Mar 20, 2008 at 9:12 AM, Wiedemann, Rudolf, OPS3 [EMAIL PROTECTED] wrote: Hi, how can I reset a particle system, so when rendering the next frame no old particles exist any more, but only new particles are emitted? Thanks in advance! Rudi ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Serge Lages http://www.tharsis-software.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
[osg-users] Get Parent as Transform in Absolute ?
Hi all, I'm trying to get a node's parent as Transform (PAT or MatrixTransform) but I have to get the transformation in ABSOLUTE_RF... For the moment, I've done a recursive method to get Parent as Transform. It return me the first parent as Tranform it encounter. I've tried this : osg::ref_ptrosg::MatrixTransform tmp_pt = new osg::MatrixTransform; tmp_pt-setReferenceFrame(osg::Transform::ABSOLUTE_RF); tmp_pt-setMatrix(p_mt-getMatrix()); (where p_mt is my RELATIVE MatrixTransform) But the method return to me a MatrixTransform in RELATIVE. It is possible to get the Matrix in Absolute ? without traverse all the scenegraph ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Matrix Quat precision
Hi Robert, For the moment I use a relative calculation (I compute on each frame depending on the last frame's position). I suppose that computing in absolute mode could be better... but I would be more difficult to implement. Thanks Robert, I'll will try this if I have some time... One more question : If there any conversion between Quat and Matrix, or Quat and Vector, or Vector and Matrix which can not be precise ? I mean some conversion function to avoid for example in the goal of beeing always precise ? Regards, Vincent 2008/3/27, Robert Osfield [EMAIL PROTECTED]: Hi Vincet, Even with doubles there are still precisions issue, just much smaller than with floats. If you are using a iterative calculation then if you aren't care the errors could accumulate until their become visable. The best thing to do is to avoid an iterative calculation and calculate the new camera position based on the position of the node in the scene on each frame. Robert. On Thu, Mar 27, 2008 at 8:38 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I'm currently making a new Manipulator inherited from MatrixManipulator. The specificity is : On the call of a function, the manipulator (camera) have to follow a node which is moving. I mean that the camera have to be exactly immobile relative to the moving node. For that i've used Matrix, Vec3 and Quat. All looks great, but after 10 minutes of running, I can see that a little moving difference between the node and the camera... if the node rotate about 2 or 3 axis, the difference is more important... Using Vec3d, Quat and Matrixd, is there any reason for this lack of precision ? Or is it my method which is not good... ? Thanks. Regards, Vincent. ___ 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] Matrix Quat precision
Yes I know that I currently accumulate error, but when I did it I was thinking about a zero-error so it wasn't a problem... The NodeTrackerManipulator does it, yes, but I'm working on a manipulator still existing in the project, and make a whole new manipulator looks a lot of work and I don't have enough time to do it... Maybe in the future... Thanks for the help :-) Regards, Vincent. 2008/3/27, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, You approach is iterative so the errors will accumulate, so it's based to avoid this and go fetch the world matrices from the node your tracking each frame. The osgGA::NodeTrackerManipulator does this. Robert. On Thu, Mar 27, 2008 at 8:57 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert, For the moment I use a relative calculation (I compute on each frame depending on the last frame's position). I suppose that computing in absolute mode could be better... but I would be more difficult to implement. Thanks Robert, I'll will try this if I have some time... One more question : If there any conversion between Quat and Matrix, or Quat and Vector, or Vector and Matrix which can not be precise ? I mean some conversion function to avoid for example in the goal of beeing always precise ? Regards, Vincent 2008/3/27, Robert Osfield [EMAIL PROTECTED]: Hi Vincet, Even with doubles there are still precisions issue, just much smaller than with floats. If you are using a iterative calculation then if you aren't care the errors could accumulate until their become visable. The best thing to do is to avoid an iterative calculation and calculate the new camera position based on the position of the node in the scene on each frame. Robert. On Thu, Mar 27, 2008 at 8:38 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I'm currently making a new Manipulator inherited from MatrixManipulator. The specificity is : On the call of a function, the manipulator (camera) have to follow a node which is moving. I mean that the camera have to be exactly immobile relative to the moving node. For that i've used Matrix, Vec3 and Quat. All looks great, but after 10 minutes of running, I can see that a little moving difference between the node and the camera... if the node rotate about 2 or 3 axis, the difference is more important... Using Vec3d, Quat and Matrixd, is there any reason for this lack of precision ? Or is it my method which is not good... ? Thanks. Regards, Vincent. ___ 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 ___ 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] Get Parent as Transform in Absolute ?
Hi all, I make a little up of this topic because I'm now looking on it a last time (I hope) To be more clear, I have a difference between getting the transform quat with theses two way : osg::MatrixList ml = _node-getWorldMatrices(); osg::Matrixd Msum = osg::Matrixd::identity(); for(unsigned int i = 0; i ml.size() ; i++) { Msum *= ml[i]; } quat = Msum.getRotate(); osg::PositionAttitudeTransform* pat = dynamic_castosg::PositionAttitudeTransform*(_node.get()); quat = pat-getAttitude(); Do you know why I don't have the same result ? Thanks Vincent. 2008/3/21, Vincent Bourdier [EMAIL PROTECTED]: Hi, So I've made some tests and now I have some questions about the differences between two methods to get tranformations on one node. Is the node is a Transform or not, I use two different method to get transformations. In the first method, I get directly the MatrixTransform node, so I can get directly the matrix, convert it to Quat and continue... In the second method, I get a node, so I make a getWorldMatrices, and make a product between all the Matrix of the MatrixList... If I test on a node, which parent is a MatrixTransform, it doesn't return the same result with the two method (with the MatrixTranform as argument for the first method and the child of the MatrixTransform as argument of the second method) Is there any explanation for this difference ? Thanks. Regard, Vincent. 2008/3/21, Vincent Bourdier [EMAIL PROTECTED]: Hi Robert, sorry I'm not always very ... understandable, when I try to explain something. I've already tried getWorldMatrices() few days ago, but the result was very different with using one PAT or MT Quat/Matrix... That's why I'm asking if getting the PAT/MT accumulation Quat/Matrices is easy... or not. But if it getWorldMatrices() is the only solution, I'll will try again. Thanks. Vincent. 2008/3/21, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, I'm a bit confused about what you are trying to do, is it just get the accumulated world matrix at a specific node? If so then node::getWorldMatrices() is what you want. This will return a MatrixList, which will contain none, one or many matrices given that any node many have none or many parental paths containing transforms. Robert. On Fri, Mar 21, 2008 at 11:03 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I'm trying to get a node's parent as Transform (PAT or MatrixTransform) but I have to get the transformation in ABSOLUTE_RF... For the moment, I've done a recursive method to get Parent as Transform. It return me the first parent as Tranform it encounter. I've tried this : osg::ref_ptrosg::MatrixTransform tmp_pt = new osg::MatrixTransform; tmp_pt-setReferenceFrame(osg::Transform::ABSOLUTE_RF); tmp_pt-setMatrix(p_mt-getMatrix()); (where p_mt is my RELATIVE MatrixTransform) But the method return to me a MatrixTransform in RELATIVE. It is possible to get the Matrix in Absolute ? without traverse all the scenegraph ? Thanks. Regards, Vincent. ___ 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] Get Parent as Transform in Absolute ?
Hi Robert, If I understand well, getWorldMatrices() return one matrix per parental path. but if I want to get the world Matrix, the one which represent the node's position and translation in absolute system, how can I do ? Which matrix I have to get ? I feel a little bit lost in theses matrices Thanks. Regards, Vincent. 2008/3/27, Robert Osfield [EMAIL PROTECTED]: HI Vincent, The getWorldMatrices() method returns accumulated world matrices, if there is more than one then it means you have multiple parental paths and that multiple world matrices are required to position the different instances. The getWorldMatrices() is not a list of matrices along a parent path and is not something you accumulate that you have done. I hope you grasp the difference as its hard explaining it without pen and paper. The key is you don't need to accumulate the matrices are completed, just use them directly. Robert. On Thu, Mar 27, 2008 at 1:53 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I make a little up of this topic because I'm now looking on it a last time (I hope) To be more clear, I have a difference between getting the transform quat with theses two way : osg::MatrixList ml = _node-getWorldMatrices(); osg::Matrixd Msum = osg::Matrixd::identity(); for(unsigned int i = 0; i ml.size() ; i++) { Msum *= ml[i]; } quat = Msum.getRotate(); osg::PositionAttitudeTransform* pat = dynamic_castosg::PositionAttitudeTransform*(_node.get()); quat = pat-getAttitude(); Do you know why I don't have the same result ? Thanks Vincent. 2008/3/21, Vincent Bourdier [EMAIL PROTECTED]: Hi, So I've made some tests and now I have some questions about the differences between two methods to get tranformations on one node. Is the node is a Transform or not, I use two different method to get transformations. In the first method, I get directly the MatrixTransform node, so I can get directly the matrix, convert it to Quat and continue... In the second method, I get a node, so I make a getWorldMatrices, and make a product between all the Matrix of the MatrixList... If I test on a node, which parent is a MatrixTransform, it doesn't return the same result with the two method (with the MatrixTranform as argument for the first method and the child of the MatrixTransform as argument of the second method) Is there any explanation for this difference ? Thanks. Regard, Vincent. 2008/3/21, Vincent Bourdier [EMAIL PROTECTED]: Hi Robert, sorry I'm not always very ... understandable, when I try to explain something. I've already tried getWorldMatrices() few days ago, but the result was very different with using one PAT or MT Quat/Matrix... That's why I'm asking if getting the PAT/MT accumulation Quat/Matrices is easy... or not. But if it getWorldMatrices() is the only solution, I'll will try again. Thanks. Vincent. 2008/3/21, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, I'm a bit confused about what you are trying to do, is it just get the accumulated world matrix at a specific node? If so then node::getWorldMatrices() is what you want. This will return a MatrixList, which will contain none, one or many matrices given that any node many have none or many parental paths containing transforms. Robert. On Fri, Mar 21, 2008 at 11:03 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I'm trying to get a node's parent as Transform (PAT or MatrixTransform) but I have to get the transformation in ABSOLUTE_RF... For the moment, I've done a recursive method to get Parent as Transform. It return me the first parent as Tranform it encounter. I've tried this : osg::ref_ptrosg::MatrixTransform tmp_pt = new osg::MatrixTransform; tmp_pt-setReferenceFrame(osg::Transform::ABSOLUTE_RF); tmp_pt-setMatrix(p_mt-getMatrix()); (where p_mt is my RELATIVE MatrixTransform) But the method return to me a MatrixTransform in RELATIVE. It is possible to get the Matrix in Absolute ? without traverse all the scenegraph ? Thanks. Regards, Vincent. ___ 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
Re: [osg-users] Get Parent as Transform in Absolute ?
Hi Alberto Thanks for help, I understand the instance problem... If all is good in my situation I would not have many instances of the same node... so I think it will be more simple... Because my problem is more recent, I ask a second question : To get this node's position (absolute ), if I understand well I must use something like : http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraControlFindingWorldCoordinates There is no other way ? Thanks, Regards. vincent. 2008/3/27, Alberto Luaces [EMAIL PROTECTED]: El Jueves 27 Marzo 2008ES 15:24:48 Vincent Bourdier escribió: but if I want to get the world Matrix, the one which represent the node's position and translation in absolute system, how can I do ? Which matrix I have to get ? If you have several wold matrices, it means that you have instantiated a node several times. Only you know in what instance you are interested. Think about the four wheels of a car, there are 4 instances of the same node, the wheel mesh. ___ 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] Get Parent as Transform in Absolute ?
In your example you are using getWorldMatrices. I know this function, thanks... I and Robert were talking about it. But what I simply need is : with a node, I need its position (absolute/world coordinates), and its orientation (in the world system coordinates). How can I do it ? (Sorry, I'm not very understandable...) Thanks, Regard. Vincent. 2008/3/27, Alberto Luaces [EMAIL PROTECTED]: Sorry, I don't get what you exactly are looking for. Would this example help? It calculates the position of a node in world coordinates: #include osg/Node #include osg/Group #include osg/Matrix #include osg/MatrixTransform #include iostream int main() { osg::Group *root; osg::Node *n; osg::MatrixTransform *m1, *m2; root = new osg::Group; n = new osg::Node; m1 = new osg::MatrixTransform( osg::Matrix::translate(osg::Vec3 (0.0,10.0,0.0))); m2 = new osg::MatrixTransform( osg::Matrix::translate(osg::Vec3 (10.0,10.0,-5.0))); // root-m1-m2-n root-addChild(m1); m1-addChild(m2); m2-addChild(n); osg::MatrixList ml = n-getWorldMatrices(); for(int i=0; i4; i++) { for(int j=0; j4; j++) { std::cout ml[0](j,i) \t; } std::cout \n; } return 0; } El Jueves 27 Marzo 2008ES 16:24:47 Vincent Bourdier escribió: Hi Alberto Thanks for help, I understand the instance problem... If all is good in my situation I would not have many instances of the same node... so I think it will be more simple... Because my problem is more recent, I ask a second question : To get this node's position (absolute ), if I understand well I must use something like http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraCon trolFindingWorldCoordinates There is no other way ? Thanks, Regards. vincent. 2008/3/27, Alberto Luaces [EMAIL PROTECTED]: El Jueves 27 Marzo 2008ES 15:24:48 Vincent Bourdier escribió: but if I want to get the world Matrix, the one which represent the node's position and translation in absolute system, how can I do ? Which matrix I have to get ? If you have several wold matrices, it means that you have instantiated a node several times. Only you know in what instance you are interested. Think about the four wheels of a car, there are 4 instances of the same node, the wheel mesh. ___ 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] Get Parent as Transform in Absolute ?
Its ok, I've made some test and I understand how it works now... thanks for the help. I've another question, a similar one but I think I can ask it here : If my node is a PAT i do quat = pat-getAttitude(); if my node is a MatrixTransform i do quat = mt-getMatrix().getRotate(); But in the second case, it looks doing nothing... Where is the difference ? Thanks. Regards, Vincent 2008/3/27, Alberto Luaces [EMAIL PROTECTED]: Sorry if I don't understand you again, but my program is giving you the absolute position of the node (the fourth column of the matrix, (10,20,-5)) and its world orientation ( the first 3x3 block, equal to identity since the two transforms were translation ones). Try changing m1 and m2 to see the changes in the global position and orientation. El Jueves 27 Marzo 2008ES 17:31:51 Vincent Bourdier escribió: In your example you are using getWorldMatrices. I know this function, thanks... I and Robert were talking about it. But what I simply need is : with a node, I need its position (absolute/world coordinates), and its orientation (in the world system coordinates). How can I do it ? (Sorry, I'm not very understandable...) Thanks, Regard. Vincent. 2008/3/27, Alberto Luaces [EMAIL PROTECTED]: Sorry, I don't get what you exactly are looking for. Would this example help? It calculates the position of a node in world coordinates: #include osg/Node #include osg/Group #include osg/Matrix #include osg/MatrixTransform #include iostream int main() { osg::Group *root; osg::Node *n; osg::MatrixTransform *m1, *m2; root = new osg::Group; n = new osg::Node; m1 = new osg::MatrixTransform( osg::Matrix::translate(osg::Vec3 (0.0,10.0,0.0))); m2 = new osg::MatrixTransform( osg::Matrix::translate(osg::Vec3 (10.0,10.0,-5.0))); // root-m1-m2-n root-addChild(m1); m1-addChild(m2); m2-addChild(n); osg::MatrixList ml = n-getWorldMatrices(); for(int i=0; i4; i++) { for(int j=0; j4; j++) { std::cout ml[0](j,i) \t; } std::cout \n; } return 0; } El Jueves 27 Marzo 2008ES 16:24:47 Vincent Bourdier escribió: Hi Alberto Thanks for help, I understand the instance problem... If all is good in my situation I would not have many instances of the same node... so I think it will be more simple... Because my problem is more recent, I ask a second question : To get this node's position (absolute ), if I understand well I must use something like http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraC on trolFindingWorldCoordinates There is no other way ? Thanks, Regards. vincent. 2008/3/27, Alberto Luaces [EMAIL PROTECTED]: El Jueves 27 Marzo 2008ES 15:24:48 Vincent Bourdier escribió: but if I want to get the world Matrix, the one which represent the node's position and translation in absolute system, how can I do ? Which matrix I have to get ? If you have several wold matrices, it means that you have instantiated a node several times. Only you know in what instance you are interested. Think about the four wheels of a car, there are 4 instances of the same node, the wheel mesh. ___ 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] MatrixTransform and PAT rotation difference.
Hi, I make a new topic I think it is more clear I'm looking on getting absolute rotation from a osg::Transform If my node is a PAT i do quat = pat-getAttitude(); if my node is a MatrixTransform i do quat = mt-getMatrix().getRotate(); But in the second case, it looks doing nothing... Where is the difference ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with the debug version of OSG25-OSGVIEWERD.DLL and visual studio 2008
Hi, osg25-osgviewerD.dll : debug version... osg25-osgviewer.dll : release version... maybe you have to put the configuration of your visual project in debug mode... Regards, Vincent. 2008/3/31, Sébastien Champmartin [EMAIL PROTECTED]: Hi ! When i execute the program visual studio says to me that the application did not manage to reset correctly (it compiles correctly) and dependency walker says : Error: The Side-by-Side configuration information for c:\windows \system32\OSG25-OSGVIEWERD.DLL contains errors, this application couldn't start because the application configuration is not correct... Same thing for OSG25-OSGTEXTD.DLL and OT9-OPENTHREADSD.DLL. how can i find anoter version of these DLLs if it fixes the problem ? otherwise what can i do ? -- Plus de 15 millions de français utilisent Windows Live Messenger ! Téléchargez Messenger, c'est gratuit ! http://www.windowslive.fr/messenger/ ___ 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] Pick multiple node
Hi all, For my application, I use the picking. but there is something strange : When I pick a node (geode) I get a list of node path... so all is good... but in the list, the same nodepath can appear more that one time, sometimes two, sometimes four... Is there any reason for that ? Or what can make this result ? Thanks, Regards. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Pick multiple node
Hi Robert, Thanks very much I understand well why I have these results. I'll see how I can manage it. Thanks a lot. Regards, Vincent. 2008/4/1, Robert Osfield [EMAIL PROTECTED]: HI Vincent, The osgUtil::IntersectionVisitor will return multiple Intersection objects if there are multiple intersections with a geometry. For instance when a ray goes through a box it'll produce two hits, if it goes through a plane it'll produce one. There are exceptions that do to numerical precision it'll return two hits for a plane when the ray hits the edge between two triangles. If you just want high level hit info such as what objects have been hit rather than low level where exactly are the intersection points then just pick the nearest intersection, or sort the results so that you only have on intersection per separate object. It's worth remembering that the OSG IntersectionVisitor is a general purpose utility class so has to provide a the full spectrum of results rather than prefiltering it. Robert. On Tue, Apr 1, 2008 at 9:31 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, For my application, I use the picking. but there is something strange : When I pick a node (geode) I get a list of node path... so all is good... but in the list, the same nodepath can appear more that one time, sometimes two, sometimes four... Is there any reason for that ? Or what can make this result ? Thanks, Regards. Vincent. ___ 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
[osg-users] MatrixManipulator and Callback
Hi all, I'm trying to put a callback on my manipulator, inherited from MatrixManipulator. but a the line : myManipulator-setUpdateCallback(...) I got a error of compilation : error C2039: 'setUpdateCallback' : is not member of 'MyManipulator' I don't understand why I cannot set my callback on my manipulator... Thanks for your help, Regards. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] MatrixManipulator and Callback
Hi Robert, I don't understand why and how overriding handle() method can help ? thanks. Regards, Vincent. 2008/4/2, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, A MatrixManipulator isn't a class that has a setUpdateCallback(), its not a node, drawable and state attribute, its just an form of event handler, which itself is a form of callback. Now you can override the handle(..) method if you wish... Robert. On Wed, Apr 2, 2008 at 4:08 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I'm trying to put a callback on my manipulator, inherited from MatrixManipulator. but a the line : myManipulator-setUpdateCallback(...) I got a error of compilation : error C2039: 'setUpdateCallback' : is not member of 'MyManipulator' I don't understand why I cannot set my callback on my manipulator... Thanks for your help, Regards. Vincent. ___ 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] MatrixManipulator and Callback
Ok, Thanks, the Handle method is already implemented, and it is a particular situation, so I'll try an other way... Thank you very much. Vincent. 2008/4/2, Robert Osfield [EMAIL PROTECTED]: On Wed, Apr 2, 2008 at 5:03 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert, I don't understand why and how overriding handle() method can help ? The MatrixManipulator is effectively just a callback for catching events, you implement the callback by subclassing from handle(..). Go have a look at all the examples of event handlers in osgGA and osgViewer and the examples. 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] Callback multiple
Hi all, I have made some NodeCallback. for the moment, 2 NodeCallback are running at the same time... they use the osg::Timer.. But when I've added the second one, the first seems to do nothing... Is there any recommendation to add some Callbacks on the same scenegraph ? Thanks. Regard. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Callback multiple
Hi Robert, Thanks a lot, it works very great with the ad of traverse(...) method !! Sorry I didn't found it early. Regards. Vincent. 2008/4/7, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, Callbacks are responsible for traversing the subgraph so you need to call traverse on the node, or use the NodeCallback::traverse method. See other examples of NodeCallbacks in the OSG to see this in action. Robert. On Mon, Apr 7, 2008 at 3:18 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, I have made some NodeCallback. for the moment, 2 NodeCallback are running at the same time... they use the osg::Timer.. But when I've added the second one, the first seems to do nothing... Is there any recommendation to add some Callbacks on the same scenegraph ? Thanks. Regard. Vincent. ___ 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
[osg-users] Glenum pixelFormat
Hi All, I'm trying to make a osg::Image, but in allocateImage(...) and setImage(...) I need : Pixel format, Internal texture format, AllocationMode... But I didn't find any possible values ?! Where can I find it ? thanks Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Glenum pixelFormat
Thanks Guy I've looked at gl.h too to find that. Thanks a lot. Regard. Vincent. 2008/4/8, Guy [EMAIL PROTECTED]: Here is what I've found in gl.h: /* PixelFormat */ #define GL_COLOR_INDEX0x1900 #define GL_STENCIL_INDEX 0x1901 #define GL_DEPTH_COMPONENT0x1902 #define GL_RED0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_RGB0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA0x190A /* texture */ #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA120x803D #define GL_ALPHA160x803E #define GL_LUMINANCE4 0x803F #define GL_LUMINANCE8 0x8040 #define GL_LUMINANCE120x8041 #define GL_LUMINANCE160x8042 #define GL_LUMINANCE4_ALPHA4 0x8043 #define GL_LUMINANCE6_ALPHA2 0x8044 #define GL_LUMINANCE8_ALPHA8 0x8045 #define GL_LUMINANCE12_ALPHA4 0x8046 #define GL_LUMINANCE12_ALPHA120x8047 #define GL_LUMINANCE16_ALPHA160x8048 #define GL_INTENSITY 0x8049 #define GL_INTENSITY4 0x804A #define GL_INTENSITY8 0x804B #define GL_INTENSITY120x804C #define GL_INTENSITY160x804D #define GL_R3_G3_B2 0x2A10 #define GL_RGB4 0x804F #define GL_RGB5 0x8050 #define GL_RGB8 0x8051 #define GL_RGB10 0x8052 #define GL_RGB12 0x8053 #define GL_RGB16 0x8054 #define GL_RGBA2 0x8055 #define GL_RGBA4 0x8056 #define GL_RGB5_A10x8057 #define GL_RGBA8 0x8058 #define GL_RGB10_A2 0x8059 #define GL_RGBA12 0x805A #define GL_RGBA16 0x805B #define GL_TEXTURE_RED_SIZE 0x805C #define GL_TEXTURE_GREEN_SIZE 0x805D #define GL_TEXTURE_BLUE_SIZE 0x805E #define GL_TEXTURE_ALPHA_SIZE 0x805F #define GL_TEXTURE_LUMINANCE_SIZE 0x8060 #define GL_TEXTURE_INTENSITY_SIZE 0x8061 #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 For internal texture format there are also definitions in osg/Texture In osg/Image: enum AllocationMode { NO_DELETE, USE_NEW_DELETE, USE_MALLOC_FREE }; Good luck, Guy. -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* Tuesday, April 08, 2008 2:55 PM *To:* osg *Subject:* [osg-users] Glenum pixelFormat Hi All, I'm trying to make a osg::Image, but in allocateImage(...) and setImage(...) I need : Pixel format, Internal texture format, AllocationMode... But I didn't find any possible values ?! Where can I find it ? thanks Regards, Vincent. ___ 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] osg Image data
Hi All, I have a problem concerning writing image data. My code is simple : const long size = _x*_y*3; unsigned char* data = (unsigned char*)calloc(size, sizeof(unsigned char)); for(long i=0; i size ; i+= 3) { data[i] = 0;//red data[i+1] = 0;//green data[i+2] =0;//blue } osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_SHORT); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT, data, osg::Image::NO_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); the result must be a black picture... but I've a totally different result (see attached file) Does anyone see a mistake ? Thanks. Regards, Vincent. attachment: Gradient.jpg___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg Image data
Yes, but GL_UNSIGNED_CHAR doesn't exist. so I don't know what to use... 2008/4/10, J.P. Delport [EMAIL PROTECTED]: Hi, sizeof(unsigned char) != sizeof(GL_UNSIGNED_SHORT) try GL_UNSIGNED_CHAR jp Vincent Bourdier wrote: Hi All, I have a problem concerning writing image data. My code is simple : const long size = _x*_y*3; unsigned char* data = (unsigned char*)calloc(size, sizeof(unsigned char)); for(long i=0; i size ; i+= 3) { data[i] = 0;//red data[i+1] = 0;//green data[i+2] =0;//blue } osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_SHORT); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT, data, osg::Image::NO_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); the result must be a black picture... but I've a totally different result (see attached file) Does anyone see a mistake ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg Image data
Yes It works better now !! Thanks a lot ! Regards, Vincent 2008/4/10, [EMAIL PROTECTED] [EMAIL PROTECTED]: use GL_UNSIGNED_BYTE a char is 1 byte *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* 10. april 2008 13:33 *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] osg Image data Yes, but GL_UNSIGNED_CHAR doesn't exist. so I don't know what to use... 2008/4/10, J.P. Delport [EMAIL PROTECTED]: Hi, sizeof(unsigned char) != sizeof(GL_UNSIGNED_SHORT) try GL_UNSIGNED_CHAR jp Vincent Bourdier wrote: Hi All, I have a problem concerning writing image data. My code is simple : const long size = _x*_y*3; unsigned char* data = (unsigned char*)calloc(size, sizeof(unsigned char)); for(long i=0; i size ; i+= 3) { data[i] = 0;//red data[i+1] = 0;//green data[i+2] =0;//blue } osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_SHORT); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT, data, osg::Image::NO_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); the result must be a black picture... but I've a totally different result (see attached file) Does anyone see a mistake ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ 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] Create new Image
Hi All, I'm making a loop which compute each pixel color for a RVB image... but sometimes, wen runing, an error append in : osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_BYTE); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); note : data is a unsigned char* of _x*_y*3 size Is there any specification or order to create a osg::Image from an unsigned char* ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Create new Image
Hi Robert, I don't know exactly what append, I have a VS bug : Windows a déclenché un point d'arrêt dans 3DEM.exe. Cela peut être dû à une défaillance du tas et indique un bogue dans 3DEM.exe ou l'une des DLL chargées. La fenêtre Sortie peut contenir des informations de diagnostic supplémentaires But If I put in comment the previous lines of my code, no bug appears... Any ideas ? Is there any important bug which have been resolved from the last realease (OSG 2.2) in osg::Image ? Thanks. Regard, Vincent 2008/4/10, Robert Osfield [EMAIL PROTECTED]: HI Vincent, What do you mean by an error append? In your code have both a allocateImage and a setImage, you should just use one or other. Robert. On Thu, Apr 10, 2008 at 5:46 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi All, I'm making a loop which compute each pixel color for a RVB image... but sometimes, wen runing, an error append in : osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_BYTE); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); note : data is a unsigned char* of _x*_y*3 size Is there any specification or order to create a osg::Image from an unsigned char* ? Thanks. Regards, Vincent. ___ 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] Create new Image
Hi Thibault I understand that it can be a memory problem, and I undertand too how to get the size of data, but I'm trying to create a Image form nothing else (not a copy or a modified picture from an other one) and so my problem is how to compute the data size... If x*y*3 is not the good solution, how can I compute the right size for a RGB image ? thanks Regard. Vincent. 2008/4/11, Thibault Genessay [EMAIL PROTECTED]: HI Vincent On Fri, Apr 11, 2008 at 9:04 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: I have a VS bug : Windows a déclenché un point d'arrêt dans 3DEM.exe. Cela peut être dû à une défaillance du tas et indique un bogue dans 3DEM.exe ou l'une des DLL chargées. La fenêtre Sortie peut contenir des informations de diagnostic supplémentaires This indicates that your application has corrupted the heap, most probably by writing out the bounds of a buffer. It is not a VS bug, it is just Visual Studio (actually, the debug CRT) telling you that you did something wrong. But If I put in comment the previous lines of my code, no bug appears... Is there any important bug which have been resolved from the last realease (OSG 2.2) in osg::Image ? The osg::Image class is robust and does not have bug AFAIK, so your code is certainly guilty. Any ideas ? I'd bet on a difference between the buffer size osg::Image::setImage() expects and the buffer you actually give it. There is no guarantee that the actual size of the data for an RGB image is 3*width*height, because the memory layout might be different - there can be padding zero bytes at the end of each line if your dimensions are not powers of two. You should compute the actual line length (which is = width) and multiply it by the height to get the actual buffer size needed. For instance, somewhere in my code I have a function that extracts a sub-image from an osg::Image that goes like this: osg::Image* createSubImage(const osg::Image* source, int src_s, int src_t, int width, int height) { assert(source); int padding = source-getPixelSizeInBits()/8; int rowSize = width * padding; Bufferunsigned char dest_data(rowSize * height); // This is a wrapper around unsigned char* that allocates the desired size and frees the pointer when it goes out of scope for (int i=0;iheight;i++) { memcpy(dest_data[rowSize*i], source-data(src_s, src_t+i), rowSize); } osg::Image* dest = new osg::Image; dest-setImage(width, height, 1, source-getInternalTextureFormat(), source-getPixelFormat(), source-getDataType(), dest_data.detach(), // Steal the data pointer from the Buffer so that it is now owned by the new osg::Image osg::Image::USE_NEW_DELETE); return dest; } Hope this helps Regards Thibault ___ 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] Create new Image
Ok, this is the code, without all the pixel color computation : long size = _x*_y*3; unsigned char* data = (unsigned char*)calloc(size, sizeof(unsigned char)); for(long i=0; i size ; i+= 3) { [...] data[i] = color;//red data[i+1] = color;//green data[i+2] =color;//blue } osg::Image* image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_BYTE); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); Thanks for help. Vincent. 2008/4/11, Stephan Huber [EMAIL PROTECTED]: Vincent Bourdier schrieb: If x*y*3 is not the good solution, how can I compute the right size for a RGB image ? please show us the complete code. The chance is high that you write out of the bounds of your created picture. Creating osg::Images from scratch is possible, I do this a lot in my own code. cheers, Stephan ___ 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] Create new Image
It looks better ! I didn't understood what the difference between the NO_DELETE, USE_NEW_DELETE, ... but now I know how to use it. I cannot make all my tests now, but for the moment It work better, without error. Thanks a lot for your help. :-) Regard. Vincent. 2008/4/11, Ralph Kern [EMAIL PROTECTED]: You mix up memory allocated with malloc/calloc/realloc and those with new / delete: the guilty lines are: unsigned char* data = (unsigned char*)calloc(size, sizeof(unsigned char)); opposed to image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE); Do you see USE_NEW_DELETE? it tells the image to do cleanup using delete [] data; You should allocate your data using unsigned char *data = new unsigned char[size]; regards Ralph Vincent Bourdier schrieb: Ok, this is the code, without all the pixel color computation : long size = _x*_y*3; unsigned char* data = (unsigned char*)calloc(size, sizeof(unsigned char)); for(long i=0; i size ; i+= 3) { [...] data[i] = color;//red data[i+1] = color;//green data[i+2] =color;//blue } osg::Image* image = new osg::Image; image-allocateImage(_x, _y, 1, GL_RGB, GL_UNSIGNED_BYTE); image-setOrigin(osg::Image::BOTTOM_LEFT);//start counting pixels on the Bottom left of the picture image-setImage(_x, _y, 1, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE); osgDB::writeImageFile(*image, Z:/autres/Gradient.jpg); Thanks for help. ___ 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] Delaunay and getTriangles()
Hi All, Using osgUtil::DelaunayTriangulator, I'm looking for obtaining the triangle list... but for the moment, I haven't already found it. The getTriangles() method return a DrawElementsUInt, but no way to find a triangle list or something approaching... Is there a (simple) way ? Thanks, Regards. Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Delaunay and getTriangles()
Hi all, No one have any idea ? Because I'm a little bit lost on how to get the Delaunay Triangles.. Thanks. Regards, Vincent. 2008/4/14, Vincent Bourdier [EMAIL PROTECTED]: Hi All, Using osgUtil::DelaunayTriangulator, I'm looking for obtaining the triangle list... but for the moment, I haven't already found it. The getTriangles() method return a DrawElementsUInt, but no way to find a triangle list or something approaching... Is there a (simple) way ? Thanks, Regards. Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Delaunay and getTriangles()
TriangleFunctor is not very easy to understand just with examples from OSG sources... It is a class Template, so what class can be the template data ? I've understood the obligation to implement T::operator(), but how to apply the TriangleFunctor to a drawable or something near ? Thanks for ideas and help, because It looks unused and complicated for me... Regards. Vincent. 2008/4/15, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, osgUtil::DelaunayTriangulation just generated osg::Geometry it doesn't generates a pure triangular mesh. The OSG stores primitives in osg::Geometry in the same form as OpenGL handles primitives, the same interface is used for all primitive types, triangles aren't anything that gets special treatment in terms of storage/access. If you want convenience in accessing a generic osg::Geometry mesh (that could be in GL_TRIANGLES, GL_QUADS etc) you can use the osg::TriangleFunctor. Have a search through the OSG sources for examples of this in action. Robert. On Tue, Apr 15, 2008 at 9:59 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi all, No one have any idea ? Because I'm a little bit lost on how to get the Delaunay Triangles.. Thanks. Regards, Vincent. 2008/4/14, Vincent Bourdier [EMAIL PROTECTED]: Hi All, Using osgUtil::DelaunayTriangulator, I'm looking for obtaining the triangle list... but for the moment, I haven't already found it. The getTriangles() method return a DrawElementsUInt, but no way to find a triangle list or something approaching... Is there a (simple) way ? Thanks, Regards. Vincent ___ 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] Delaunay and getTriangles()
Hi, Thanks Alberto, I've made some reading in the OSG source code to understand better... After that I made my own test, but I don't have the good result : the operator() is never called on the geometry You can see my code here : http://rafb.net/p/PeihdM64.html Don't read commentaries ^^ they are not updated... Any idea ? why the operator() is never called ? Thanks a lot. Vincent. 2008/4/15, Alberto Luaces [EMAIL PROTECTED]: El Martes 15 Abril 2008ES 16:26:21 Vincent Bourdier escribió: Thanks for ideas and help, because It looks unused and complicated for me... I don't think it is nor unused nor complicated. I use it heavily for my projects and I find it very useful. It's the best way to retrieve back the geometry from the scene, and in my opinion, in a very clever manner that makes it very extensible. It is simple: is a template visitor that is built around some class of yours that collects data information with operator() method. ___ 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] Delaunay and getTriangles()
Humm Yes Adding the setVertexArray() It works better... Too soon to know if it really do what I hope, but it seems to do something logical now. Thanks a lot Alberto. Muchas gracias :-) Vincent. 2008/4/16, Alberto Luaces [EMAIL PROTECTED]: Some ideas: 1) I think the operator() isn't called because although you set the PrimitiveSet that osgUtil::DelaunayTriangulator calculated, you didn't added the data that the PrimitiveSet is referencing (i.e. your points). You can do that with Geometry::setVertexArray(). 2) A tip: you don't need that dynamic_cast on line 28 since a osg::DrawElementsUInt is a osg::PrimitiveSet, see this at http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01152.html Sometimes is very useful to dump some nodes to a .osg file in order to see what is happening and how data is really laid on the graph. HTH, Alberto El Miércoles 16 Abril 2008ES 10:33:28 Vincent Bourdier escribió: Hi, Thanks Alberto, I've made some reading in the OSG source code to understand better... After that I made my own test, but I don't have the good result : the operator() is never called on the geometry You can see my code here : http://rafb.net/p/PeihdM64.html Don't read commentaries ^^ they are not updated... Any idea ? why the operator() is never called ? Thanks a lot. Vincent. 2008/4/15, Alberto Luaces [EMAIL PROTECTED]: El Martes 15 Abril 2008ES 16:26:21 Vincent Bourdier escribió: Thanks for ideas and help, because It looks unused and complicated for me... I don't think it is nor unused nor complicated. I use it heavily for my projects and I find it very useful. It's the best way to retrieve back the geometry from the scene, and in my opinion, in a very clever manner that makes it very extensible. It is simple: is a template visitor that is built around some class of yours that collects data information with operator() method. ___ 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] warning when creating image
Hi, image-setImage(width, height, 0,... ) can be a problem... because 0 in the depth or the image... so if it is a simple 2D image, put 1. Vincent. 2008/4/16, [EMAIL PROTECTED] [EMAIL PROTECTED]: I use osg 2.3.7 on vista in a ref class the following lines: osg::Image * image = new osg::Image; image-setImage(width, height, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, pixels, osg::Image::AllocationMode::USE_NEW_DELETE); causes the warning: Warning 4 warning C4482: nonstandard extension used: enum 'osg::Image::AllocationMode' used in qualified name ... isnt this the correct way of creating a image if the pixels have been created using new? Erlend ___ 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] Geometry
Hi All, I've a new problem, which is about Geometries. this is simple : I've a node, already with a texture, and I want to put a second texture on it. BUT, the second texture have to be well positioned on the node, without depending on the Geometry's texture coordinates... I've tried osg::TexGen and osg::TextureCubeMap but the second texture is never put correctly on the node... How can I get the texture coordinates ? or how can I put the second texture right on the node ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geometry
Brian, ok so if I understand well, i can set a second array of coordinate of texture. but for that I need the geometry... and i only can get the drawable from a geode... so how can I get the geometry ? thanks for help. Vincent. 2008/4/18, Brian R Hill [EMAIL PROTECTED]: Vincent, I'm not sure what you're trying to do. The second texture will only look right on the geometry if you define the texture coordinates to make it right. Each texture has it's own texture coordinates: osg::Geometry::setTexCoordArray(texture unit, texture coordinate array) The first texture should use texture unit 0 and the second should use texture unit 1. Brian [EMAIL PROTECTED] wrote: - To: osg osg-users@lists.openscenegraph.org From: Vincent Bourdier [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] Date: 04/18/2008 10:17AM Subject: [osg-users] Geometry Hi All, I've a new problem, which is about Geometries. this is simple : I've a node, already with a texture, and I want to put a second texture on it. BUT, the second texture have to be well positioned on the node, without depending on the Geometry's texture coordinates... I've tried osg::TexGen and osg::TextureCubeMap but the second texture is never put correctly on the node... How can I get the texture coordinates ? or how can I put the second texture right on the node ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ___ 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 Jean-Sébastien, This is a very clear and complete explanation. I'll will try all these to get the best in my case. thanks a lot for these quick answers !! Regards, Vincent. 2008/4/18, Jean-Sébastien Guay [EMAIL PROTECTED]: Bonjour Vincent, ok so if I understand well, i can set a second array of coordinate of texture. but for that I need the geometry... and i only can get the drawable from a geode... so how can I get the geometry ? Use a NodeVisitor to get to the geode you want (only you can know which one you want, either by name or any other trait, or just find any geode), and then get its drawables and check to see if they're instances of osg::Geometry. Check the examples for uses of NodeVisitor to find a node. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] osg::TextureCubeMap example ?
I've just found it searching in osg sources. Sorry for the inconvenience. Thanks, Regards. Vincent. 2008/4/21, Robert Osfield [EMAIL PROTECTED]: Hi Vincent, osgcubemap is the example of osg::TextureCubeMap. I'd recommend getting used to using a search tool to look for class usage throughout the OSG. Robert. On Mon, Apr 21, 2008 at 10:16 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi All, Looking for TextureCubeMap I didn't found example or tutorials... I'm looking for applying a second texture on a geode, not depending on old texture coordinates... I've tried this but it render a single color (pixel ?) of the texture... osg::TextureCubeMap* texcube = new osg::TextureCubeMap(); texcube-setImage(osg::TextureCubeMap::POSITIVE_X, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_X, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::POSITIVE_Y, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Y, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::POSITIVE_Z, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Z, _texGrad.get()); osg::BoundingBox bound = geom-getBound(); texcube-setTextureSize(bound.xMax() - bound.xMin(), bound.yMax() - bound.yMin()); texcube-setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP_TO_BORDER); texcube-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_BORDER); texcube-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_BORDER); geode-getOrCreateStateSet()-setTextureAttributeAndModes(1, texcube, osg::StateAttribute::ON); geode-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::ON); Any ideas ? examples ? Thanks. Regards. Vincent. ___ 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
[osg-users] osg::TextureCubeMap example ?
Hi All, Looking for TextureCubeMap I didn't found example or tutorials... I'm looking for applying a second texture on a geode, not depending on old texture coordinates... I've tried this but it render a single color (pixel ?) of the texture... osg::TextureCubeMap* texcube = new osg::TextureCubeMap(); texcube-setImage(osg::TextureCubeMap::POSITIVE_X, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_X, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::POSITIVE_Y, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Y, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::POSITIVE_Z, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Z, _texGrad.get()); osg::BoundingBox bound = geom-getBound(); texcube-setTextureSize(bound.xMax() - bound.xMin(), bound.yMax() - bound.yMin()); texcube-setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP_TO_BORDER); texcube-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_BORDER); texcube-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_BORDER); geode-getOrCreateStateSet()-setTextureAttributeAndModes(1, texcube, osg::StateAttribute::ON); geode-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::ON); Any ideas ? examples ? Thanks. Regards. Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Put a second texture on an unknown geode
Hi all, This is my new dilemma : I got a geode. It can be a sphere, a cube, or a more complex geometry... I made a texture, and I need to put it on the node, as a second texture. The dilemma is : how to configure texture (coords, wrapping, texturecubemap, TextureRectangle, ...) to get a good result on any geode (not how to put it but how to configure it to get a good mapping) ? (on a geometry representing something similar as a cube, osg::TextureRectangle give some good results, but on a more complicated geode, it does not do something fine.) Thanks ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Point cloud culling/paging
Hello it is just an idea, but maybe your camera's frustrum is not good... Regard, Vincent. 2008/4/24 Steven Powers [EMAIL PROTECTED]: I'm experiencing some weird problems with my point cloud. I have a fairly large terrain and a point cloud that expands the whole terrain. When I build the point cloud and look around the environment whole sections of the point cloud disappear when they aren't centered within the camera's view. They will then reappear when the center of the missing section is within view. The point cloud is a POINTS primitive set and I have turned culling off ( setCullingActive(false)) as well as display lists. I've noticed that if I do not add the terrain model to the scene it works ok. What culling/paging option do I need to set to make sure this doesn't happen? -Steve ___ 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] osgFx Effects
Hello First, use dynamic_castT(node) it is done for this kind of cast... Next, if you don't find any FXnode, try to save your graph as an osg file and have a look in it... maybe Bump mapping isn't represented by a osgFX node ? (don't know I haven't already used it) Regards, Vincent. 2008/4/29 ka Ming [EMAIL PROTECTED]: Hallo, I have problem to get the effects of my Objects. I read in a 3ds File. I know, that in this file bumpmapping is used. Now I want to traverse my scenegraph and wanted to know which object have a bumpmap (or another effect). How can I implement that? I trying to cast the Group or Node to an Effect, but this won't work. Any suggestions!! Regards -- Gesendet von Yahoo! Mailhttp://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd..yahoo.com/evt=52430/*http://de.overview.mail.yahoo.com. Mehr Möglichkeiten, in Kontakt zu bleiben. ___ 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] problems with a new geometry
Hi all, Trying for hours to create a new geode, I'am having a bug I can't fix Doing _root-addChild(createSun(config-Sunpath)); the program crashes This is the code of createSun osg::Geode* createSun(std::string texturePath) { int nb_edge = 30; float radius = SUN_RADIUS/UNIT_METER/SUN_DIVIDER; osg::Vec3 center = osg::Vec3(SUN_CENTER); center.normalize(); center *= SUN_DISTANCE/UNIT_METER/SUN_DIVIDER; osg::ref_ptrosg::Billboard billboard = new osg::Billboard(); osg::Geometry* geometry = new osg::Geometry(); osg::Vec3Array* vertices = new osg::Vec3Array(); osg::Vec3Array* normals = new osg::Vec3Array(); osg::Vec4Array* colors = new osg::Vec4Array(); //1st point is the center of the triangle fan vertices-push_back(osg::Vec3(0,0,0)); for(int i=1; inb_edge; ++i) { vertices-push_back(osg::Vec3(radius * cos(osg::DegreesToRadians(i/(float)(nb_edge/360.0f))), radius * sin(osg::DegreesToRadians(i/(float)(nb_edge/360.0f))), .0f )); } geometry-setVertexArray(vertices); normals-push_back(osg::Vec3(0,0,1)); geometry-setNormalArray(normals); geometry-setNormalBinding(osg::Geometry::BIND_OVERALL); colors-push_back(osg::Vec4(1,1,0,1)); geometry-setColorArray(colors); geometry-setColorBinding(osg::Geometry::BIND_OVERALL); osg::DrawElementsUShort* primitive = new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_FAN); primitive-push_back(0); for(int i=1; inb_edge; ++i) primitive-push_back(i); geometry-addPrimitiveSet(primitive); billboard-addDrawable(geometry,center); billboard-setMode(osg::Billboard::POINT_ROT_EYE); center.normalize(); billboard-setNormal(-center); return billboard.get(); } On crash it return the error: Exception non gérée à 0x10028b41 (osg25-osgd.dll) dans 3DEM.exe : 0xC005: Violation d'accès lors de la lecture de l'emplacement 0xfeeefeee Do you see any mistake ? Thanks a lot Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problems with a new geometry
Hi David You're write, it's my ref_pr !! I was searching in another direction, so I haven't saw it. thanks a lot David and Alberto. Regards, Vincent. 2008/4/30 David Callu [EMAIL PROTECTED]: Hi Vincent, 2008/4/30 Vincent Bourdier [EMAIL PROTECTED]: Hi all, Trying for hours to create a new geode, I'am having a bug I can't fix Doing _root-addChild(createSun(config-Sunpath)); the program crashes This is the code of createSun osg::Geode* createSun(std::string texturePath) { int nb_edge = 30; float radius = SUN_RADIUS/UNIT_METER/SUN_DIVIDER; osg::Vec3 center = osg::Vec3(SUN_CENTER); center.normalize(); center *= SUN_DISTANCE/UNIT_METER/SUN_DIVIDER; osg::ref_ptrosg::Billboard billboard = new osg::Billboard(); problem is here, you create a pointer in a osg::ref_ptr, it will be unref and deleted when you exit of the current scope (osg::Geode* createSun(std::string texturePath) scope) so you return a deleted pointer, and ARggg crach osg::Geometry* geometry = new osg::Geometry(); osg::Vec3Array* vertices = new osg::Vec3Array(); osg::Vec3Array* normals = new osg::Vec3Array(); osg::Vec4Array* colors = new osg::Vec4Array(); //1st point is the center of the triangle fan vertices-push_back(osg::Vec3(0,0,0)); for(int i=1; inb_edge; ++i) { vertices-push_back(osg::Vec3(radius * cos(osg::DegreesToRadians(i/(float)(nb_edge/360.0f))), radius * sin(osg::DegreesToRadians(i/(float)(nb_edge/360.0f))), .0f )); } geometry-setVertexArray(vertices); normals-push_back(osg::Vec3(0,0,1)); geometry-setNormalArray(normals); geometry-setNormalBinding(osg::Geometry::BIND_OVERALL); colors-push_back(osg::Vec4(1,1,0,1)); geometry-setColorArray(colors); geometry-setColorBinding(osg::Geometry::BIND_OVERALL); osg::DrawElementsUShort* primitive = new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_FAN); primitive-push_back(0); for(int i=1; inb_edge; ++i) primitive-push_back(i); geometry-addPrimitiveSet(primitive); billboard-addDrawable(geometry,center); billboard-setMode(osg::Billboard::POINT_ROT_EYE); center.normalize(); billboard-setNormal(-center); return billboard.get(); } On crash it return the error: Exception non gérée à 0x10028b41 (osg25-osgd.dll) dans 3DEM.exe : 0xC005: Violation d'accès lors de la lecture de l'emplacement 0xfeeefeee Do you see any mistake ? Thanks a lot Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Cheer David Callu ___ 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] Limit on number of children ?
Hi all, Somewhere in my code, I make some root-addChild(functionCreateGeode()); but when I added a last one, OSG crash on rendering, pretending a vector error. I've verified, it do not depend on the Geode, because it work if I remove an addChild() before doing mine... Is there a limit in the number of child ? or is it impossible to add 2 Geode (or more) on the same group ? thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgfx::bumpmapping example ?
Hi all, I just want to set a bump mapping effect on a geode, but the only thing I obtain is the geode all colored in black. I didn't found any example of BumpMapping, and I didn't succed setting it on my geode doing : osgFX::BumpMapping* bump = new osgFX::BumpMapping(); bump-addChild(geodeMoon); bump-setLightNumber(0); bump-setDiffuseTextureUnit(0); bump-setNormalMapTextureUnit(1); bump-prepareChildren(); In my exemple, the texture1 and texture0 are the same, but I just want to test if I have a result How do you use it ? Thanks. Regards, Vincent ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Limit on number of children ?
Thanks for help, a bit of code will be more clear so this is something approaching : osg::Geode* createMoon(std::string texturePath); osg::Geode* createSun(std::string texturePath); and in the main: _root-addChild(createSkyMap(config-Skypath)); _root-addChild(createSunLight(_root.get())); _root-addChild(earthGroup); ... _root-addChild(createSun(...)) //ok _root-addChild(createMoon(...)) //error but if I do this : _root-addChild(createSkyMap(config-Skypath)); _root-addChild(createSunLight(_root.get())); _root-addChild(earthGroup); ... //_root-addChild(createSun(...)) _root-addChild(createMoon(...)) //ok So I don't understand what can be the problem... I if put createSun() or createMoon() it work well, but if I put the two, it crashes... I hope it's more clear now. Thanks, Vincent 2008/5/2 Gordon Tomlinson [EMAIL PROTECTED]: Without seeing your code one cannot really say what is wrong with what you doing Typically in this case I would say it is because one of the Geodes your adding has not been created correctly, its geometry is not set up, or possibly your using a stale of corrupt pointer __ *Gordon Tomlinson * Email : [EMAIL PROTECTED] YIM/AIM : *gordon3dBrit* MSN IM : [EMAIL PROTECTED] Website : *www.vis-sim.com www.gordontomlinson.com* __ *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* Friday, May 02, 2008 5:27 AM *To:* osg *Subject:* [osg-users] Limit on number of children ? Hi all, Somewhere in my code, I make some root-addChild(functionCreateGeode()); but when I added a last one, OSG crash on rendering, pretending a vector error. I've verified, it do not depend on the Geode, because it work if I remove an addChild() before doing mine... Is there a limit in the number of child ? or is it impossible to add 2 Geode (or more) on the same group ? thanks. Regards, Vincent. ___ 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] Limit on number of children ?
Thanks for help, a bit of code will be more clear so this is something approaching : osg::Geode* createMoon(std::string texturePath); osg::Geode* createSun(std::string texturePath); and in the main: _root-addChild(createSkyMap(config-Skypath)); _root-addChild(createSunLight(_root.get())); _root-addChild(earthGroup); ... _root-addChild(createSun(...)) //ok _root-addChild(createMoon(...)) //error but if I do this : _root-addChild(createSkyMap(config-Skypath)); _root-addChild(createSunLight(_root.get())); _root-addChild(earthGroup); ... //_root-addChild(createSun(...)) _root-addChild(createMoon(...)) //ok So I don't understand what can be the problem... I if put createSun() or createMoon() it work well, but if I put the two, it crashes... I hope it's more clear now. Thanks, Vincent 2008/5/2 Paul Melis [EMAIL PROTECTED]: Vincent Bourdier wrote: Somewhere in my code, I make some root-addChild(functionCreateGeode()); but when I added a last one, OSG crash on rendering, pretending a vector error. I've verified, it do not depend on the Geode, because it work if I remove an addChild() before doing mine... Not sure what you mean here, showing the relevant code might help. Is there a limit in the number of child ? or is it impossible to add 2 Geode (or more) on the same group ? A Group node keeps its children nodes using a std::vector, which doesn't have any practical length limit (other than available memory and an integer counter of the number of items which might overflow). Without seeing your actual code I'd guess this has something to do with not using ref_ptr where you should. Paul ___ 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] Limit on number of children ?
Yes, i did it and it works well, but I don't understand why I have to use a group... Thanks, Vincent 2008/5/2 Gordon Tomlinson [EMAIL PROTECTED]: HI Try creating a group and adding the Moon and Sun geodes to that and then add this new group to your Root Personally I never give a geode to the root node ( __ *Gordon Tomlinson * Email : [EMAIL PROTECTED] YIM/AIM : *gordon3dBrit* MSN IM : [EMAIL PROTECTED] Website : *www.vis-sim.com www.gordontomlinson.com* __ *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* Friday, May 02, 2008 8:45 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Limit on number of children ? Thanks for help, a bit of code will be more clear so this is something approaching : osg::Geode* createMoon(std::string texturePath); osg::Geode* createSun(std::string texturePath); and in the main: _root-addChild(createSkyMap (config-Skypath)); _root-addChild(createSunLight(_root.get())); _root-addChild(earthGroup); ... _root-addChild(createSun(...)) //ok _root-addChild(createMoon(...)) //error but if I do this : _root-addChild(createSkyMap(config-Skypath)); _root-addChild(createSunLight(_root.get())); _root-addChild(earthGroup); ... //_root-addChild(createSun(...)) _root-addChild(createMoon(...)) //ok So I don't understand what can be the problem... I if put createSun() or createMoon() it work well, but if I put the two, it crashes... I hope it's more clear now. Thanks, Vincent 2008/5/2 Paul Melis [EMAIL PROTECTED]: Vincent Bourdier wrote: Somewhere in my code, I make some root-addChild(functionCreateGeode()); but when I added a last one, OSG crash on rendering, pretending a vector error. I've verified, it do not depend on the Geode, because it work if I remove an addChild() before doing mine... Not sure what you mean here, showing the relevant code might help. Is there a limit in the number of child ? or is it impossible to add 2 Geode (or more) on the same group ? A Group node keeps its children nodes using a std::vector, which doesn't have any practical length limit (other than available memory and an integer counter of the number of items which might overflow). Without seeing your actual code I'd guess this has something to do with not using ref_ptr where you should. Paul ___ 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] Danke für Ihre Mail / Thank you for your mail (was: Danke für Ihre Mail / Thank y ou for your mail (was: Danke für Ihre Mail / Thank you for your mail (was: Danke für Ihre Mail / Th
Kein Spam 010203 Maybe it can help... 2008/5/6 Lars Fricke [EMAIL PROTECTED]: Bezüglich/Regarding Spam: Deutsch/English - Sehr geehrter Absender, sie haben mir eine e-Mail gesendet. Aufgrund der enormen Belastung mit Spam habe ich einen entsprechenden Filter eingerichtet. Wenn Sie diese Antwort bekommen, besteht die Möglichkeit, dass Ihre e-Mail mich nicht erreicht hat, senden Sie sie bitte erneut mit dem Zusatz Kein Spam 010203 im Haupttext. Vielen Dank für Ihr Verständnis. Mit freundlichen Grüßen i.A. Fricke GTA Geoinformatik GmbH Dear sender, you have just sent me an e-mail. Due to the enormous load of spam I was forced to install a spam filter. Should you receive this message, your message may not have reached me correctly. Please include the line Kein Spam 010203 into the body of your mail and send it again. I am sorry for the inconvenience. With Kind Regards Lars Fricke GTA Geoinformatik GmbH -- *GTA Geoinformatik GmbH* Lars Fricke Lindenstr. 63 D-17033 Neubrandenburg Tel: +49(0)395-3581155 Fax: +49(0)395-3684424 [EMAIL PROTECTED] www.gta-geo.de ___ 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] Danke für Ihre Mail / Thank you for your mail (was: Danke für Ihre Mail / Thank y ou for your mail (was: Danke für Ihre Mail / Thank you for your mail
I've sent a email to him and he told me he has solve the problem... If it continue, sent him a personal email ... Regards, Vincent 2008/5/6 Paul Melis [EMAIL PROTECTED]: Jan Ciger wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Paul, Paul Melis wrote: Hi Lars, Could you please fix your subscription to the user-users list and/or spam filter configuration? The list keeps receiving the message below, at intervals of a few minutes. Thanks, Paul It is not likely that he will see this, due to his spam filter. Well, as my reply includes his original message (which includes the Kein Spam 010203 string to mark an e-mail as non-spam) I expected it to go through, but it doesn't. I have now tried to contact him through his company's web site, hope that works. Paul ___ 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] Some 'osg::Geode' that can be transformed should be made as 'osg::MatrixTransform'?
Hi, osg::group inherit from osg::node, so a group is a node. Is it your question ? or it is more complicated ? 2008/5/6 Jeongseok Lee [EMAIL PROTECTED]: Hi all. This is my first question to all of you. So, it's very naive question. J I'm developing 3D robot dynamics simulator. There are links of robot in that simulator. And the links can move (transform). So I used 'osg::MatrixTransform'. But this a kind of osg::Group. I wanna make link as 'osg::Node'. How am I suppose to do? Jeongseok Lee MS Candidate Robotics Laboratory School of Mechanical Aerospace Engineering Seoul National University Tel : +82-2-880-7149 Cell : +82-10-8958-3791 E-mail : [EMAIL PROTECTED] [EMAIL PROTECTED] ___ 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] TextureCubeMap wrapping ?
Hi robert, Thanks for this answer, I'll try later and look on other way... Just a last question to be sure : I just want to put a texture depending on face (and not on geometry) (6 face for cube or similar objects for example)... TextureCubeMap doesn't work, so have you any idea (with OSG or OpenGl) on how to do something similar ? thanks a lot, Regards, Vincent 2008/5/6 Robert Osfield [EMAIL PROTECTED]: Hi Vincent, I'm not sure how other people could help you here - its very much a question that doesn't have enough information about the problem to know what an appropriate answer might be. Texture coordinate generation in OpenGL is an awkward topic, and the best I can recommend is that you dive into books or online texts that discuss it. The OSG for the most part basically just does a direct pass through of settings you make on OSG objects when pass the values to OpenGL so OpenGL docs should serve you well. Robert. On Tue, Apr 29, 2008 at 9:51 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi, With some new tests, I've something different as you can see in the attached file I use this code osg::TextureCubeMap* texcube = new osg::TextureCubeMap(); osg::Image* white = createWhiteImage(_x,_y); texcube-setImage(osg::TextureCubeMap::POSITIVE_X, white); texcube-setImage(osg::TextureCubeMap::NEGATIVE_X, white); texcube-setImage(osg::TextureCubeMap::POSITIVE_Y, white); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Y, white); texcube-setImage(osg::TextureCubeMap::POSITIVE_Z, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Z, white); osg::TexGen *tg = new osg::TexGen; tg-setMode(osg::TexGen::OBJECT_LINEAR); geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, tg, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, texcube, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); Any idea of how to obtain a good mapping ? In the picture we can see 6 face or the TextureCubeMap, but how to put it a the good size ? Have you already used TextureCubeMap ? or how can you did the mapping on a face of a geode ? Thanks a lot, Regard. Vincent. 2008/4/25 Vincent Bourdier [EMAIL PROTECTED]: Hi all, Attempting to put a texture on a geode, (a texture computed in real time) I've used osg::TextureCubeMap, which look good to do this with my data... but I have problems with the correct mapping: In the attached file you can see 1. the texture 2. the node with this texture As you can see, it looks like nothing ... I use this code to obtain this result : osg::TextureCubeMap* texcube = new osg::TextureCubeMap(); texcube-setImage(osg::TextureCubeMap::POSITIVE_X, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_X, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::POSITIVE_Y, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Y, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::POSITIVE_Z, _texGrad.get()); texcube-setImage(osg::TextureCubeMap::NEGATIVE_Z, _texGrad.get()); osg::TexMat* texmat = new osg::TexMat; texmat-setScaleByTextureRectangleSize(true); geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, texmat, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, texcube, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); Wrapping seems to do nothing... TextureRectangle depends of the geometry vertices ans edges... If you have any idea, I'll be happy to hear you. Thanks. Regards, Vincent. ___ 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] Some 'osg::Geode' that can be transformed should be made as 'osg::MatrixTransform'?
1.Yes it it correct. 2.just reply to the mail (or reply to the reply), OSG list do the rest... 2008/5/6 Jeongseok Lee [EMAIL PROTECTED]: Hi, Gordon and Vincent! Thanks for answering my question. I designed as following. class XGLink : public osg::MatrixTransform { … } After that, I wanna add some drawables into XGLink. But XGLink is not a Geode. (osg::Drawable is can be add to only Geode) So, I need to addChild (new Geode) into XGLink. And I addDrawable osg::Drawable to the new Geode. [ hierarchy ] XGLink (osg::Group) | XGLinkGeode (osg::Geode) | XGDrawable (osg::Drawable) Is this correct? Ps. I cannot speak English so well. Please understand me J Ps. How to reply again to reply? T-T *From:* Gordon Tomlinson [mailto:[EMAIL PROTECTED] *Sent:* Tuesday, May 06, 2008 10:39 PM *To:* 'OpenSceneGraph Users' *Subject:* Re: [osg-users] Some 'osg::Geode' that can be transformed should bemade as 'osg::MatrixTransform'? If you want to change the position / orientation of this node and its children as in a shoulder of an arm then is really HAS to be a transformation node and not a basic group or node What's is the issue with using a transform node for what it is designed to do ? -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Vincent Bourdier *Sent:* Tuesday, May 06, 2008 9:28 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Some 'osg::Geode' that can be transformed should bemade as 'osg::MatrixTransform'? Hi, osg::group inherit from osg::node, so a group is a node. Is it your question ? or it is more complicated ? 2008/5/6 Jeongseok Lee [EMAIL PROTECTED]: Hi all. This is my first question to all of you. So, it's very naive question. J I'm developing 3D robot dynamics simulator. There are links of robot in that simulator. And the links can move (transform). So I used 'osg::MatrixTransform'. But this a kind of osg::Group. I wanna make link as 'osg::Node'. How am I suppose to do? Jeongseok Lee MS Candidate Robotics Laboratory School of Mechanical Aerospace Engineering Seoul National University Tel : +82-2-880-7149 Cell : +82-10-8958-3791 E-mail : [EMAIL PROTECTED] [EMAIL PROTECTED] ___ 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] [Blender and OSG]
Hi Maybe Blender can export into .3ds or .obj file ? 2008/5/13 Jean-Baptiste Authesserre [EMAIL PROTECTED]: Hi, I would like to use blender to create my 3D models. Is that possible to use blender files .blend with osg? I compiled by myself osg by using Cmake for the configuration of the Visual studio project. I found no mention about blender during this configuration step. After the compilation, there exist in the generated plugin folder the file osgdb_3ds.dll, which I suppose allow me to use 3DSMAX file. But I don't find anything about blender. Could anybody help me? Best regards, Jean-Baptiste. ___ 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] Stack of actions todo
Hi Alberto I just need to control when I flush the stack, to synchonise with the threads. A Callback would flush the stack (and so modify the graph) at the same time of the callbacks which traverse the graph... It is dangerous. I would stop the threads, flush my stack, and notify the threads to continue... 2008/5/15 Alberto Luaces [EMAIL PROTECTED]: El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió: Hi all, After a look on the net and in the archive, I think nobody did it before, but I prefer ask to earn time : I need to do something like a stack or a list of actions to apply on the scenegraph (FIFO stack if possible). I've a thread which will create the actions to make, and I need to do theses actions on the render loop, stopping the thread during the flush of the stack. Do OSG implement something like this ? Thanks, Regards, Vincent. Hi Vicent, how would it be different from an update callback? ___ 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] Stack of actions todo
Hi all, After a look on the net and in the archive, I think nobody did it before, but I prefer ask to earn time : I need to do something like a stack or a list of actions to apply on the scenegraph (FIFO stack if possible). I've a thread which will create the actions to make, and I need to do theses actions on the render loop, stopping the thread during the flush of the stack. Do OSG implement something like this ? Thanks, Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Stack of actions todo
Hi Robert, You said then you'll need to place a barrier in frame loop to half the frame loop thread I'm not sure to understand how I can do it, and what do you mean by half the frame loop ?? Moreover, I need a stack, that will be re-used for an other way, so I think I'll keep this idea. I suppose the STL is the best way to do it and OSG not implement something more useful for my problem. Thanks, Regards, Vincent. 2008/5/15 Robert Osfield [EMAIL PROTECTED]: Hi Vincent, The OSG designed around the model of single threaded update, multi-thread cull-draw. If you have others threads beyond the main frame loop thread that is want to do updates then you'll need to place a barrier in frame loop to half the frame loop thread while you operations run, then release the barrier when you operations are complete for that frame. Robert. On Thu, May 15, 2008 at 10:39 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Alberto I just need to control when I flush the stack, to synchonise with the threads. A Callback would flush the stack (and so modify the graph) at the same time of the callbacks which traverse the graph... It is dangerous. I would stop the threads, flush my stack, and notify the threads to continue... 2008/5/15 Alberto Luaces [EMAIL PROTECTED]: El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió: Hi all, After a look on the net and in the archive, I think nobody did it before, but I prefer ask to earn time : I need to do something like a stack or a list of actions to apply on the scenegraph (FIFO stack if possible). I've a thread which will create the actions to make, and I need to do theses actions on the render loop, stopping the thread during the flush of the stack. Do OSG implement something like this ? Thanks, Regards, Vincent. Hi Vicent, how would it be different from an update callback? ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Stack of actions todo
I'm not very familiar with threads, and no more with OpenThreads... but I learn quickly if I understand. But if I need to spend a week to understant and set it, I'd better make my stack I think... Vincent 2008/5/15 Robert Osfield [EMAIL PROTECTED]: Hi Vincent, How much threading have you done before, i.e. how confident are you about using threads, blocks and barriers? I asks this as I doubt no how much to assume. Robert. On Thu, May 15, 2008 at 11:25 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert, You said then you'll need to place a barrier in frame loop to half the frame loop thread I'm not sure to understand how I can do it, and what do you mean by half the frame loop ?? Moreover, I need a stack, that will be re-used for an other way, so I think I'll keep this idea. I suppose the STL is the best way to do it and OSG not implement something more useful for my problem. Thanks, Regards, Vincent. 2008/5/15 Robert Osfield [EMAIL PROTECTED]: Hi Vincent, The OSG designed around the model of single threaded update, multi-thread cull-draw. If you have others threads beyond the main frame loop thread that is want to do updates then you'll need to place a barrier in frame loop to half the frame loop thread while you operations run, then release the barrier when you operations are complete for that frame. Robert. On Thu, May 15, 2008 at 10:39 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Alberto I just need to control when I flush the stack, to synchonise with the threads. A Callback would flush the stack (and so modify the graph) at the same time of the callbacks which traverse the graph... It is dangerous. I would stop the threads, flush my stack, and notify the threads to continue... 2008/5/15 Alberto Luaces [EMAIL PROTECTED]: El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió: Hi all, After a look on the net and in the archive, I think nobody did it before, but I prefer ask to earn time : I need to do something like a stack or a list of actions to apply on the scenegraph (FIFO stack if possible). I've a thread which will create the actions to make, and I need to do theses actions on the render loop, stopping the thread during the flush of the stack. Do OSG implement something like this ? Thanks, Regards, Vincent. Hi Vicent, how would it be different from an update callback? ___ 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 ___ 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] Stack of actions todo
Thanks for your help, I'll try to look at it in details. Regards, Vincent. 2008/5/15 Robert Osfield [EMAIL PROTECTED]: On Thu, May 15, 2008 at 11:43 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: I'm not very familiar with threads, and no more with OpenThreads... but I learn quickly if I understand. But if I need to spend a week to understant and set it, I'd better make my stack I think... Have a read through docs on pthreads as OpenThreads is maps pthreads functionality quite well, basically providing a C++ wrapper for the underlying thread implementation and a few help classes on top. The core OSG has a few further higher level help classes like osg::Operation and osg::OperationThread that you could use. A basic grounding with threading in general will help you understand the issues. Also do searches through the OSG itself to see how it uses various OpenThreads classes. Don't expect threading to come easy though, it's can be a hard topic the first time you start working on it, so invest the time now you'll benefit from this for the rest of your career. 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] get Alpha on material
Hi all, trying to get alpha value on a material, on a node, I use mat-getAmbient(osg::Material::FRONT).a() but mat depends on a picked node, and If I pick somewhere different, sometimes it crashes... I suppose I is a osg::material::face problem. Is there any way to get alpha value (setAlpha() exist but not getAlpha()) without needs to do that ? thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get Alpha on material
No one have any idea on how to do it ? I just need to get alpha value on a material on a picked node. Thanks, Regards, Vincent. 2008/5/20 Vincent Bourdier [EMAIL PROTECTED]: Hi all, trying to get alpha value on a material, on a node, I use mat-getAmbient(osg::Material::FRONT).a() but mat depends on a picked node, and If I pick somewhere different, sometimes it crashes... I suppose I is a osg::material::face problem. Is there any way to get alpha value (setAlpha() exist but not getAlpha()) without needs to do that ? thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get Alpha on material
Hi Alberto. I've identified the bug and solved it...(getting material problem) The problem still here is not the same now and it not depends on OSG. Thanks for help, and sorry for the inconvenience. Gracias ;-) Vincent. 2008/5/21 Alberto Luaces [EMAIL PROTECTED]: El Miércoles 21 Mayo 2008ES 10:29:10 Vincent Bourdier escribió: No one have any idea on how to do it ? I just need to get alpha value on a material on a picked node. Thanks, Regards, Vincent. 2008/5/20 Vincent Bourdier [EMAIL PROTECTED]: Hi all, trying to get alpha value on a material, on a node, I use mat-getAmbient(osg::Material::FRONT).a() but mat depends on a picked node, and If I pick somewhere different, sometimes it crashes... I suppose I is a osg::material::face problem. Is there any way to get alpha value (setAlpha() exist but not getAlpha()) without needs to do that ? thanks. Regards, Vincent. You have to guess why your program is crashing by looking at the stack trace. I think what it is happening is that you are trying to get a StateSet from a node that hasn't got one, so you are receiving a null pointer. ___ 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] Openthread ?
Hi all, I'm searching on OSG website but I didn't found something like the Reference documentation or guide of OpenThread... Any idea where I can find headers ? or real documentation ? Thanks Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Openthread ?
Hi Thibault Thanks for help, I'll look at headers, I forgot they were downloaded with sources... Regards, Vincent. 2008/5/22 Thibault Genessay [EMAIL PROTECTED]: Hi Vincent On Wed, May 21, 2008 at 5:38 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: I'm searching on OSG website but I didn't found something like the Reference documentation or guide of OpenThread... Yup, it looks like there is no online documentation for OpenThreads ... Maybe people knowing about doxygen can give you a clue Any idea where I can find headers ? or real documentation ? Nevertheless, the headers are in the source distribution, in OpenSceneGraph/include/OpenThreads and contain quite a lot of information about the various methods. If you want something like a user's guide you can read about pthreads (google for it) as OpenThreads thinly wraps around it (even under Windows where it reproduce its semantics). OpenThreads::Mutexes, Conditions and Barriers are simply object-oriented versions of pthreads'. Regards Thibault ___ 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] osg::ref_ptr difficulties
Hi all, I'm making some function to modify graph after some operation, and so I need to call some simple actions in functions. The problem is about ref_ptr : I need to do this : osg::ref_ptrosg::Group mygroup; [..] mygroup = NULL; [...] To do that in a function, I use someting like : addonstack(mygroup, NULL); //prototype is : addonstack(osg::ref_ptrosg::Group caller, osg::Node* arg1); which did this : osg::ref_ptrosg::Node nd = dynamic_castosg::Node*(caller.get()); if(nd.get()){ nd =arg1; But, the problem is that it doesn't change anything... I need, without making some modifications in the addonstack prototype, a way to put the ref_ptr to NULL . Any idea ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::ref_ptr difficulties
Hi I'm not sure to understand what release() do... T* release() { T* tmp=_ptr; if (_ptr) _ptr-unref_nodelete(); _ptr=0; return tmp; } what does unref_nodelete() do ? what does it return really ? Thanks Vincent. 2008/5/23 Paul Melis [EMAIL PROTECTED]: Vincent Bourdier wrote: Hi Robert I've a ref_ptr to put to NULL, but I can't do a simple my_refptr = NULL; I need to set it in a function. In argument of my function, I get a ref_ptr, and in the function, I put this ref_ptr to NULL; I do not return anything. Perhaps ref_ptr::release()? Paul but at the end (going out of the function), my original ref_ptr hasn't been modified... I don't know if it is more understandable, but it's not easy to explain... Thanks for help. Vincent. 2008/5/23 Robert Osfield [EMAIL PROTECTED] mailto: [EMAIL PROTECTED]: Hi Vincent, I don't know if anyone else can make sense of what you are trying to do, based on your email, but I'm just lost. I kinda doubt the problem is really about ref_ptr, but something related to the overall code that you have written, but since I can't really spot what you intend or what might be going on I certainly can't help. Robert. On Fri, May 23, 2008 at 9:02 AM, Vincent Bourdier [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi all, I'm making some function to modify graph after some operation, and so I need to call some simple actions in functions. The problem is about ref_ptr : I need to do this : osg::ref_ptrosg::Group mygroup; [..] mygroup = NULL; [...] To do that in a function, I use someting like : addonstack(mygroup, NULL); //prototype is : addonstack(osg::ref_ptrosg::Group caller, osg::Node* arg1); which did this : osg::ref_ptrosg::Node nd = dynamic_castosg::Node*(caller.get()); if(nd.get()){ nd =arg1; But, the problem is that it doesn't change anything... I need, without making some modifications in the addonstack prototype, a way to put the ref_ptr to NULL . Any idea ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto: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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::ref_ptr difficulties
Thanks for all, I'll try with reference and not by copy (I didn't think about that) Thanks Regards, Vincent. 2008/5/23 Paul Melis [EMAIL PROTECTED]: Are you sure you understand the basic concept that ref_ptr together with osg::Referenced implements? You might want to read http://andesengineering.com/OSG_ProducerArticles/RefPointers/RefPointers.html. .. The return value is the instance being pointed to by the ref_ptr instance. When you call release() it decrements the instances it's pointing at and returns it. Method unref_nodelete() is a method of osg::Referenced (of which osg::Node is a subclass) and, while it decrements the reference count of the instance it will not delete it when the reference count reaches zero. Paul Vincent Bourdier wrote: Hi I'm not sure to understand what release() do... T* release() { T* tmp=_ptr; if (_ptr) _ptr-unref_nodelete(); _ptr=0; return tmp; } what does unref_nodelete() do ? what does it return really ? Thanks Vincent. 2008/5/23 Paul Melis [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Vincent Bourdier wrote: Hi Robert I've a ref_ptr to put to NULL, but I can't do a simple my_refptr = NULL; I need to set it in a function. In argument of my function, I get a ref_ptr, and in the function, I put this ref_ptr to NULL; I do not return anything. Perhaps ref_ptr::release()? Paul but at the end (going out of the function), my original ref_ptr hasn't been modified... I don't know if it is more understandable, but it's not easy to explain... Thanks for help. Vincent. 2008/5/23 Robert Osfield [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hi Vincent, I don't know if anyone else can make sense of what you are trying to do, based on your email, but I'm just lost. I kinda doubt the problem is really about ref_ptr, but something related to the overall code that you have written, but since I can't really spot what you intend or what might be going on I certainly can't help. Robert. On Fri, May 23, 2008 at 9:02 AM, Vincent Bourdier [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi all, I'm making some function to modify graph after some operation, and so I need to call some simple actions in functions. The problem is about ref_ptr : I need to do this : osg::ref_ptrosg::Group mygroup; [..] mygroup = NULL; [...] To do that in a function, I use someting like : addonstack(mygroup, NULL); //prototype is : addonstack(osg::ref_ptrosg::Group caller, osg::Node* arg1); which did this : osg::ref_ptrosg::Node nd = dynamic_castosg::Node*(caller.get()); if(nd.get()){ nd =arg1; But, the problem is that it doesn't change anything... I need, without making some modifications in the addonstack prototype, a way to put the ref_ptr to NULL . Any idea ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http
[osg-users] Random crash running with osg
Hi All, Running my application, I get a random crash I cannot identify. The error is : vectorbool iterator not dereferencable Bu I've no vectorbool in my code, So I gess it is in osg where the crash append. Maybe I make something wrong in my code, but I've no idea where or what the bug can be... The application uses a lot of OpenThreads, that modify the scenegraph, but they looks synchronized now... Any idea ? Thank you. Regards, Vincent. Note : Configuration : WinXP, osg 2.2 2.4 Stack trace on crash : msvcp80d.dll!std::_Debug_message(const wchar_t * message=0x103ed770, const wchar_t * file=0x1039b478, unsigned int line=1463) Ligne 23C++ osg35-osgd.dll!std::_Vb_referencestd::vectorbool,std::allocatorbool ::_Getptr() Ligne 1463 + 0x17 octetsC++ osg35-osgd.dll!std::_Vb_referencestd::vectorbool,std::allocatorbool ::operator bool() Ligne 1453 + 0x8 octetsC++ osg35-osgd.dll!std::_Vb_const_iteratorstd::vectorbool,std::allocatorbool ::operator*() Ligne 1523 + 0x24 octetsC++ osg35-osgd.dll!std::vectorbool,std::allocatorbool ::operator[](unsigned int _Off=1) Ligne 2010 + 0x41 octetsC++ osg35-osgd.dll!osg::Switch::computeBound() Ligne 198 + 0x12 octets C++ osg35-osgd.dll!osg::Node::getBound() Ligne 268 + 0x13 octetsC++ osg35-osgd.dll!osg::Group::computeBound() Ligne 357 + 0x16 octets C++ osg35-osgd.dll!osg::Node::getBound() Ligne 268 + 0x13 octetsC++ osg35-osgd.dll!osg::Group::computeBound() Ligne 357 + 0x16 octets C++ osg35-osgd.dll!osg::Node::getBound() Ligne 268 + 0x13 octetsC++ osg35-osgd.dll!osg::Node::isCullingActive() Ligne 191 + 0x39 octetsC++ osg35-osgd.dll!osg::CullStack::isCulled(const osg::Node node={...}) Ligne 109 + 0x8 octetsC++ osg35-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group node={...}) Ligne 969 + 0x12 octetsC++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node node={...}) Ligne 277 + 0xf octetsC++ osg35-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group node={...}) Ligne 981C++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgUtild.dll!osgUtil::SceneView::cullStage(const osg::Matrixd projection={...}, const osg::Matrixd modelview={...}, osgUtil::CullVisitor * cullVisitor=0x01fb46b8, osgUtil::StateGraph * rendergraph=0x01fb4220, osgUtil::RenderStage * renderStage=0x01fb42b8) Ligne 821 + 0x42 octets C++ osg35-osgUtild.dll!osgUtil::SceneView::cull() Ligne 687 + 0x4e octetsC++ osg35-osgViewerd.dll!osgViewer::Renderer::cull() Ligne 285 + 0xf octetsC++ osg35-osgViewerd.dll!osgViewer::ViewerBase::renderingTraversals() Ligne 643 + 0x15 octetsC++ osg35-osgViewerd.dll!osgViewer::ViewerBase::frame(double simulationTime=1.7976931348623157e+308) Ligne 583 + 0xf octetsC++ 3DEM.exe!EM_Modules::run() Ligne 302C++ 3DEM.exe!EM_Modules::init(HWND__ * hWnd=0x) Ligne 264 + 0xb octetsC++ 3DEM.exe!main(int argc=1, char * * argv=0x01f32940) Ligne 99 + 0xd octetsC++ 3DEM.exe!__tmainCRTStartup() Ligne 586 + 0x19 octetsC 3DEM.exe!mainCRTStartup() Ligne 403C kernel32.dll!7c816fd7() [Les frames ci-dessous sont peut-être incorrects et/ou manquants, aucun symbole chargé pour kernel32.dll] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Random crash running with osg
C++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::handle_callbacks_and_traverse(osg::Node node={...}) Ligne 84 + 0x25 octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::apply(osg::Group node={...}) Ligne 54 + 0x1a octetsC++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::handle_callbacks_and_traverse(osg::Node node={...}) Ligne 84 + 0x25 octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::apply(osg::Group node={...}) Ligne 54 + 0x1a octetsC++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgViewerd.dll!osgViewer::Viewer::updateTraversal() Ligne 837 + 0x32 octetsC++ osg35-osgViewerd.dll!osgViewer::ViewerBase::frame(double simulationTime=1.7976931348623157e+308) Ligne 582 + 0xf octetsC++ 3DEM.exe!EM_Modules::run() Ligne 302C++ 3DEM.exe!EM_Modules::init(HWND__ * hWnd=0x) Ligne 264 + 0xb octetsC++ 3DEM.exe!main(int argc=1, char * * argv=0x01f42940) Ligne 99 + 0xd octetsC++ 3DEM.exe!__tmainCRTStartup() Ligne 586 + 0x19 octetsC 3DEM.exe!mainCRTStartup() Ligne 403C kernel32.dll!7c816fd7() [Les frames ci-dessous sont peut-être incorrects et/ou manquants, aucun symbole chargé pour kernel32.dll] Does it confirm you idea ? Thanks. Regards, Vincent 2008/6/4 Robert Osfield [EMAIL PROTECTED]: Hi Vincent, This may be an issue with multiple computeBounds() running in a parallel. In the SVN version and 2.5.0/2.5.1 there is an call to sceneData-getBound() that does the initialization of the bounding volume while the code is still single threaded - something that should have been done for the whole 2.x series, but alas it was missed until the submission on the 12th May. So could you try SVN or 2.5.1 and see how you get on. Robert. On Wed, Jun 4, 2008 at 10:15 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi All, Running my application, I get a random crash I cannot identify. The error is : vectorbool iterator not dereferencable Bu I've no vectorbool in my code, So I gess it is in osg where the crash append. Maybe I make something wrong in my code, but I've no idea where or what the bug can be... The application uses a lot of OpenThreads, that modify the scenegraph, but they looks synchronized now... Any idea ? Thank you. Regards, Vincent. Note : Configuration : WinXP, osg 2.2 2.4 Stack trace on crash : msvcp80d.dll!std::_Debug_message(const wchar_t * message=0x103ed770, const wchar_t * file=0x1039b478, unsigned int line=1463) Ligne 23 C++ osg35-osgd.dll!std::_Vb_referencestd::vectorbool,std::allocatorbool ::_Getptr() Ligne 1463 + 0x17 octetsC++ osg35-osgd.dll!std::_Vb_referencestd::vectorbool,std::allocatorbool ::operator bool() Ligne 1453 + 0x8 octetsC++ osg35-osgd.dll!std::_Vb_const_iteratorstd::vectorbool,std::allocatorbool ::operator*() Ligne 1523 + 0x24 octetsC++ osg35-osgd.dll!std::vectorbool,std::allocatorbool ::operator[](unsigned int _Off=1) Ligne 2010 + 0x41 octetsC++ osg35-osgd.dll!osg::Switch::computeBound() Ligne 198 + 0x12 octetsC++ osg35-osgd.dll!osg::Node::getBound() Ligne 268 + 0x13 octets C++ osg35-osgd.dll!osg::Group::computeBound() Ligne 357 + 0x16 octets C++ osg35-osgd.dll!osg::Node::getBound() Ligne 268 + 0x13 octets C++ osg35-osgd.dll!osg::Group::computeBound() Ligne 357 + 0x16 octets C++ osg35-osgd.dll!osg::Node::getBound() Ligne 268 + 0x13 octets C++ osg35-osgd.dll!osg::Node::isCullingActive() Ligne 191 + 0x39 octetsC++ osg35-osgd.dll!osg::CullStack::isCulled(const osg::Node node={...}) Ligne 109 + 0x8 octetsC++ osg35-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group node={...}) Ligne 969 + 0x12 octetsC++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node node={...}) Ligne 277 + 0xf octetsC++ osg35-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group node={...}) Ligne 981C++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgUtild.dll!osgUtil::SceneView::cullStage(const osg::Matrixd projection={...}, const osg
Re: [osg-users] Random crash running with osg
Right, Thanks a lot. I'm downloading 2.5.1 release. Regards, Vincent 2008/6/4 Robert Osfield [EMAIL PROTECTED]: Hi Vincent, I really can't help much with your invalid iterator. It could be unrelated to the bug fix already checked in w.r.t bounding volume update, or it could be already fixed. The SVN and 2.5.1 contain a number of fixes so I'd recommend try updating the OSG before you do anything else as chasing an already fixed problem is not a good use of any of our time. Robert. On Wed, Jun 4, 2008 at 10:24 AM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi robert, Thanks, I'll try this I get a new error, without any modification in the code : invalid iterator range and the stack trace : msvcp80d.dll!std::_Debug_message(const wchar_t * message=0x00f557d8, const wchar_t * file=0x00f5464c, unsigned int line=1029) Ligne 23 C++ msvcp80d.dll!std::_Debug_range2char *(char * _First=0x52a0d982, char * _Last=0x00ebeb24, const wchar_t * _File=0x00f5464c, unsigned int _Line=1029, std::random_access_iterator_tag __formal={...}) Ligne 1361 + 0x12 octetsC++ msvcp80d.dll!std::_Debug_rangechar *(char * _First=0x52a0d982, char * _Last=0x00ebeb24, const wchar_t * _File=0x00f5464c, unsigned int _Line=1029) Ligne 1368 + 0x28 octetsC++ msvcp80d.dll!std::codecvtwchar_t,char,int::do_unshift(int _State=21728932, char * _First2=0x52a0d982, char * _Last2=0x00ebeb24, char * _Mid2=0x00ebebc8) Ligne 1029 + 0x17 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::Switch::traverse(osg::NodeVisitor nv={...}) Ligne 47C++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgd.dll!osg::NodeCallback::traverse(osg::Node * node=0x05197488, osg::NodeVisitor * nv=0x01fc5630) Ligne 23C++ 3DEM.exe!CheckCameraCallback::operator()(osg::Node * node=0x05197488, osg::NodeVisitor * nv=0x01fc5630) Ligne 158C++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::handle_callbacks_and_traverse(osg::Node node={...}) Ligne 83 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::apply(osg::Switch node={...}) Ligne 57 + 0x1a octetsC++ osg35-osgd.dll!osg::Switch::accept(osg::NodeVisitor nv={...}) Ligne 36 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::handle_callbacks_and_traverse(osg::Node node={...}) Ligne 84 + 0x25 octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::apply(osg::Group node={...}) Ligne 54 + 0x1a octetsC++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::Switch::traverse(osg::NodeVisitor nv={...}) Ligne 47C++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgd.dll!osg::NodeCallback::traverse(osg::Node * node=0x0c2dfb50, osg::NodeVisitor * nv=0x01fc5630) Ligne 23C++ 3DEM.exe!CheckCameraCallback::operator()(osg::Node * node=0x0c2dfb50, osg::NodeVisitor * nv=0x01fc5630) Ligne 158C++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::handle_callbacks_and_traverse(osg::Node node={...}) Ligne 83 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::apply(osg::Switch node={...}) Ligne 57 + 0x1a octetsC++ osg35-osgd.dll!osg::Switch::accept(osg::NodeVisitor nv={...}) Ligne 36 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::handle_callbacks_and_traverse(osg::Node node={...}) Ligne 84 + 0x25 octetsC++ osg35-osgUtild.dll!osgUtil::UpdateVisitor::apply(osg::Group node={...}) Ligne 54 + 0x1a octetsC++ osg35-osgd.dll!osg::Group::accept(osg::NodeVisitor nv={...}) Ligne 38 + 0x41 octetsC++ osg35-osgd.dll!osg::Group::traverse(osg::NodeVisitor nv={...}) Ligne 62 + 0x25 octetsC++ osg35-osgd.dll!osg::Switch::traverse(osg::NodeVisitor nv={...}) Ligne 47C++ osg35-osgd.dll!osg::NodeVisitor::traverse(osg::Node node={...}) Ligne 181 + 0x1c octetsC++ osg35-osgd.dll!osg::NodeCallback::traverse(osg::Node * node=0x0b5a08d8, osg::NodeVisitor * nv=0x01fc5630) Ligne 23C++ 3DEM.exe!CheckCameraCallback::operator()(osg::Node * node=0x0b5a08d8, osg::NodeVisitor * nv