Merge branch 'master' of github.com:tforgione/model-converter

This commit is contained in:
Thomas FORGIONE 2016-11-29 15:45:19 +01:00
commit 3ef8885acb
3 changed files with 44 additions and 0 deletions

21
assets/models/cube.obj Normal file
View File

@ -0,0 +1,21 @@
v 0.5 -0.5 -0.5
v 0.5 0.5 -0.5
v -0.5 0.5 -0.5
v -0.5 -0.5 -0.5
v 0.5 -0.5 0.5
v 0.5 0.5 0.5
v -0.5 0.5 0.5
v -0.5 -0.5 0.5
f 1 2 5
f 2 6 5
f 2 3 6
f 3 7 6
f 2 1 4
f 2 4 3
f 5 6 8
f 6 7 8
f 3 4 8
f 3 8 7
f 4 1 5
f 4 5 8

View File

@ -0,0 +1,15 @@
varying vec3 fNormal;
vec3 ambientLight = vec3(0.2,0.2,0.2);
vec3 directionnalLight = normalize(vec3(10,5,7));
vec3 directionnalLightFactor = vec3(0.5,0.5,0.5);
void main() {
vec3 ambientFactor = ambientLight;
vec3 lambertFactor = max(vec3(0.0,0.0,0.0), dot(directionnalLight, fNormal) * directionnalLightFactor);
vec4 texel = texture2D(tex, gl_TexCoord[0].xy);
gl_FragColor = vec4(ambientFactor + lambertFactor, 1.0);
}

View File

@ -0,0 +1,8 @@
varying vec3 fNormal;
varying vec4 fTexCoord;
void main() {
fNormal = gl_Normal;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}