u/1011011101101 - 3 Archived Voat Posts in v/programming
u/1011011101101
  • home
  • search

u/1011011101101

1 post · 2 comments · 3 total

Active in: v/programming (3)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Passing a dynamic array into an OpenGL vertex buffer? Any thoughts.

number of floats/vertex points, I'm usually calling glDrawElements() with a separate GLuint array for the order of the triangles.

0 16 Sep 2015 05:42 u/1011011101101 in v/programming
Comment on: Passing a dynamic array into an OpenGL vertex buffer? Any thoughts.

C++, It's been a while since I was learning but what I had was something like this:

std::int numOfVerts = vertexCount(); // returns the number of vertex floats for the object std::int temp = 0; std::string str = ""; std::string::size_type sz;

fstream infile; infile.open("data_PLY.txt", ios::in);

GLfloat *vertices;

vertices = new float[numOfVerts];

while( int i = 0; i < numOfVerts; i++) { infile >> str; temp = stof(infile, &sz); vertices[i] = temp; temp = 0; }

It was something along those lines. I apologize, I'm not very good at coding but I love it none the less but when I passed it into the vertex buffer it never worked because it wanted a static array.

0 14 Sep 2015 04:44 u/1011011101101 in v/programming
Passing a dynamic array into an OpenGL vertex buffer? Any thoughts.
8 8 comments 14 Sep 2015 03:30 u/1011011101101 (self.programming) in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.