Skip to content

Commit 6eb371a

Browse files
author
Jos Dirksen
committed
New versions for 2nd edition and Three.js r68
1 parent 7ae5c25 commit 6eb371a

28 files changed

+36190
-0
lines changed

assets/models/assimp/SpiderTex.jpg

15.4 KB
Loading

assets/models/assimp/drkwood2.jpg

199 KB
Loading

assets/models/assimp/engineflare1.jpg

3.55 KB
Loading

assets/models/assimp/spider.obj.assimp.json

Lines changed: 24973 additions & 0 deletions
Large diffs are not rendered by default.
9.07 KB
Loading
7.74 KB
Loading

assets/models/awd/MonsterHead.awd

4.49 MB
Binary file not shown.
2.99 MB
Loading
1020 KB
Loading
439 KB
Loading

assets/models/babylon/skull.babylon

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.

assets/models/gltf/monster.bin

199 KB
Binary file not shown.

assets/models/gltf/monster.dae

Lines changed: 1924 additions & 0 deletions
Large diffs are not rendered by default.

assets/models/gltf/monster.jpg

85.3 KB
Loading

assets/models/gltf/monster.json

Lines changed: 3587 additions & 0 deletions
Large diffs are not rendered by default.

assets/models/gltf/monster0FS.glsl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
precision highp float;
2+
varying vec3 v_normal;
3+
varying vec4 v_joint;
4+
varying vec4 v_weight;
5+
uniform float u_shininess;
6+
uniform vec4 u_ambient;
7+
varying vec2 v_texcoord0;
8+
uniform sampler2D u_diffuse;
9+
uniform vec4 u_specular;
10+
void main(void) {
11+
vec3 normal = normalize(v_normal);
12+
vec4 color = vec4(0., 0., 0., 0.);
13+
vec4 diffuse = vec4(0., 0., 0., 1.);
14+
vec4 ambient;
15+
vec4 specular;
16+
ambient = u_ambient;
17+
diffuse = texture2D(u_diffuse, v_texcoord0);
18+
specular = u_specular;
19+
diffuse.xyz *= max(dot(normal,vec3(0.,0.,1.)), 0.);
20+
color.xyz += diffuse.xyz;
21+
color = vec4(color.rgb * diffuse.a, diffuse.a);
22+
gl_FragColor = color;
23+
}

assets/models/gltf/monster0VS.glsl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
precision highp float;
2+
attribute vec3 a_position;
3+
attribute vec3 a_normal;
4+
varying vec3 v_normal;
5+
attribute vec4 a_joint;
6+
varying vec4 v_joint;
7+
attribute vec4 a_weight;
8+
varying vec4 v_weight;
9+
uniform mat4 u_jointMat[60];
10+
uniform mat3 u_normalMatrix;
11+
uniform mat4 u_modelViewMatrix;
12+
uniform mat4 u_projectionMatrix;
13+
attribute vec2 a_texcoord0;
14+
varying vec2 v_texcoord0;
15+
void main(void) {
16+
mat4 skinMat = a_weight.x * u_jointMat[int(a_joint.x)];
17+
skinMat += a_weight.y * u_jointMat[int(a_joint.y)];
18+
skinMat += a_weight.z * u_jointMat[int(a_joint.z)];
19+
skinMat += a_weight.w * u_jointMat[int(a_joint.w)];
20+
vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);
21+
v_normal = normalize(u_normalMatrix * mat3(skinMat)* a_normal);
22+
v_texcoord0 = a_texcoord0;
23+
gl_Position = u_projectionMatrix * pos;
24+
}

assets/models/gltf/readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Model from http://www.3drt.com/downloads.htm

assets/models/vrml/tree.wrl

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#VRML V2.0 utf8
2+
3+
# a virtual Tree
4+
#from the lemay VRML book
5+
Shape {
6+
appearance Appearance {
7+
material Material {emissiveColor .41 .40 .1}
8+
texture ImageTexture { url "oak.gif" }
9+
}
10+
geometry Cylinder{
11+
radius .1
12+
height 1
13+
}
14+
}
15+
16+
Transform {
17+
translation 0 .9 0
18+
children[
19+
Shape {
20+
appearance Appearance {
21+
material Material {
22+
emissiveColor 0 1 0
23+
ambientIntensity 8
24+
specularColor 0 1 0
25+
transparency .1
26+
}
27+
}
28+
geometry Sphere{
29+
radius .5
30+
}
31+
}
32+
]
33+
}
34+
35+
Transform {
36+
translation 0 -.5 0
37+
children [
38+
Shape {
39+
appearance Appearance {
40+
material Material {emissiveColor 1 0 0}
41+
texture ImageTexture { url "brick.gif" }
42+
}
43+
geometry Box {
44+
size 1 0.25 1
45+
}
46+
}
47+
]
48+
}
49+

0 commit comments

Comments
 (0)