[osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

Florian Castellane fixed-term.florian.castellane at bosch.com
Thu Jul 7 07:02:27 PDT 2016


Hi everyone, thanks for the tips.

@Sebastian:

Code:
geometry->getPrimitiveSet(0)->setDataVariance(DataVariance::DYNAMIC) ;


did not solve the problem unfortunately. As Robert points out, I'm not sure that is the problem here.

@Trajce: 

Code:
texArray->getVertexBufferObject()->dirty();


didn't solve it either, and I'm not sure why since setTexCoords does update the VBO so it should be calling that method itself.

@Robert:
Let me explain a bit more then. :) 

I am modifying some indices of a texture coordinate array that correspond to a subset of my floor that is divided into several parts (here, we are working on the center part. Other parts have already had their parameters set up). 
This array has been initialized before (hence the getTexCoordArray() call) and already filled with some data. I access it to give texture coordinates for all the indices of the floor center, which are yet unset (they are set to (-1,-1)). This lets me apply my texture to the floor center.

Thanks again.

Best regards,
Florian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68042#68042








More information about the osg-users mailing list