Hi,

On Tuesday 26 June 2007 12:01, Benjamin Cabut wrote:
> Hello,
>
>     I use the chessboard of the sample "osganimate".
>     And I would like to add a Callback that get some value in a LUA script
> to change the color of the Chessboard.
>
>     I get the geometry from the Drawable, then the colorArray.
>     I change the color ( (*colors)[0].set())
>     But the color of the ChessBoard is not affected...
>
>     I tried in a UpdateCallBack and in a DrawableUpdateCallback, with same
> effect, and I noticed that I only go once in the DrawableUpdateCallBack
>
>     Seems the color is memorized and I can't say the system it changed...
>
>     Could you explain me why?  and how should I do?

Dirty the display list on update or switch it of completely.

You get there only once when the display list is generated.

What to do depends on how often the updates really happen. If you really have 
to update that color on every frame it is better to disable display lists.
If you nedd to update only every now and then, it might be worth to generate 
the display list and use it for some frames.

The functions

osg::Drawable::dirtyDisplayList()

and

osg::Drawable::setUseDisplayList(bool)

are your friend.

   Greetings

       Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to