SoCallback and SoSelection

SoCallback and SoSelection

Post by Marc Eilhar » Tue, 29 Apr 2003 22:53:15


Could anybody help me by following problem:

My goal is to create a Viewer which is able to read a Vrml-File with
Callbackfunctions in it!
The Viewer must catch the actions before they are applied and send them to
a Server (over Sockets).
After retrieving the action the Server just sends the actions back to the
Client which apply the action!

Dont worry I just wanted to know if

- i can make this with SoCallback in the Vrml-File (Are they really stored
in the Vrml-File??),
- catching the Actions with SoSelection->addSelectionCallback - and
applying the action with SoCallback->doAction()

or is there a better way?

Using M2, Opera's revolutionary e-mail client:


1. OpenGL textures in SoCallback dont show up on SGI

Hi all,
I've tried to draw a textured rectangle with OpenGL in a callback func
registered to an SoCallback node. The rectangle itself shows up but the
texture doesn't. The thing is - it works on NT (with TGSs Inventor
Implementation) but it doesn't work on SGI.
Did anybody have the same problems ?

Thanks in advance,


Here is my source code :

The render func (registerd at SoCallback) :

static void renderCBFunc(void *userData, SoAction *action)
// check if action is a render action
if (action->isOfType(SoGLRenderAction::getClassTypeId())) {
   glBindTexture(GL_TEXTURE_2D, texName[0]);
   glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
   glTexCoord2f(0.0, 1.0); glVertex3f(-2.0, 1.0, 0.0);
   glTexCoord2f(1.0, 1.0); glVertex3f(0.0, 1.0, 0.0);
   glTexCoord2f(1.0, 0.0); glVertex3f(0.0, -1.0, 0.0);

The texture generation

static GLubyte checkImage[checkImageHeight][checkImageWidth][4];

static GLuint texName[1];

void makeCheckImages(void)
   int i, j, c;

   for (i = 0; i < checkImageHeight; i++) {
      for (j = 0; j < checkImageWidth; j++) {
         c = ((((i&0x8)==0)^((j&0x8))==0))*255;
         checkImage[i][j][0] = (GLubyte) c;
         checkImage[i][j][1] = (GLubyte) c;
         checkImage[i][j][2] = (GLubyte) c;
         checkImage[i][j][3] = (GLubyte) 255;

The initialization
void init(void)
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

   glGenTextures(1, texName);
   glBindTexture(GL_TEXTURE_2D, texName[0]);
   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth,
                checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,

Sent via
Before you buy.

2. I need a plugin or method to......

3. SoCallback and SoSwitch

4. PC 3D Graphics Accelerators FAQ (Part 1 of 2)

5. SoCallback and the bounding box

6. Histograms

7. SoCallback texture information

8. How to respond to SoGetBoundingBoxAction in SoCallback?

9. SoCallback

10. Problems with SoCallback/SoSearchAction

11. SoCallback (glClipPlane)

12. OpenInventor: Problems with SoSelection->setPickFilterCallback