From mortene@sim.no Mon Nov 1 03:06:05 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Mon, 01 Nov 2004 03:06:11 -0800 (PST) Received: from sim.no (trh.sim.no [213.236.166.75]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1B63kH008169 for ; Mon, 1 Nov 2004 03:06:05 -0800 Received: by sim.no (Postfix, from userid 1114) id 8392029DC0; Mon, 1 Nov 2004 12:05:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sim.no (Postfix) with ESMTP id 8227C29DB0; Mon, 1 Nov 2004 12:05:44 +0100 (CET) Date: Mon, 1 Nov 2004 12:05:44 +0100 (CET) From: Morten Eriksen X-X-Sender: mortene@valhalla.trh.sim.no To: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= Cc: info-inventor-dev@oss.sgi.com Subject: Re: QT+COIN In-Reply-To: <41836F5C.1050607@mi.madritel.es> Message-ID: References: <4180B321.7080803@mi.madritel.es> <20041028110113.GF20769@sim.no> <41836F5C.1050607@mi.madritel.es> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-archive-position: 110 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: mortene@sim.no Precedence: bulk X-list: info-inventor-dev On Sat, 30 Oct 2004, Tomás Aguado Gómez wrote: > Well, the problem is that when I want to delete a node, I select the > Qlistview, press de delete button,..I go to the map and I say---> > mapQTCOIN[QListviewITEM]->unref(); and the Sphere, Cylinder,... stays in > the scene smiling at me, and the reference count doesn't decrease!! it > stays in 1. Any ideas? Remember that the node's parent will have a reference to the node, and has upped the child's reference count by 1 when it was added into the scene graph. Morten -- http://www.coin3d.org From tomas.aguado@mi.madritel.es Mon Nov 1 05:03:50 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Mon, 01 Nov 2004 05:03:57 -0800 (PST) Received: from smtp09.retemail.es (smtp09.auna.com [62.81.186.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1D3mvw017216 for ; Mon, 1 Nov 2004 05:03:49 -0800 Received: from [213.37.112.101] by smtp09.retemail.es (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20041101130326.VQWV10464.smtp09.retemail.es@[213.37.112.101]>; Mon, 1 Nov 2004 14:03:26 +0100 Message-ID: <41864223.1020804@mi.madritel.es> Date: Mon, 01 Nov 2004 15:03:15 +0100 From: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Morten Eriksen , info-inventor-dev@oss.sgi.com Subject: Re: QT+COIN References: <4180B321.7080803@mi.madritel.es> <20041028110113.GF20769@sim.no> <41836F5C.1050607@mi.madritel.es> In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/alternative; boundary="------------080701050805000804010106" X-archive-position: 111 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: tomas.aguado@mi.madritel.es Precedence: bulk X-list: info-inventor-dev This is a multi-part message in MIME format. --------------080701050805000804010106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Morten Eriksen wrote: >On Sat, 30 Oct 2004, Tomás Aguado Gómez wrote: > > > >>Well, the problem is that when I want to delete a node, I select the >>Qlistview, press de delete button,..I go to the map and I say---> >>mapQTCOIN[QListviewITEM]->unref(); and the Sphere, Cylinder,... stays in >>the scene smiling at me, and the reference count doesn't decrease!! it >>stays in 1. Any ideas? >> >> > >Remember that the node's parent will have a reference to the node, and has >upped the child's reference count by 1 when it was added into the scene >graph. > >Morten > > Hi Morten: Yesterday I changed my code, and now the count reference (I see it with the get Count reference Method) goes to zero when I "unref()" the node, but the element (for example an sphere) stills remains there, as I read in the inventor Mentor, if you unref() and the count reference goes to zero the node is deleted from the scene. Thanks Morten!. Tomás Aguado Gómez Division de Arquitectura de Computadores Grupo de Modelado y realidad virtual http://dac.escet.urjc.es/investigacion/GMRV/ --------------080701050805000804010106 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Morten Eriksen wrote:
On Sat, 30 Oct 2004, Tomás Aguado Gómez wrote:

  
Well, the problem is that when  I want to delete a node, I select the 
Qlistview, press de delete button,..I go to the map and I say---> 
mapQTCOIN[QListviewITEM]->unref(); and the Sphere, Cylinder,... stays in 
the scene smiling at me, and the reference count doesn't decrease!! it 
stays in 1. Any ideas?
    

Remember that the node's parent will have a reference to the node, and has 
upped the child's reference count by 1 when it was added into the scene 
graph.

Morten
  
Hi Morten:
Yesterday I changed my code, and now the count reference (I see it with the get Count reference Method) goes to zero when I  "unref()" the node, but the element (for example an sphere) stills remains there, as I read in the inventor Mentor, if you unref() and the count reference goes to zero the node is deleted from the scene.
Thanks Morten!.
Tomás Aguado Gómez

Division de Arquitectura de Computadores

Grupo de Modelado y realidad virtual

http://dac.escet.urjc.es/investigacion/GMRV/
--------------080701050805000804010106-- From larsa@sim.no Mon Nov 1 05:22:35 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Mon, 01 Nov 2004 05:22:41 -0800 (PST) Received: from sim.no (trh.sim.no [213.236.166.75]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1DMYO9018646 for ; Mon, 1 Nov 2004 05:22:34 -0800 Received: by sim.no (Postfix, from userid 2000) id 25A5F356B3; Mon, 1 Nov 2004 14:22:17 +0100 (CET) Date: Mon, 1 Nov 2004 14:22:17 +0100 From: "Lars J. Aas" To: =?iso-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= Cc: Morten Eriksen , info-inventor-dev@oss.sgi.com Subject: Re: QT+COIN Message-ID: <20041101132216.GB20657@sim.no> References: <4180B321.7080803@mi.madritel.es> <20041028110113.GF20769@sim.no> <41836F5C.1050607@mi.madritel.es> <41864223.1020804@mi.madritel.es> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <41864223.1020804@mi.madritel.es> User-Agent: Mutt/1.5.6i X-archive-position: 112 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: larsa@sim.no Precedence: bulk X-list: info-inventor-dev Tomás Aguado Gómez wrote: : Hi Morten: : Yesterday I changed my code, and now the count reference (I see it with : the get Count reference Method) goes to zero when I "unref()" the node, : but the element (for example an sphere) stills remains there, as I read : in the inventor Mentor, if you unref() and the count reference goes to : zero the node is deleted from the scene. Are you just calling unref() on a node that is the child of a group, or do you also use SoGroup::removeChild()? You shouldn't just unref() a node you haven't decided to manage yourself by ref()ing it earlier. The refs for child nodes of groups are handled by their parent group node, so only if you have called an additional ref() on it should you ever unref() it. You should just use removeChild() to remove a node from a group. Lars J From mortene@sim.no Mon Nov 1 05:22:55 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Mon, 01 Nov 2004 05:23:00 -0800 (PST) Received: from sim.no (trh.sim.no [213.236.166.75]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1DMtBL018667 for ; Mon, 1 Nov 2004 05:22:55 -0800 Received: by sim.no (Postfix, from userid 1114) id 46058356B2; Mon, 1 Nov 2004 14:22:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sim.no (Postfix) with ESMTP id 44B2C29DBD; Mon, 1 Nov 2004 14:22:38 +0100 (CET) Date: Mon, 1 Nov 2004 14:22:38 +0100 (CET) From: Morten Eriksen X-X-Sender: mortene@valhalla.trh.sim.no To: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= Cc: info-inventor-dev@oss.sgi.com Subject: Re: QT+COIN In-Reply-To: <41864223.1020804@mi.madritel.es> Message-ID: References: <4180B321.7080803@mi.madritel.es> <20041028110113.GF20769@sim.no> <41836F5C.1050607@mi.madritel.es> <41864223.1020804@mi.madritel.es> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-archive-position: 113 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: mortene@sim.no Precedence: bulk X-list: info-inventor-dev On Mon, 1 Nov 2004, Tomás Aguado Gómez wrote: > Yesterday I changed my code, and now the count reference (I see it with > the get Count reference Method) goes to zero when I "unref()" the node, > but the element (for example an sphere) stills remains there, [...] You do however need to removeChild() it from its parent node -- do you do that? Otherwise, what I suspect is going on, is that the parent node is still using the memory area of the (now deleted) child node. (Normally, that would cause a crash, but due to the peculiarities of C/C++, by freak accident it could "work".) Either that, or there is something else weird going on, like e.g. perhaps you have several spheres at the same spatial location, or some such. Morten -- http://www.coin3d.org From tomas.aguado@mi.madritel.es Mon Nov 1 10:42:31 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Mon, 01 Nov 2004 10:42:37 -0800 (PST) Received: from smtp09.retemail.es (smtp09.auna.com [62.81.186.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1IgR3A002693 for ; Mon, 1 Nov 2004 10:42:30 -0800 Received: from [213.37.112.101] by smtp09.retemail.es (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20041101184206.ZAMG10464.smtp09.retemail.es@[213.37.112.101]>; Mon, 1 Nov 2004 19:42:06 +0100 Message-ID: <41868373.7050800@mi.madritel.es> Date: Mon, 01 Nov 2004 19:41:55 +0100 From: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: info-inventor-dev@oss.sgi.com, "Lars J. Aas" , Morten Eriksen Subject: Thanks You 2!! X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 114 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: tomas.aguado@mi.madritel.es Precedence: bulk X-list: info-inventor-dev Hello Lars and Morten! I've just read your email, and I has taken me 30 seconds to repair and get to work all the module!!! I get the parent and child from my map, and delete it with that function, I was wishing that function exists,but as I didn't read about it in the Inventor Mentor I was fearing it didn't!! Now I am searching for the function I saw to interchange the position of two nodes within a tree, to implementate to push buttons for the user to move down and up nodes within a branch of the tree. Thanks really. Tomás Aguado Gómez Division de Arquitectura de Computadores Grupo de Modelado y realidad virtual http://dac.escet.urjc.es/investigacion/GMRV From tomas.aguado@mi.madritel.es Tue Nov 2 10:06:38 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Tue, 02 Nov 2004 10:06:45 -0800 (PST) Received: from smtp06.retemail.es (smtp06.auna.com [62.81.186.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2I6aq9013220 for ; Tue, 2 Nov 2004 10:06:37 -0800 Received: from [213.37.112.101] by smtp06.retemail.es (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20041102180614.ENVG1314.smtp06.retemail.es@[213.37.112.101]> for ; Tue, 2 Nov 2004 19:06:14 +0100 Message-ID: <4187CC96.1090303@mi.madritel.es> Date: Tue, 02 Nov 2004 19:06:14 +0100 From: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: info-inventor-dev@oss.sgi.com Subject: Is there a way to replace nodes one-on-one? X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 115 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: tomas.aguado@mi.madritel.es Precedence: bulk X-list: info-inventor-dev Hello everyone!: I found the function I was talking about, it's : virtual void replaceChild (SoNode *oldchild, SoNode*newchild); But I have a problem, I don't really want to "replace", I want to change one node for the other, that's changing the position of Node A in the COIN tree for Node B, and on the contrary too, I can't find any function or combination of functions to make this.¿How can I do It?. Thanks in Advance! Tomás Aguado Gómez Division de Arquitectura de Computadores Grupo de Modelado y realidad virtual http://dac.escet.urjc.es/investigacion/GMRV/ From mortene@sim.no Tue Nov 2 10:20:26 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Tue, 02 Nov 2004 10:20:33 -0800 (PST) Received: from sim.no (trh.sim.no [213.236.166.75]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2IKPxt014088 for ; Tue, 2 Nov 2004 10:20:26 -0800 Received: by sim.no (Postfix, from userid 1114) id D7A55356B4; Tue, 2 Nov 2004 19:20:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sim.no (Postfix) with ESMTP id D6691356AE; Tue, 2 Nov 2004 19:20:07 +0100 (CET) Date: Tue, 2 Nov 2004 19:20:07 +0100 (CET) From: Morten Eriksen X-X-Sender: mortene@valhalla.trh.sim.no To: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= Cc: info-inventor-dev@oss.sgi.com Subject: Re: Is there a way to replace nodes one-on-one? In-Reply-To: <4187CC96.1090303@mi.madritel.es> Message-ID: References: <4187CC96.1090303@mi.madritel.es> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-archive-position: 116 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: mortene@sim.no Precedence: bulk X-list: info-inventor-dev On Tue, 2 Nov 2004, Tomás Aguado Gómez wrote: > But I have a problem, I don't really want to "replace", I want to change > one node for the other, that's changing the position of Node A in the > COIN tree for Node B, and on the contrary too, I can't find any function > or combination of functions to make this.¿How can I do It?. It would go something like this: childA->ref(); // make sure ref-count don't go to zero parentX->replaceChild(childA, childB); parentY->replaceChild(childB, childA); childA->unref(); // set back ref-count ..where parentX is the original parent of A, and parentY for B. Morten -- http://www.coin3d.org From lcdumais@hotmail.com Tue Nov 9 13:39:29 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Tue, 09 Nov 2004 13:39:32 -0800 (PST) Received: from hotmail.com (bay17-f27.bay17.hotmail.com [64.4.43.77]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA9LdS7K022549 for ; Tue, 9 Nov 2004 13:39:29 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 9 Nov 2004 13:39:02 -0800 Received: from 66.36.132.3 by by17fd.bay17.hotmail.msn.com with HTTP; Tue, 09 Nov 2004 21:38:19 GMT X-Originating-IP: [66.36.132.3] X-Originating-Email: [lcdumais@hotmail.com] X-Sender: lcdumais@hotmail.com From: "Louis-Charles Dumais" To: info-inventor-dev@oss.sgi.com Subject: Merging opengl and OpenInventor Date: Tue, 09 Nov 2004 21:38:19 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 09 Nov 2004 21:39:02.0553 (UTC) FILETIME=[879F8090:01C4C6A4] X-archive-position: 117 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: lcdumais@hotmail.com Precedence: bulk X-list: info-inventor-dev Hi, I`m having technical problems merging OpenGL and Open Inventor and I'm asking for help to solve the problem. I could give a small paypal gift to the person solving the “equation”. What I'm trying to do is to use OpenGL and OpenInventor in the same GL context and using the same camera for OpenGL and OpenInventor. This camera is the SoCamera from the OpenInventor package. This mean something like this: void draw(){ drawTheInventorStuff(); drawTheOpenGLStuff(); } The problem is that I cant get the same exact visualization coordinates for OpenGL and OpenInventor with the SoCamera and I dont know why. I have been reading a lot on the SoCamera and looking at the source code to finally isolate what I think are the two functions needed for my task : SbViewVolume::getMatrix() and SbViewVolume::getMatrices( sbMatrixAffine , sbMatrixProjection) . Basically, at the moment, what I do is to take the SbViewVolume from the camera and getMatrix: SbViewVolume cameraSbViewVolume; cameraSbViewVolume = camera->getViewVolume(); sbMatrixCamera= cameraSbViewVolume.getMatrix();//working then I use glMatrixMode(GL_PROJECTION); glLoadIdentity (); glMultMatrixf(sbMatrixCamera[0]); before drawing my GL stuff to get the same camera view than in my OpenInventor rendering pipeline. Its working for the exception of an annoying perspective problem or Viewport Ratio problem and I dont know how to solve it. I invite you to take a look at the problem by looking at a small video you can find at: http://www.netchilds.com/Louis/test.mpeg (If everything worked correctly, you could see only one plane and one 6 DOF mechanism but its not the case. You will notice I have the same problem with perpective and ortho camera.) If you know how to solve the problem, what matrix or GL call I should be using please message me todumais01@gmc.ulaval.ca . I'm including the code below I'm using in the video to give you a better idea of my problem. Thank you for your help, Louis-Charles Dumais The Drawing loop of the gl windows: void Fl_Inventor_Window::draw() { adjustCameraClippingPlanes(); scenemanager->render(); glDraw(); glFlush(); } and my glDraw command: void Fl_Inventor_Window::glDraw(){ glMatrixMode( GL_PROJECTION ); glLoadIdentity(); SbViewVolume cameraSbViewVolume; cameraSbViewVolume = camera->getViewVolume(); SbMatrix sbMatrixCamera; sbMatrixCamera= cameraSbViewVolume.getMatrix(); glMultMatrixf(sbMatrixCamera[0]); glEnable(GL_DEPTH_TEST); //start of dump lightning GLfloat LightAmbient[]= { 0.75f, 0.75f, 0.75f, 1.0f }; //GLfloat LightAmbient[]= { 1.0f, 1.0f, 1.0f, 1.0f }; GLfloat LightDiffuse1[]= { 0.0f, 1.0f, 0.0f, 1.0f }; GLfloat LightDiffuse2[]= { 1.0f, 0.0f, 0.0f, 1.0f }; GLfloat LightPosition1[]= { 1.0f, 0.0f,0.0f, 1.0f }; GLfloat LightPosition2[]= { -1.0f, 0.0f,0.0f, 1.0f }; //GLfloat LightPosition[]= { -1.0f, 0.0f, 0.0f, 1.0f }; //GLfloat LightPosition1[]= {tempSbVec3fPos[0], tempSbVec3fPos[1],tempSbVec3fPos[2],1.0f}; //GLfloat LightPosition2[]= {tempSbVec3fPos[0], -tempSbVec3fPos[1],tempSbVec3fPos[2],1.0f}; glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // glLightfv(GL_LIGHT3, GL_AMBIENT, LightAmbient); glLightfv(GL_LIGHT3, GL_DIFFUSE, LightDiffuse1); glLightfv(GL_LIGHT3, GL_POSITION,LightPosition1); glEnable(GL_LIGHT3); glLightfv(GL_LIGHT4, GL_AMBIENT, LightAmbient); glLightfv(GL_LIGHT4, GL_DIFFUSE, LightDiffuse2); glLightfv(GL_LIGHT4, GL_POSITION,LightPosition2); glEnable(GL_LIGHT4); //end of dump lightning glDisable(GL_LIGHTING); //the multicolor quad glBegin(GL_QUADS); glColor3f(0.05f,0.0f,0.0f); glVertex3f( 0.0f, 0.0f, 0.0f); glColor3f(-0.5f,1.0f,0.0f); glVertex3f(0.05f,0.0f, 0.0f); glColor3f(0.0f,0.0f,1.0f); glVertex3f( 0.05f,0.0f, 0.10f); glColor3f(1.0f,0.0f,1.0f); glVertex3f( 0.0f,0.0f, 0.10f); glEnd(); //the pink quad glColor3f(1.0f,0.0f,1.0f); glBegin(GL_QUADS); glVertex3f( 0.1f,0.1f, 0.0f); glVertex3f( -0.1f,0.1f, 0.0f); glVertex3f( -0.1f,-0.1f, 0.0f); glVertex3f( 0.1f,-0.1f, 0.0f); glEnd(); //now redrawing the openinventor object to show the difference if( sceneRoot ) { sceneRoot->removeChild(camera); } SbViewportRegion myViewport(w(), h()); SoGLRenderAction myRenderAction(myViewport); myRenderAction.apply(sceneRoot); if( camera ) { sceneRoot->insertChild(camera, 1); } } From jlim@kinabalu.csd.sgi.com Tue Nov 9 13:44:59 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Tue, 09 Nov 2004 13:45:03 -0800 (PST) Received: from omx2.sgi.com (omx2-ext.sgi.com [192.48.171.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA9LixLw022678 for ; Tue, 9 Nov 2004 13:44:59 -0800 Received: from kinabalu.csd.sgi.com (kinabalu.csd.sgi.com [134.16.212.96]) by omx2.sgi.com (8.12.11/8.12.9/linux-outbound_gateway-1.1) with ESMTP id iA9N19pZ001710 for ; Tue, 9 Nov 2004 15:01:09 -0800 Received: from kinabalu.csd.sgi.com (localhost.csd.sgi.com [127.0.0.1]) by kinabalu.csd.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id iA9Li6MB104474; Tue, 9 Nov 2004 13:44:26 -0800 (PST) Received: (from jlim@localhost) by kinabalu.csd.sgi.com (SGI-8.12.5/8.12.5/Submit) id iA9LhZd1316878; Tue, 9 Nov 2004 13:43:35 -0800 (PST) From: Jonathan Lim Message-Id: <200411092143.iA9LhZd1316878@kinabalu.csd.sgi.com> Subject: Re: Merging opengl and OpenInventor To: lcdumais@hotmail.com (Louis-Charles Dumais) Date: Tue, 9 Nov 2004 13:43:35 -0800 (PST) Cc: info-inventor-dev@oss.sgi.com In-Reply-To: from "Louis-Charles Dumais" at Nov 09, 2004 09:38:19 PM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 118 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: jlim@sgi.com Precedence: bulk X-list: info-inventor-dev On Tue Nov 9 13:38:19 2004, lcdumais@hotmail.com wrote: > > I`m having technical problems merging OpenGL and Open Inventor and I'm > asking for help to solve the problem. I could give a small paypal gift to > the person solving the “equation”. What I'm trying to do is to use OpenGL > and OpenInventor in the same GL context and using the same camera for OpenGL > and OpenInventor. This camera is the SoCamera from the OpenInventor package. Have you looked at the sample source code in /usr/share/src/Inventor/examples/Mentor/C++/17.2.GLCallback.c++ Jonathan From doug@d2.com Tue Nov 9 17:12:42 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Tue, 09 Nov 2004 17:12:46 -0800 (PST) Received: from redline.d2.com ([66.251.81.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAA1CgvC007810 for ; Tue, 9 Nov 2004 17:12:42 -0800 Received: from hermes.d2.com ([66.251.81.113]) by redline.d2.com (8.12.9/8.12.9) with ESMTP id iAA19UGn006116 for ; Tue, 9 Nov 2004 17:09:30 -0800 Received: from [172.16.51.142] (gluegun-l [172.16.51.142]) by hermes.d2.com (8.12.2/8.12.2) with ESMTP id iAA1CJ9I008510 for ; Tue, 9 Nov 2004 17:12:19 -0800 Message-ID: <41916AF3.2020406@d2.com> Date: Tue, 09 Nov 2004 17:12:19 -0800 From: Doug Roble User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: info-inventor-dev@oss.sgi.com Subject: Bug: SoTransform.c++ Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.43 X-Scanned-By: MIMEDefang 2.6 (www dot roaringpenguin dot com slash mimedefang) X-archive-position: 119 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: doug@d2.com Precedence: bulk X-list: info-inventor-dev We recently discovered a precision related issue with the SoTransform node and rendering to an OpenGL window. Specifically, in SoTransform::doAction there are the following lines: if (! rotation.isIgnored() && ! rotation.isDefault()) SoModelMatrixElement::rotateBy(state, this, rotation.getValue()); If the rotation is very small (a couple of degrees or less), small changes to the rotation will not change what is drawn on the screen after the SoTransform in the Inventor tree. What's happening is that the quaternion representation of the rotation is converted to an axis/angle representation in SoGLModelMatrixElement.c++ in the method SoGLModelMatrixElement::rotateEltBy. This is immediately handed to the OpenGL command glRotatef ( angle, x, y, z ) which then converts it to a matrix and multiplies it by the current Model Matrix. The conversion from quaternion to axis/angle uses an "acosf" function and the conversion from axis/angle to matrix uses sin and cos. (And glRotatef is one of those "not to be trusted" functions in OpenGL.) Precision is lost with these trig functions near zero. The result is that a rotation angle change from 0.020 to 0.023 doesn't change what's drawn on the screen at all. It should. Certainly, not that big of a deal, really, but it doesn't have to be that way. Here's the fix. Go to SoTransform.c++ and change the above lines to: if (! rotation.isIgnored() && ! rotation.isDefault()) { SbMatrix rot_mat; rotation.getValue ( rot_mat ); SoModelMatrixElement::mult ( state, this, rot_mat ); } Converting a quaternion directly into a matrix is much more accurate (no trig functions!) and probably just as fast. Alternately, and probably more general of a solution, is to change in SoGLModelMatrixElement.c++ void SoGLModelMatrixElement::rotateEltBy(const SbRotation &rotation) // //////////////////////////////////////////////////////////////////////// { SbVec3f axis; float angle; SoModelMatrixElement::rotateEltBy(rotation); rotation.getValue(axis, angle); glRotatef(angle * (180.0 / M_PI), axis[0], axis[1], axis[2]); } to void SoGLModelMatrixElement::rotateEltBy(const SbRotation &rotation) // //////////////////////////////////////////////////////////////////////// { SbMatrix rot_mat; SoModelMatrixElement::rotateEltBy(rotation); rotation.getValue( rot_mat ); glMultMatrixf((float *) rot_mat.getValue()); } Respectfully submitted, Doug P.S. We are using inventor-2.1.5-10, not the latest CVS image. Sorry if this has been dealt with. -- Doug Roble Computer Graphics Software Contraptioneer Digital Domain 310.314.2838 From pederb@sim.no Wed Nov 10 03:33:28 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Wed, 10 Nov 2004 03:33:34 -0800 (PST) Received: from sim.no (trh.sim.no [213.236.166.75]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAABXRKX022326 for ; Wed, 10 Nov 2004 03:33:28 -0800 Received: by sim.no (Postfix, from userid 1117) id 960CA356AD; Wed, 10 Nov 2004 12:33:08 +0100 (CET) Date: Wed, 10 Nov 2004 12:33:08 +0100 From: Peder Blekken To: Louis-Charles Dumais Cc: info-inventor-dev@oss.sgi.com Subject: Re: Merging opengl and OpenInventor Message-ID: <20041110113308.GA27634@sim.no> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-archive-position: 120 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: pederb@sim.no Precedence: bulk X-list: info-inventor-dev On Tue, Nov 09, 2004 at 09:38:19PM +0000, Louis-Charles Dumais wrote: : : I`m having technical problems merging OpenGL and Open Inventor and I'm : asking for help to solve the problem. I could give a small paypal gift to : the person solving the ?equation?. What I'm trying to do is to use OpenGL : and OpenInventor in the same GL context and using the same camera for : OpenGL and OpenInventor. This camera is the SoCamera from the OpenInventor : package. This mean something like this: : [...] : SbViewVolume cameraSbViewVolume; : cameraSbViewVolume = camera->getViewVolume(); You probably have to adjust the view volume based on the viewport mapping before you get the matrix. See http://doc.coin3d.org/Coin/classSoCamera.html#a4 For more information about this. Best regards, Peder From tomas.aguado@mi.madritel.es Thu Nov 11 01:28:11 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Thu, 11 Nov 2004 01:28:17 -0800 (PST) Received: from smtp08.retemail.es (smtp08.auna.com [62.81.186.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAB9S9G1025001 for ; Thu, 11 Nov 2004 01:28:10 -0800 Received: from [213.37.218.173] by smtp08.retemail.es (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041111092746.BNLB9899.smtp08.retemail.es@[213.37.218.173]> for ; Thu, 11 Nov 2004 10:27:46 +0100 Message-ID: <41933090.8060002@mi.madritel.es> Date: Thu, 11 Nov 2004 10:27:44 +0100 From: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: info-inventor-dev@oss.sgi.com Subject: The end of the SoMFVec3f X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 121 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: tomas.aguado@mi.madritel.es Precedence: bulk X-list: info-inventor-dev Hello everyone again! I'm adding new nodes to my program, now I want to add Nodes wich have SoMFVec3f Components, SoCoordinate3... How can I know the last item of a SoMFVector, It looks like the first is always 0,0,0 and from that one all is thrash, I've looked in the doc and google but couldn't find anything, so I'm bothering you again ¿Is there any function/way to get the last index of a SoMFVector? Thanks in advance Thanks in advance! Tomás Aguado Gómez Grupo de Modelado y Realidad Virtual http://dac.escet.urjc.es/investigacion/GMRV/ From tomas.aguado@mi.madritel.es Thu Nov 11 01:29:43 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Thu, 11 Nov 2004 01:29:47 -0800 (PST) Received: from smtp09.retemail.es (smtp09.auna.com [62.81.186.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAB9TgWX025084 for ; Thu, 11 Nov 2004 01:29:42 -0800 Received: from [213.37.218.173] by smtp09.retemail.es (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041111092918.BNLV24332.smtp09.retemail.es@[213.37.218.173]> for ; Thu, 11 Nov 2004 10:29:18 +0100 Message-ID: <419330ED.7090806@mi.madritel.es> Date: Thu, 11 Nov 2004 10:29:17 +0100 From: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: info-inventor-dev@oss.sgi.com Subject: The end of the SoMFVec3f X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 122 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: tomas.aguado@mi.madritel.es Precedence: bulk X-list: info-inventor-dev Hello everyone again! I'm adding new nodes to my program, now I want to add Nodes wich have SoMFVec3f Components, SoCoordinate3... How can I know the last item of a SoMFVector, It looks like the first is always 0,0,0 and from that one all is thrash, I've looked in the doc and google but couldn't find anything, so I'm bothering you again ¿Is there any function/way to get the last index of a SoMFVector? Thanks in advance Thanks in advance! Tomás Aguado Gómez Grupo de Modelado y Realidad Virtual http://dac.escet.urjc.es/investigacion/GMRV/ From larsa@sim.no Thu Nov 11 02:54:09 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Thu, 11 Nov 2004 02:54:14 -0800 (PST) Received: from sim.no (trh.sim.no [213.236.166.75]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iABAs86s029699 for ; Thu, 11 Nov 2004 02:54:08 -0800 Received: by sim.no (Postfix, from userid 2000) id 325852F75E; Thu, 11 Nov 2004 11:53:49 +0100 (CET) Date: Thu, 11 Nov 2004 11:53:49 +0100 From: "Lars J. Aas" To: =?iso-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= Cc: info-inventor-dev@oss.sgi.com Subject: Re: The end of the SoMFVec3f Message-ID: <20041111105349.GF11948@sim.no> References: <41933090.8060002@mi.madritel.es> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <41933090.8060002@mi.madritel.es> User-Agent: Mutt/1.5.6i X-archive-position: 123 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: larsa@sim.no Precedence: bulk X-list: info-inventor-dev Tomás Aguado Gómez wrote: : ¿Is there any function/way to get the last index of a SoMFVector? SoMFVec3f::getNum() tells you the last index + 1. Lars J From tomas.aguado@mi.madritel.es Thu Nov 25 00:35:07 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Thu, 25 Nov 2004 00:35:14 -0800 (PST) Received: from smtp09.retemail.es (smtp09.auna.com [62.81.186.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAP8Z5HW030439 for ; Thu, 25 Nov 2004 00:35:06 -0800 Received: from [213.37.112.28] by smtp09.retemail.es (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041125083439.KGI24586.smtp09.retemail.es@[213.37.112.28]> for ; Thu, 25 Nov 2004 09:34:39 +0100 Message-ID: <41A5991E.8030704@mi.madritel.es> Date: Thu, 25 Nov 2004 09:34:38 +0100 From: =?ISO-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: info-inventor-dev@oss.sgi.com Subject: Changing ViewportMapping properties X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 124 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: tomas.aguado@mi.madritel.es Precedence: bulk X-list: info-inventor-dev Hello everyone: My project is now highly advanced, but I can't change the SoCamera ViewporMapping property. As SoCamera is an abstract class I don't tr to access this property doing an SoCamera casting, I access it like this: SoPerspectiveCamera *Camera: ........... if (Camera->ViewportMapping.getValue()==SoCamera::CROP_VIEWPORT_FILL_FRAME) { ......... } But the compiler complains: form1.ui.h:166: error: invalid use of `enum SoCamera::ViewportMapping' ¿How can I change/read the ViewportMapping property ? Thanks in advance Tomás Aguado Gómez Grupo de Modelado y Realidad Virtual http://dac.escet.urjc.es/investigacion/GMRV/ From pederb@sim.no Thu Nov 25 08:17:23 2004 Received: with ECARTIS (v1.0.0; list info-inventor-dev); Thu, 25 Nov 2004 08:17:27 -0800 (PST) Received: from sim.no (ns.sim.no [213.236.166.74]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAPGHNNP010038 for ; Thu, 25 Nov 2004 08:17:23 -0800 Received: by sim.no (Postfix, from userid 1003) id 7486596F85; Thu, 25 Nov 2004 17:16:56 +0100 (CET) Date: Thu, 25 Nov 2004 17:16:56 +0100 From: Peder Blekken To: =?iso-8859-1?Q?Tom=E1s_Aguado_G=F3mez?= Cc: info-inventor-dev@oss.sgi.com Subject: Re: Changing ViewportMapping properties Message-ID: <20041125161656.GA17112@sim.no> References: <41A5991E.8030704@mi.madritel.es> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <41A5991E.8030704@mi.madritel.es> User-Agent: Mutt/1.5.6i X-archive-position: 125 X-ecartis-version: Ecartis v1.0.0 Sender: info-inventor-dev-bounce@oss.sgi.com Errors-to: info-inventor-dev-bounce@oss.sgi.com X-original-sender: pederb@sim.no Precedence: bulk X-list: info-inventor-dev On Thu, Nov 25, 2004 at 09:34:38AM +0100, Tomás Aguado Gómez wrote: : Hello everyone: : My project is now highly advanced, but I can't change the SoCamera : ViewporMapping property. As SoCamera is an abstract class I don't tr to : access this property doing an SoCamera casting, I access it like this: : SoPerspectiveCamera *Camera: : ........... : if : (Camera->ViewportMapping.getValue()==SoCamera::CROP_VIEWPORT_FILL_FRAME) ~ You used the Upper case letter here where you should use the lower case: (Camera->viewportMapping.getValue()==SoCamera::CROP_VIEWPORT_FILL_FRAME) Peder