3d-stereo integration (anaglyph)

Hi all,

I would like to create an engine (like BSDYEngine) with an anaglyph
render. I have tried to integrate an anaglyph code which works in
standalone. But it lacks me how Avogadro renders to the screen (not just
drawMultiCylinder() which call a glCall).

Which method calls renderOpaque() in engine, and paint() in tool ? What
are the files which “organize” the paint() call ?

Now I try to render anaglyph in extern windows which communicates with
Avogadro.

Regards.

Mickaël Gadroy

I would like to create an engine (like BSDYEngine) with an anaglyph render. I have tried to integrate an anaglyph code which works in standalone. But it lacks me how Avogadro renders to the screen (not just drawMultiCylinder() which call a glCall).

Actually, what you want to do is to create another Painter class. This provides the underlying OpenGL calls for rendering to the screen.

Take a look at the GLPainter and PovRayPainter and see if it does what you want. We’ve had some discussions about making sure all the OpenGL calls (including initialization, etc.) are encompassed into Painter.

Hope that helps,
-Geoff

Take a look at the GLPainter and PovRayPainter and see if it does what you want. We’ve had some discussions about making sure all the OpenGL calls (including initialization, etc.) are encompassed into Painter.

It would be really great. Currently a lot of OpenGL calls are in engines, and I’m afraid they may produce improper effects with proposed painter


Regards,
Konstantin

Hi all,

I’m sorry to respond so late. I’ve found the way to develop an anaglyph
render in Avogadro.
Currently, I have did it :
• By using an engine class,
⁃ initialize the 3D-stereo render environment
⁃ put the code of 3D-stereo (part1)
⁃ put the wanted object
⁃ put the code of 3D-stereo (part2)
⁃ initialize the Avogadro render environment

Before using an engine class, I have searched how to manipulate GLPainter
and PovPainter class. There are many problems :

•    The current architecture of GLWidget class has some lack of the use

of the Painter class :
⁃ No setter to change the current Painter
⁃ I don’t find the way to insert an other painter in the render
process of Avogadro
⁃ I do not see the utility of GLWidget attribute m_current (which
gets a setter)
⁃ The class PovPainter has no relation with the Avogadro render
process. It just writes in a file … The PovPainter name confuses me.

•    A simple class diagram showing the relations between the GLWidget

and Painter class :

 ________________________________        _______________________

| GLWidget                       | <>-- | GLWidgetPainter       | <>-- |

GLPainter | --> | Painter |
-------------------------------- -----------------------


| - GLWidgetPainter const * d    |      | - GLPainter *painter  |      |

… | | |
| … | | … |
| | ---------
--------------------------------- -----------------------

  ⁃    GLWidgetPainter will be more "developer friendly" if it looks

like :

     _____________________________
    | GLWidgetPainter             |
     -----------------------------
    | - Painter **painter         |
    | ...                         |
    | + addPainter( Painter* )    |
    | + selectPainter( int which) |
    | ...                         |
     ------------------------------

I don’t know if this suggestions can help.
When I distrib the code, I will contact the avogadro-discuss forum.
(Before Christmas.)

Best Regards,

Mickaël Gadroy

Before using an engine class, I have searched how to manipulate GLPainter and PovPainter class. There are many problems :
•    The current architecture of GLWidget class has some lack of the use of the Painter class : 

  ⁃    No setter to change the current Painter

  ⁃    I don't find the way to insert an other painter in the render process of Avogadro

   ⁃    I do not see the utility of GLWidget attribute m_current (which gets a setter)

  ⁃    The class PovPainter has no relation with the Avogadro render process. It just writes in a file … The PovPainter name confuses me. 
I'm afraid your understanding of rendering architecture is incomplete. GLWidget doesn't have any notion what Painter is currently used (thus it must not change it!), it uses that one which is specified by user.m_current is a pointer to "current" instance of GLWidget - in the extension you need to use GLWidget::current() in order to get GLWidget from the same Avogadro's window where your extension runsEverything is OK with PovPainter, it's just another representation of scene. --Regards,Konstantin