vbo

Dynamic VBO in OpenGL

What is the best way to store dynamic data for use in VBO (or vertex arrays). Only examples I saw were 2D static arrays and the pointer to that array was used with next parameters as stride, bytes used for one element etc. I can use "dynamic" arrays so I can specify it's size on-air, but just once. My point is that if you, for example, a...

Problem using Eigen math library with opengl

Hi everybody, I'm currently trying to use Eigen math library with Opengl. I've some typedefs for Vector3f from Eigen, say Vec3, so that I can use it as a coord for my vertices. I also have a structure for a vertex with coord (vec3), normal (vec3) and color(vec4). When I try to use vertex arrays (I'll use VBOs once I make vertex arrays wo...

How to draw multiple objects using a VBO and a single OpenGL drawelements call?

I've read that it is possible to draw multiple objects using a vbo and using single drawelements call. I haven't found any examples of this. Right now I'm making a drawelements call per cube drawn which is killing my frame rate since I'm making the entire game out of them. Any help is appreciated, especially example code. ...

Different size of Buffers for Vertex and Texture Coordinates?

Is there any way to use differently sized buffers for glDrawElements? I somehow want to map vertices to texture coordinates, so that the texture coordinate buffer is able to be actually smaller than the vertex buffer. Example: vertex buffer has 16 vertices and the texture coordinate buffer has 6 vertices. vertex_buffer[0] -> texture_co...

Mesh deformation and VBOs

In my current project I render a series of basically cubic 3D models arranged in a grid. These 3D tiles form the walls of a dungeon level in a game, so they're not perfectly cubic, but I pay special attention to be certain all the edges line up and everything tiles correctly. I'm interested in implementing a height-map deformation, whi...