Talk About Network

Google





Graphics > OpenGL 3D API > Re: glDrawArray...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 4754 of 5061
Post > Topic >>

Re: glDrawArrays, seems to ignore stride parameter?

by crjjrc <crjjrc@[EMAIL PROTECTED] > May 19, 2008 at 05:26 AM

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
 




 3 Posts in Topic:
glDrawArrays, seems to ignore stride parameter?
sheam <shea08@[EMAIL P  2008-05-18 22:52:14 
Re: glDrawArrays, seems to ignore stride parameter?
sheam <shea08@[EMAIL P  2008-05-18 22:54:40 
Re: glDrawArrays, seems to ignore stride parameter?
crjjrc <crjjrc@[EMAIL   2008-05-19 05:26:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 15:05:39 PST 2009.