Questions tagged [index-buffer]

The index buffer contains integers, three for each shape in a mesh of structures, which reference the various attribute buffers (position, color, UV coordinates, other UV coordinates, normal, …).

The index buffer contains integers, three for each shape in a mesh of structures, which reference the various attribute buffers (position, color, UV coordinates, other UV coordinates, normal, …).

39 questions
0
votes
1 answer

Fastest algorithm to lookup which triangles share a vertex

There are index and vertex buffers like the ones described here to draw triangles. Frequently in my code, I need to lookup which triangles share a specific vertex. The most basic approach is: To loop over index buffer and find triangles which…
Megidd
  • 7,089
  • 6
  • 65
  • 142
0
votes
0 answers

How can I draw two triangles using index buffer?

I wish to draw two triangles (having one common vertex) with two different colors using an index buffer. How can I do so? Without using an index buffer, two such triangles can easily be drawn by just repeating the common vertex data. Yes, I can…
Majis
  • 203
  • 1
  • 2
  • 6
0
votes
0 answers

DX11: Indexed drawing doesn't produce any visual output

For our student project I've been tinkering with an OBJ-loader in order to import models into our application. It loads without issues, and drawing it kind of works without index (the model is obviously not represented correctly because I'm not…
Elias Finoli
  • 121
  • 9
0
votes
1 answer

Offset in glDrawElements using LWJGL

I'm trying to render only some of the Indices stored in the index buffer of an VAO. glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, 0); I know that the second parameter is the count of vertices to draw, in this case one triangle and the last…
Geosearchef
  • 600
  • 1
  • 5
  • 22
0
votes
1 answer

Drawing individual polygons - buildings, country borders, etc on a map (looping through index buffer) in WebGL

I am using WebGL to draw lines and polygons on a canvas layer on top of my map for OSM data. I have written a query that returns a list of polygons from the planet_osm_polygon table. It returns the list as JSON objects. I am using …
user4726090
  • 27
  • 3
  • 9
0
votes
2 answers

Draw cylinder lateral with glDrawElements, Index Buffer and enabled GL_CULL_FACE

I need this: And I HAVE TO use glDrawElements and this: glEnable(GL_CULL_FACE). What I tried: ... glm::vec3 CMyApp::GetCylinderUV(float u, float v) { u *= 2* 3.1415f; float r = 1; return glm::vec3(r * cosf(u), 2 * v, r *…
Zsolt Mester
  • 1,053
  • 9
  • 14
0
votes
0 answers

Is it possible to bind a segment of Index Buffer Object (IBO)?

Let's imagine a scene composed by 3 objects (2 boxes and a plane). These 3 meshes are stored within a unique Vertex Buffer Object (VBO) as follow: VBO(id = 1) {[Box_1_vertex][Box_2_vertex][Box_3_vertex]} I currently use a specific Index Buffer…
user1364743
  • 5,283
  • 6
  • 51
  • 90
-1
votes
1 answer

Three.JS r97 Issue GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 2

I'm posting this issue as a last resort. I have read ALL similar topics from the site. Here is the problem: I'm using an older version of Three.JS (r97) and updating to latest is not an option. I'm working on a voxel generator which receives as…
Simonobi
  • 11
  • 4
-1
votes
1 answer

DirectX Large Models > 64k C++

My DirectX11 C++ Engine uses uint16_t (short) for the vertex index buffer and all was working well. I've evolved the models I use and now they have grown with over 64k indexes. I've changed all references to my index buffer from short to uint32_t…
Mark
  • 166
  • 1
  • 13
1 2
3