Questions tagged [vertex-array]

109 questions
1
vote
0 answers

Vertex Array Object (VAO) on OpenGLES mysteriously becoming invalid almost immediately after construction

I have a very strange VAO problem on iOS. The problem is that a freshly created VAO becomes invalid almost immediately after creation. I have a piece of code that creates a VAO in the usual way using glGenVertexArrayOES(1, &vao). It then binds it…
Tom Hammersley
  • 279
  • 2
  • 8
1
vote
2 answers

OpenGL: Rendering thousands of cubes with Vertex Arrays, not working too well

I am attempting to use vertex arrays to render about 2097152 cubes with LWJGL (no not all of them at once). I have implemented numerous types of polygon culling to enhance my performance from around 2 FPS to about 60 FPS. Throughout this project,…
CoderTheTyler
  • 839
  • 2
  • 11
  • 30
1
vote
2 answers

Why does a plane's vertexdata contain 52 entries?

I'm new in 3D land and have experimented with several engines to get started. I have settled on away3D for it's simplicty. I am creating creating a plane and sticking a texture on it, and want to be able to animate the texture by changing the UV…
omgnoseat
  • 361
  • 2
  • 19
1
vote
1 answer

Using glVertexAttribPointer to draw model in OpenGL 2.0 with shaders

I've knocked up object orientated iOS app loosely based on the default template which uses OpenGLES 2.0 and also uses Shaders but I'm trying to load in a model where I used to call this: #import "./sphere_model.h" glVertexPointer(3, GL_FLOAT, 0,…
ingh.am
  • 25,981
  • 43
  • 130
  • 177
1
vote
1 answer

Draw a series of points with vertex array : nothing displayed

I'm trying for exercise to do the following: there is an array of points, expressed through couples of GLfloats.The user should click in a point in the window to make another points appear.When a point is added, the window shall be redrawn and the…
Ramy Al Zuhouri
  • 21,580
  • 26
  • 105
  • 187
1
vote
1 answer

Understanding opengl instanced arrays

given std::vector cubeIndices; struct FaceGroup { unsigned int face_index; unsigned int start_index; size_t length; // comparison operators omitted }; std::set::iterator i; GLuint attribIndex; I was rendering each…
larvyde
  • 811
  • 1
  • 6
  • 19
1
vote
1 answer

In the stock OpenGL ES app on iOS 5.1, are they really using the vertex arrays they declare?

In the stock OpenGL ES app you get (when you create a new "OpenGL game" in XCode), in the setupGL function, there is: glEnable(GL_DEPTH_TEST); //glGenVertexArraysOES( 1, &_vertexArray ) ; // va's are not being used! //glBindVertexArrayOES(…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
1
vote
2 answers

How does OpenGL know what type each vertex buffer object is?

I've just read through a tutorial about Vertex Array Objects and Vertex Buffer Objects, and I can't work out from the following code how OpenGL knows the first VBO (vertexBufferObjID[0]) represents vertex coordinates, and the second VBO…
Mark Ingram
  • 71,849
  • 51
  • 176
  • 230
1
vote
1 answer

How is index data handled in glDrawElements?

I know that when glDrawElements is called it uses a buffer of indices to determine what vertices to draw in what order. My question is how those indices are applied to texture, normal, and color attributes. Is it possible to set another index array…
dagronlund
  • 1,612
  • 3
  • 13
  • 15
1
vote
1 answer

Problems with making 2D terrain in OpenGL

Some time ago I asked this question about how to make a 2D terrain with opengl vertices. I got a good answer, but when trying it out it didn't draw anything, and I can't figure out what's wrong, or how to fix it. I have this now : public class…
user717572
  • 3,626
  • 7
  • 35
  • 60
0
votes
1 answer

OpenGL scaling vertex arrays

I have a vertex array that I draw as follows (I am working to convert this to a single glDrawArrays call, so that is not the issue here): gl.glVertexPointer(3, GL.GL_FLOAT, 0, buff); for ( int i = 0; i < numPoints; i++ ) { …
Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
0
votes
0 answers

Unsure why 3x3 matrix as a vertex attribute in GLSL is not working

I am trying to make a simple 2D rectangle renderer in OpenGL. I'm storing transform of each rectangle as a 3x3 matrix inside a buffer object, and passing into my vertex shader as a vertex attribute. The problem is that nothing is being displayed,…
0
votes
1 answer

Odd results plotting Array with glVertexPointer stride variable

I have an Nx4 array of vertices that I'd like to plot using glVertexArray and glDrawArray. as a 2D scatter plot. I currently initialize the array like so: GLint data[4][MAX_N_POINT]; for (int j=0; j
slayton
  • 20,123
  • 10
  • 60
  • 89
0
votes
0 answers

How would I draw a circle using an SFML vertex array?

For a university assignment, I need to draw various shapes using a vertex array, and one such shape that they have asked for is a circle. I know that I would need to use sf::TriangleFan but I'm not super experienced with SFML, so how would I go…
AnishG555
  • 1
  • 1
0
votes
2 answers

OpenGL ES2 GLubyte colors in vertex array not working

Apple suggests using the GLubyte data type for color data on iOS, so I am trying to get this to work. The result I get is that all color components <255 are completely black, and only components of colors set to 255 really are that color. What I am…
Jonesy
  • 83
  • 4