Questions tagged [vertex-array]

109 questions
1
vote
1 answer

C++ struct memory layout and OpenGL glVertexPointer?

I have following struct to store my vertex data. struct Rz3DContourNode { float x; //pos x float y; //pos y float z; //pos z float nx; //normal x float ny; //normal y float nz; //normal z }; I store list of vertices in STL vector…
Ashika Umanga Umagiliya
  • 8,988
  • 28
  • 102
  • 185
1
vote
1 answer

c++ with openGl can't render

I try to make the code cleaner by extracting the whole main Proramm in some classes. So I have a vertex buffer, index buffer and a shader class. Only the array buffer is in the main and it worked. Now I created a layout class and a vertex array…
Razielruss
  • 139
  • 1
  • 7
1
vote
1 answer

How do I get the indices of a vertex type object in ABAQUS?

Context: I am trying to make a script in Abaqus that will automatically create partitions between vertices for all faces. The partitioning won't be perfect, but the users will be able to delete the extra partitioning easily. Problem: v1 looks like a…
1
vote
0 answers

Motion field display on tile map SFML

I've tried to write a code that will draw a motion field by drawing green rectangles on a tile map everywhere where hero can go (hero can't move diagonally). It's very hard to me I have read: https://en.wikipedia.org/wiki/Taxicab_geometry but I…
BigFatPig
  • 11
  • 2
1
vote
1 answer

OpenGL ES2 Vertex Array Objects help

I am having trouble understanding how to use VAO's in OpenGL ES2 (on iOS) and getting them to work. My current rendering setup looks like this (in pseudocode): Initialization: foreach VBO: glGenBuffers(); Rendering a frame: // Render VBO…
Jonesy
  • 83
  • 4
1
vote
1 answer

C++ OpenGL, why isn't the vertex array binding the vertex buffer?

I'm pretty sure that the vertex array is not binding the vertex buffer because if I comment out the line where I unbind the vertex buffer it works perfectly fine, which suggests that the vertex array isn't binding the vertex buffer properly. Here is…
MaximV
  • 155
  • 11
1
vote
0 answers

How to assemble wavefront .obj data into element and vertex arrays of minimal size?

I'm having trouble putting the data inside a wavefront .obj file together. These are the vec3 and vec2 definitions template struct vec3 { T x; T y; T z; }; template struct vec2 { T x; T y; }; Used…
Big Temp
  • 434
  • 4
  • 12
1
vote
1 answer

OpenGL: Using vertex array to draw a cube causes graphical glitch

When trying to draw the following quads in OpenGL using a vertex array (instead of using immediate mode rendering), I get the graphical glitch (line segment) shown in the picture, which can be found in the second link below. The line seems to extend…
meow
  • 13
  • 1
  • 3
1
vote
4 answers

how to order vertices in a simple, non-convex polygon

I have a problem where I have a series of points for a simple, non-convex polygon (I hope I have the terminology correct). But the points are not necessarily in order (ie, clockwise or counterclockwise). For Flash's drawing API to correctly draw a…
jpwrunyan
  • 530
  • 5
  • 22
1
vote
0 answers

OpenGL Vertex array not displaying properly

I have an OpenGL Graphics assignment and well for some reason I'm trying to create a flat square on the X,Z plane (Y is just 1.0 for every vertices). I've tried making the problem smaller by just trying to create 2 flat vertices instead of four, and…
1
vote
1 answer

JOGL glArrayElement point providing 0,0,0

I have a JOGL opengl problem, I'm trying to use Vertex Arrays, but whenever I use glArrayElement (Note: glDrawElements doesn't work either.), it gives the point 0,0,0. Important code. I'm assuming a window is initialized and a reshape function is…
AFS_Three
  • 11
  • 2
1
vote
1 answer

Combining Primitives in SFML Vertex Arrays

The documentation for SFML states that you can combine primitives to create vertex arrays. I think what they are referring to is the fact that multiple Triangles can be grouped into a TriangleFan or TriangleStrip. I'm wondering whether there is a…
Larry Turtis
  • 1,907
  • 13
  • 26
1
vote
2 answers

OpenGL Vertex Arrays

I have a struct called Point (which happens to be a Python Extension) that looks like this: struct Point { PyObject_HEAD // Macro that expands to include a few more members double x; double y; }; And I have another struct that will…
Brad Zeis
  • 10,085
  • 5
  • 26
  • 20
1
vote
3 answers

Do I have to use glGenVertexArray in opengl

GLuint VertexArrayID; glGenVertexArrays(1, &VertexArrayID); glBindVertexArray(VertexArrayID); As you can see from the above code, some tutorials use this before using opengl. But a tutorial that I am following, directly uses glGenBuffers method and…
Ozum Safa
  • 1,458
  • 2
  • 15
  • 27
1
vote
1 answer

WebGL - which API to use?

I want to draw multiple polygon shapes (where each shape has it's own set of vertices). I want to be able to position these shapes independently of each other. Which API can i use to set the a_Position for the vertex shader? A) gl.vertexAttrib3f B)…
AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140