Inventor and the overlay planes

Inventor and the overlay planes

Post by Helen Salt » Sun, 09 May 1993 08:26:09



Hi,

How do I write to the overlay planes from Inventor?  I posted this
question befor (about 10 days ago), but haven't received a reply.  Is
it possible?

Thanks

--
   Helen Salter                     University Computing Services

   604-822-5736                     6356 Agricultural Road
   Fax: 604-822-5116                Vancouver B.C.   Canada  V6T 1Z2

 
 
 

Inventor and the overlay planes

Post by Helen Salt » Sun, 09 May 1993 08:44:10


Hi,

I am having a problem using the Text2 class in Inventor (which I think
is a great toolkit, by the way).  

It seems that I can always pick the text, no matter what its position.
However, the text's bounding box is of a fixed size, often in a
weird orientation, and doesn't always "enclose" the text. So clicking
on the same point that selected the text doesn't always select a
manipulator that is attached to it, especially if the text is far away.
Also, if the text is really close, it is hard to deselect it.

So does Text2 override SoPickAction?  Does it have it's own bounding
box which corresponds more closely to the appearance of the text?
If so, is there any way I can get access to it? Or is it just too
late on a Friday and I am missing something obvious.

All help appreciated.

Thanks

--
   Helen Salter                     University Computing Services

   604-822-5736                     6356 Agricultural Road
   Fax: 604-822-5116                Vancouver B.C.   Canada  V6T 1Z2

 
 
 

Inventor and the overlay planes

Post by David Mo » Sun, 09 May 1993 09:29:28



>How do I write to the overlay planes from Inventor?  I posted this
>question befor (about 10 days ago), but haven't received a reply.  Is
>it possible?

Unfortunately, the Inventor 1.0 SoXtRenderArea widget does not
provide support for drawing to the overlay planes. This will be
provided in Inventor 2.0.

The only way to draw in the overlay planes in Inventor 1.0 is if
you create your window without using the SoXt component library.

Sorry,
  David

 
 
 

Inventor and the overlay planes

Post by Gavin Be » Sun, 09 May 1993 09:57:40



Quote:>How do I write to the overlay planes from Inventor?  I posted this
>question befor (about 10 days ago), but haven't received a reply.  Is
>it possible?

You'll need to setup the GL to draw into the overlay planes (either by
calling drawmode() if you are using winopen()-type window calls, or by
doing some X stuff you'll have to ask somebody else about if you are
using GLX).

Then, you'll have to tell Inventor not to do any lighting by inserting
a LightModel { model BASE_COLOR } node at the beginning of your scene
graph.

There is no Inventor support for setting colors compatible with
the overlay planes.  If the GL is in colormap mode (all overlays are
colormap, not RGB), Inventor uses a portion of the standard GL color
map to draw objects.  This doesn't work for overlay windows, so you
will need to rely on your own scheme for setting colors appropriate
for the overlay window.  Either insert Callback nodes into the scene
graph at appropriate points to make GL color() calls, or derive your
own kind of node (a ColorIndex node) that makes GL color() calls.  In
any case, you should not try to use the standard Inventor nodes for
setting object colors (BaseColor or Material), AND don't forget to
make appropriate mapcolor() (or the GLX equivalent) calls to setup the
overlay colormap.

If your overlay graphics are simple and you don't need to read them
from file, pick them, etc., then it might be easier to just use the GL
to draw into the overlay planes.
--

 
 
 

Inventor and the overlay planes

Post by Paul S. Strau » Wed, 12 May 1993 07:40:19


|> Hi,
|>
|> I am having a problem using the Text2 class in Inventor (which I think
|> is a great toolkit, by the way).  
|>
|> It seems that I can always pick the text, no matter what its position.
|> However, the text's bounding box is of a fixed size, often in a
|> weird orientation, and doesn't always "enclose" the text. So clicking
|> on the same point that selected the text doesn't always select a
|> manipulator that is attached to it, especially if the text is far away.
|> Also, if the text is really close, it is hard to deselect it.
|>
|> So does Text2 override SoPickAction?  Does it have it's own bounding
|> box which corresponds more closely to the appearance of the text?
|> If so, is there any way I can get access to it? Or is it just too
|> late on a Friday and I am missing something obvious.

If you are using SoPickAction directly to do the picking, you have to
be careful to pass the correct window size to the constructor. Since
2D text is screen based, its 3D bounding box depends on the window
size. Picking relies on the SoGetBoundingBoxAction's results when
intersecting the text's bounding box.

If you are not using an SoPickAction directly (or if you are passing
in the window size correctly), I can't really tell what the problem
is. Could you follow up (or send e-mail) with more details?

|>    Helen Salter                     University Computing Services

|>    604-822-5736                     6356 Agricultural Road
|>    Fax: 604-822-5116                Vancouver B.C.   Canada  V6T 1Z2

----

  "A horse walked into a bar, and the bartender said, "Why the long face?,"
   and the horse kicked him to death. True story."  - Allan Havey

 
 
 

1. Inventor and overlay planes

Hi all,

Using Inventor1.0 is there anyway I can get a shape node to draw into
the overlay planes?  I tried the following:

void PickGraphic::GLRender( SoGLRenderAction * )
{
   // Make sure the material is sent to the GL if it's going to
   // be used.  [Copied from example Pyramid]
   if (lb->getLightModel() != SoLightModelElement::DEPTH )
     mb->send();

   lmcolor(LMC_AD);

   drawmode(OVERDRAW); // draw into the overlay plane

   switch (sb->getDrawStyle())
   {
    case SoDrawStyleElement::FILLED:
    case SoDrawStyleElement::LINES:
      {
         cpack(0);
         clear();

         // Draw the lines
         cpack(0xffff0000); //blue

         bgnline();
         // Coord3d is a struct of x, y, z
         for (Coord3d *pt = _interface->firstPt();
              pt != NULL;
              pt = _interface->nextPt()){
            SbVec3f temp (pt->x, pt->y, pt->z);
            v3f(temp.getValue());
         }
         endline();
      }
    break;
    case SoDrawStyleElement::POINTS:
     {
        ;
     }
     break;

    case SoDrawStyleElement::INVISIBLE:
     break;
   }

    drawmode(NORMALDRAW);

but I couldn't seem to get anything to draw.  Any suggestions?  Will I
be able to do such things in 2.0?
--

Shell Development Company, Bellaire Research Center
3737 Bellaire Blvd., Houston, TX 77025          (Voice: 713 245-7167)

2. Need a color tool

3. Inventor: Overlay planes

4. Gnuplot for Macintosh

5. Inventor: Using Overlay Planes....

6. question concerning blending functions

7. Overlay planes & OpenGL 1.2 drivers

8. overlay / underlay / cursor / popup planes

9. Reading the overlay planes with glReadPixels

10. OpenGL & overlay planes

11. animation problem w/ overlay planes

12. Use overlay planes in mixed model GlxMDraw windows