Questions tagged [vertex]

A vertex is a single point in a 3D object, used for simple model creation or advanced animation systems.

677 questions
58
votes
2 answers

How does glDrawArrays know what to draw?

I am following some begginer OpenGL tutorials, and am a bit confused about this snippet of code: glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObject); //Bind GL_ARRAY_BUFFER to our handle glEnableVertexAttribArray(0); //? glVertexAttribPointer(0, 3,…
w4etwetewtwet
  • 1,201
  • 1
  • 10
  • 19
42
votes
3 answers

What is the difference between a node and a vertex?

What is the difference (if any) between a node and a vertex? I can't find the answer after looking at countless sites! Even my book doesn't specify it so I am kind of lost! It is worth mentioning that I am looking for the difference besides the fact…
Marc Rasmussen
  • 17,383
  • 66
  • 172
  • 305
41
votes
1 answer

When should I use indexed arrays of OpenGL vertices?

I'm trying to get a clear idea of when I should be using indexed arrays of OpenGL vertices, drawn with gl[Multi]DrawElements and the like, versus when I should simply use contiguous arrays of vertices, drawn with gl[Multi]DrawArrays. (Update: The…
Jonathan Hartley
  • 13,922
  • 8
  • 71
  • 77
31
votes
6 answers

Implementing Depth First Search into C# using List and Stack

I want to create a depth first search which I have been somewhat successful in. Here is my code so far (Except my constructor, note the Vertex and Edge classes only contain properties, nothing important to post here): private Stack
Dumpen
  • 1,540
  • 5
  • 23
  • 34
22
votes
2 answers

How can I animate an object in WebGL (modify specific vertices NOT full transforms)

Okay, I am new to 3D graphics and I want to animate individual specific vertices in a model (NOT whole model transforms). My script is largely based off the NEHE webgl tutorial. In this tutorial all object vertices are stored in a buffer, which is…
Josh Mc
  • 8,668
  • 6
  • 46
  • 60
21
votes
3 answers

OpenGL - Associate Texture Coordinates Array With Index Array Rather Than Vertex Array?

Whenever we use an index array to render textured polygons with glDraw*Elements*, we can provide an array of vertices and an array of texture coordinates. Then each index in the index array refers to a vertex at some position in the vertex array and…
Fejwin
  • 687
  • 1
  • 8
  • 14
16
votes
2 answers

OpenGL 3/4 glVertexAttribPointer stride and offset miscalculation

I am having a problem getting my vertex array pointed to properly: const float vertices[] = { /* position */ 0.75f, 0.75f, 0.0f, 1.0f, /* color */ 1.0f, 0.0f, 0.0f, 1.0f, /* position */ 0.75f, -0.75f, 0.0f, 1.0f, /* color */ 0.0f, 1.0f, 0.0f,…
user2350858
  • 611
  • 2
  • 10
  • 15
13
votes
3 answers

OpenGL Shading Language Different Types of Variable (Qualifiers)

I've been writing programs using OpenGL. Recently, I started learning OpenGL Shading Language. I'm a newbie; so please be detailed in your answers. My questions are: What are different types of variable (qualifiers) in GLSL? What are they used…
Einiosaurus
  • 191
  • 2
  • 12
13
votes
5 answers

OpenGL: Single vertex attribute for multiple vertices?

I have a vertex shader that accepts the following attributes: a_posCoord: vertex position a_texCoord: texture coordinate (passed to the fragment shader) a_alpha: transparency factor (passed to the fragment shader) The objects I'm rendering are all…
namuol
  • 9,156
  • 6
  • 38
  • 54
12
votes
1 answer

Flip upside down vertex shader (GLES)

Given the next vertex shader, what is the simplest, most efficient and fastest way to flip the coordinates upside down, so the fragment shader will produce and upside down image? attribute vec4 a_position; attribute vec2 a_texcoord; …
PerracoLabs
  • 12,362
  • 12
  • 57
  • 107
12
votes
3 answers

How can I find a list of all the uniforms in OpenGL es 2.0 vertex shader pro

I'm trying to learn how to program vertex shaders. In Apple's sample project they have a line to set a glUniform1f(uniforms[UNIFORM_TRANSLATE], (Glfloat)transY); Then this value is used in // value passt in f //…
Ted pottel
  • 6,503
  • 16
  • 67
  • 124
12
votes
1 answer

Set color for each vertex in a triangle

I want to set each three vertex of a triangle from a mesh red, blue and green. As seen in the first part this tutorial which is for another language. This is the code they are using to set red, green and blue to each vertext in the each triangle…
Programmer
  • 104,912
  • 16
  • 182
  • 271
12
votes
2 answers

Minimum vs Minimal vertex covers

I am studying for an exam and one of the sample questions is as follows: Vertex cover: a vertex cover in a graph is a set of vertices such that each edge has at least one of its two end points in this set. Minimum vertex cover: a MINIMUM vertex…
panicked
  • 121
  • 1
  • 3
11
votes
3 answers

Max size for Vertex Buffer Objects (OpenGL ES 2.0)

Is there a max size for vertex buffer objects binded to GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER??? Originally, I was drawing a mesh composed of 16 submeshes. For each submesh, I created a vertex buffer and during the rendering phase, I called…
Alvin Heng
  • 111
  • 1
  • 1
  • 4
11
votes
1 answer

What's the difference between a vector and a vertex?

I often see the words 'vector' and 'vertex' (plural 'vertices') being used in 3D programming contexts. From what I can tell, they both describe a point in n-dimensional space. The XNA framework for example has Vector2, Vector3 and Vector4 classes,…
lesderid
  • 3,081
  • 7
  • 36
  • 62
1
2 3
45 46