Hi,
try image->dirty() after you've changed it. It's normally not needed to
texture->setImage(image); again.
jp
On 15/01/2012 11:12, Kevin Williams wrote:
As an experiment I have got a single triangle, and applied a list of colours as
a texture across it. (I modifed the osgtexture1d example.) [The idea is now to
create thin triangles representing each azimuth cell, and update the texture
colours on each triangle as measurements become available.]
I've been trying to modify the colour list on the fly by changing entries in
the image defining the texture, but this change is not rendered. Just for the
experiment I included this code in the animate callback:
osg::Vec4* dataPtr = (osg::Vec4*)image->data();
dataPtr[0] = osg::Vec4(float(rand())/RAND_MAX,float(rand())/RAND_MAX,
float(rand())/RAND_MAX,1);
texture->setImage(image);
What is the correct way to change textures while running?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44841#44841
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org