| 371 | } |
| 372 | |
| 373 | void MiniGL::drawGrid_xy(float *color) |
| 374 | { |
| 375 | Vector3f diffcolor(color); |
| 376 | Vector3f speccolor(1.0, 1.0, 1.0); |
| 377 | |
| 378 | const int size = 5; |
| 379 | |
| 380 | VectorXr grid((2*size + 1) * 4 * 3); |
| 381 | for (int i = -size; i <= size; i++) |
| 382 | { |
| 383 | grid.segment<12>((i+size) * 12) << (float)i, (float)-size, 0.0f, |
| 384 | (float)i, (float)size, 0.0f, |
| 385 | (float)-size, (float)i, 0.0f, |
| 386 | (float)size, (float)i, 0.0f; |
| 387 | } |
| 388 | enableShader(diffcolor, diffcolor, speccolor, 100.0); |
| 389 | glUniform1i(m_shader.getUniform("lighting"), GL_FALSE); |
| 390 | supplyVertices(0, (2*size + 1) * 4, &grid(0)); |
| 391 | glDrawArrays(GL_LINES, 0, (2*size + 1) * 4); |
| 392 | glDisableVertexAttribArray(0); |
| 393 | disableShader(); |
| 394 | |
| 395 | float lineWidth = 1.0; |
| 396 | |
| 397 | drawVector(Vector3r(-size, 0.0, 0.0), Vector3r(0.0, 0.0, 0.0), lineWidth, color); |
| 398 | drawVector(Vector3r(1.0, 0.0, 0.0), Vector3r(size, 0.0, 0.0), lineWidth, color); |
| 399 | drawVector(Vector3r(0.0, -size, 0.0), Vector3r(0.0, 0.0, 0.0), lineWidth, color); |
| 400 | drawVector(Vector3r(0.0, 1.0, 0.0), Vector3r(0.0, size, 0.0), lineWidth, color); |
| 401 | } |
| 402 | |
| 403 | void MiniGL::setViewport(float pfovy, float pznear, float pzfar, const Vector3r &peyepoint, const Vector3r &plookat) |
| 404 | { |
nothing calls this directly
no test coverage detected