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

Robert Osfield robert.osfield at gmail.com
Thu Jul 7 09:59:01 PDT 2016


Hi Florian,

On 7 July 2016 at 15:02, Florian Castellane
<fixed-term.florian.castellane at bosch.com> wrote:
> 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.

Your use of the word indices in this context is a bit confusing as I
don't think you mean indices, but perhaps you do....  A texcoord array
doesn't normally contain indices, but texture coordinates.  A
DrawElementsUShort contains indices.  You could possible use a
texcoord array as a float or int array and use these as indices to
look up textures or uniform arrays in shaders but I'm guessing you
aren't doing this.

As for the reason why things aren't working for you.  At this stage
nothing we've suggested has fixed the problem, it could well be that
you are doing something wrong that we are witness to.  For this the
only way to make sure others know what you mean would be to create a
small example that others can compile and run and witness first hand
what is going wrong.

As a general note. for dynamic texture coord data consider not using
display lists or VBO's, just let the array data be passed to OpenGL as
a vertex/tex coordinate array on each frame.

Robert.



More information about the osg-users mailing list