info-inventor
[Top] [All Lists]

Re: Creating a movie

To: kfitch@xxxxxxxxxxx
Subject: Re: Creating a movie
From: kkonaka@xxxxxxxxxxxx
Date: Thu, 30 Aug 2001 16:38:36 -0400
Cc: info-inventor@xxxxxxxxxxx
In-reply-to: <3B8E9E49.3010900@segmail.com>
References: <3B8E9E49.3010900@segmail.com>
Sender: owner-inventor@xxxxxxxxxxx
hi!

similar code I've written several years ago looks something
like this; I'm not sure if this really helps -- but anyway:

void readLeft(void *, SoAction *)
{
  static int c;
  unsigned char *p;
  unsigned char *tail = (unsigned char *) ImageLeft + sizeof ImageLeft;

  // printf("readframe_left_buffer %d\n", c);
  
  glPushMatrix();
  glReadBuffer(GL_FRONT);
  glPixelStorei(GL_PACK_ALIGNMENT, 1);
  glReadPixels(0, 0, IMAGEW, IMAGEH, GL_RGBA, GL_UNSIGNED_BYTE, ImageLeft);
  for (p = (unsigned char *) ImageLeft; p < tail; )
    *(p++) &= 0xf0;
  glPopMatrix();
}


(actually I don't remember why I was doing
    *(p++) &= 0xf0;
part; maybe it's not necessary at all :p)

this routine itself is combined into the scenegraph
as a form of callback:

  ...
  SoCallback *callbackL = new SoCallback;
  callbackL->setCallback(readLeft);
  sceneL->addChild(callbackL);
  ...

ps.,
I also have noticed, doing this is probably what mostly everyone wants:

void ditherOff(void *, SoAction *)
{
  glDisable(GL_DITHER);
}

  ...
  SoCallback *callback1R = new SoCallback;
  callback1R->setCallback(ditherOff);
  sceneR->addChild(callback1R);
  ...

regards,
kenji @ fairfax, VA.

<Prev in Thread] Current Thread [Next in Thread>