still plenty of problems with angleaxis and other linear algebra stuff

This commit is contained in:
Hartmut Seichter 2019-01-25 18:01:01 +01:00
parent 9bdc13e3fc
commit 5245ceb112
13 changed files with 146 additions and 166 deletions

View file

@ -62,6 +62,12 @@ struct mesh_renderer::impl {
_vbos.clear();
}
void draw()
{
}
};

View file

@ -38,8 +38,8 @@ struct triangle_renderer
mesh::vertex3array_t vertices = {
{0.0f, 0.5f, 0.0f}
,{0.5f, -0.5f, 0.0f}
{ 0.0f, 0.5f, 0.0f}
,{ 0.5f, -0.5f, 0.0f}
,{-0.5f, -0.5f, 0.0f}
};
@ -64,18 +64,26 @@ struct triangle_renderer
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, vertex_size_bytes , amesh.vertices().data(), GL_STATIC_DRAW);
glGenVertexArrays(1, &vao);
glGenVertexArrays(1,&vao);
glBindVertexArray(vao);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glVertexAttribPointer(0, vertex_stride, GL_FLOAT, GL_FALSE, 0, nullptr);
const char* vertex_shader =
"#version 400\n"
"in vec3 vp;"
"void main() {"
" gl_Position = vec4(vp, 1.0);"
"}";
const char* vertex_shader = R"(
#version 400
in vec3 vp;
void main() {
gl_Position = vec4(vp, 1.0);
}
)";
// "#version 400\n"
// "in vec3 vp;"
// "void main() {"
// " gl_Position = vec4(vp, 1.0);"
// "}";
const char *fragment_shader = R"(#version 400
@ -219,8 +227,15 @@ void pipeline::impl::draw()
glClearColor(1,1,1,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//
// draw pass
//
tr.draw();
// reset