goat3d
diff goatview/src/goatview.cc @ 79:a42f6cd4e2fa
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 08 May 2014 19:30:49 +0300 |
parents | 53ea5b25426e |
children | c5e997e8fd62 |
line diff
1.1 --- a/goatview/src/goatview.cc Thu May 08 16:25:04 2014 +0300 1.2 +++ b/goatview/src/goatview.cc Thu May 08 19:30:49 2014 +0300 1.3 @@ -1,6 +1,6 @@ 1.4 #include <stdio.h> 1.5 #include <QtOpenGL/QtOpenGL> 1.6 -#include <GL/glu.h> 1.7 +#include "opengl.h" 1.8 #include <vmath/vmath.h> 1.9 #include "goatview.h" 1.10 #include "goat3d.h" 1.11 @@ -153,7 +153,9 @@ 1.12 1.13 void GoatViewport::initializeGL() 1.14 { 1.15 - glClearColor(0.1, 0.1, 0.1, 1); 1.16 + init_opengl(); 1.17 + 1.18 + glClearColor(0.1f, 0.1f, 0.1f, 1.0f); 1.19 1.20 glEnable(GL_DEPTH_TEST); 1.21 glEnable(GL_CULL_FACE); 1.22 @@ -193,13 +195,15 @@ 1.23 float xform[16]; 1.24 goat3d_get_node_matrix(node, xform, anim_time); 1.25 for(int i=0; i<4; i++) { 1.26 - float *row = xform + i * 4; 1.27 - printf("[%3.3f %3.3f %3.3f %3.3f]\n", row[0], row[1], row[2], row[3]); 1.28 + for(int j=0; j<i; j++) { 1.29 + float tmp = xform[i * 4 + j]; 1.30 + xform[i * 4 + j] = xform[j * 4 + i]; 1.31 + xform[j * 4 + i] = tmp; 1.32 + } 1.33 } 1.34 - putchar('\n'); 1.35 1.36 glPushMatrix(); 1.37 - glMultTransposeMatrixf(xform); 1.38 + glLoadMatrixf(xform); 1.39 1.40 if(goat3d_get_node_type(node) == GOAT3D_NODE_MESH) { 1.41 goat3d_mesh *mesh = (goat3d_mesh*)goat3d_get_node_object(node);