On May 18, 5:54=A0pm, sheam <she...@[EMAIL PROTECTED]
> wrote:
> > The following code has the same logic, but I have inserted an extra
> > float between each vertex. =A0I tell opengl by setting the stride to
be
> > sizeof(float). =A0But the following make square scrambled.
[...]
> Ok, I figure it out. =A0stride is described in man page as bytes
between.
> =A0 But it is actually the number of bytes from start to start of next.
> i.e., sizeof(float)*4 worked.
It can also be 0 for tightly packed arrays:
stride Specifies the byte offset between consecutive
vertexes. If
stride is 0, the vertexes are understood to be
tightly packed
in the array. The initial value
is 0.
Since your second example isn't tightly packed, you needed to specify
the offset.
- Chris


|