3 Topics

Member Avatar for
Member Avatar for Artyom_1

I'm trying to create a simple colored cube using vbo(well it actually a rectangle with z = 0). I am using glew & freeglut. Here my code. #include <GL/glew.h> #include <GL/glut.h> #include <stdio.h> const int g_width = 800; const int g_height = 800; #pragma comment(lib, "glew32.lib") static const GLsizeiptr PositionSize …

Member Avatar for Artyom_1
0
493
Member Avatar for jackshannon4

shader.vert: #version 120 varying vec3 position; varying vec3 normal; void main() { position = (vec3(gl_ModelViewMatrix*gl_Vertex)); //get the position of the vertex after translation, rotation, scaling normal = gl_NormalMatrix*gl_Normal; //get the normal direction, after translation, rotation, scaling gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } shader.frag: #version 120 varying vec3 position; varying vec3 …

Member Avatar for jackshannon4
0
170
Member Avatar for Labdabeta

I have reinstalled my compiler successfully (finally) and got right back to work. I have created a glModel class as follows: [CODE]class glModel { private: int numv; int numn; unsigned int model; unsigned int textu; unsigned int norma; float *vars; float *norm; public: glModel():numv(0),numn(0){vex=new float[1];tex=new float[1];nex=new float[1];} glModel& Vertex(float tx, …

Member Avatar for Labdabeta
0
149

The End.