Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Nicholas Wech
three.js-lite
Commits
44a8652c
Commit
44a8652c
authored
13 years ago
by
Mr.doob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REVISION ++
parent
8062c3bf
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
22 deletions
+33
-22
README.md
README.md
+11
-0
REVISION
REVISION
+1
-1
build/Three.js
build/Three.js
+7
-7
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+2
-2
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+2
-2
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+5
-5
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+2
-2
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+3
-3
No files found.
README.md
View file @
44a8652c
...
...
@@ -139,6 +139,17 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
### Change Log ###
2011 04 24 -
**r40**
(263.774 KB, gzip: 64.320 KB)
*
Fixed
`Object3D.lookAt`
. (
[
mrdoob
](
http://github.com/mrdoob
)
)
*
More and more Blender exporter goodness. (
[
alteredq
](
http://github.com/alteredq
)
and
[
mrdoob
](
http://github.com/mrdoob
)
)
*
Improved
`CollisionSystem`
. (
[
drojdjou
](
https://github.com/drojdjou
)
and
[
alteredq
](
http://github.com/alteredq
)
)
*
Fixes on WebGLRenderer. (
[
empaempa
](
http://github.com/empaempa
)
)
*
Added
`Trident`
object. (
[
sroucheray
](
http://github.com/sroucheray
)
)
*
Added
`data`
object to Renderers for getting number of vertices/faces/callDraws from last render. (
[
mrdoob
](
http://github.com/mrdoob
)
)
*
Fixed
`Projector`
handling Particles with hierarchies. (
[
mrdoob
](
http://github.com/mrdoob
)
)
2011 04 09 -
**r39**
(249.048 KB, gzip: 61.020 KB)
*
Improved WebGLRenderer program cache. (
[
alteredq
](
http://github.com/alteredq
)
)
...
...
This diff is collapsed.
Click to expand it.
REVISION
View file @
44a8652c
39
40
This diff is collapsed.
Click to expand it.
build/Three.js
View file @
44a8652c
This diff is collapsed.
Click to expand it.
build/custom/ThreeCanvas.js
View file @
44a8652c
// ThreeCanvas.js r
39
- http://github.com/mrdoob/three.js
// ThreeCanvas.js r
40
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
a
){
this
.
setHex
(
a
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
this
.
hex
=
a
.
hex
;
this
.
__styleString
=
a
.
__styleString
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
a
,
b
,
c
){
this
.
h
=
a
;
this
.
s
=
b
;
this
.
v
=
c
;
var
d
,
e
,
h
,
f
,
k
,
g
;
if
(
c
==
0
)
d
=
e
=
h
=
0
;
else
{
f
=
Math
.
floor
(
a
*
6
);
k
=
a
*
6
-
f
;
a
=
c
*
(
1
-
b
);
g
=
c
*
(
1
-
b
*
k
);
b
=
c
*
(
1
-
b
*
(
1
-
k
));
switch
(
f
){
case
1
:
d
=
g
;
e
=
c
;
h
=
a
;
break
;
case
2
:
d
=
a
;
e
=
c
;
h
=
b
;
break
;
case
3
:
d
=
a
;
e
=
g
;
h
=
c
;
break
;
case
4
:
d
=
b
;
e
=
a
;
h
=
c
;
break
;
case
5
:
d
=
c
;
e
=
a
;
h
=
g
;
break
;
case
6
:
case
0
:
d
=
c
;
e
=
b
;
h
=
a
}}
this
.
r
=
d
;
this
.
g
=
e
;
this
.
b
=
h
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
updateHSV
:
function
(){
this
.
v
=
this
.
s
=
this
.
h
=
0
;
var
a
=
Math
.
max
(
Math
.
max
(
this
.
r
,
this
.
g
),
this
.
b
),
b
=
Math
.
min
(
Math
.
min
(
this
.
r
,
this
.
g
),
this
.
b
),
c
;
if
(
b
==
a
)
b
=
c
=
0
;
else
{
c
=
a
-
b
;
b
=
c
/
a
;
c
=
this
.
r
==
a
?(
this
.
g
-
this
.
b
)
/
c
:
this
.
g
==
a
?
2
+
(
this
.
b
-
this
.
r
)
/
c
:
4
+
(
this
.
r
-
this
.
g
)
/
c
;
c
/=
6
;
c
<
0
&&
(
c
+=
1
);
c
>
1
&&
(
c
-=
1
)}
this
.
h
=
c
;
this
.
s
=
b
;
this
.
v
=
a
},
setHex
:
function
(
a
){
this
.
hex
=~~
a
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
a
.
y
*
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
c
);
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
a
=
1
/
a
;
this
.
x
*=
a
;
this
.
y
*=
a
;
this
.
z
*=
a
;
this
.
w
*=
a
}
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
h
=
a
.
x
,
f
=
a
.
y
,
k
=
a
.
z
;
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
h
+
c
*
k
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
h
-
b
*
k
;
this
.
z
=
d
*
a
+
e
*
k
+
b
*
f
-
c
*
h
;
this
.
w
=
e
*
a
-
b
*
h
-
c
*
f
-
d
*
k
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
h
=
this
.
x
,
f
=
this
.
y
,
k
=
this
.
z
,
g
=
this
.
w
,
i
=
g
*
c
+
f
*
e
-
k
*
d
,
n
=
g
*
d
+
k
*
c
-
h
*
e
,
j
=
g
*
e
+
h
*
d
-
f
*
c
;
c
=-
h
*
c
-
f
*
d
-
k
*
e
;
b
.
x
=
i
*
g
+
c
*-
h
+
n
*-
k
-
j
*-
f
;
b
.
y
=
n
*
g
+
c
*-
f
+
j
*-
h
-
i
*-
k
;
b
.
z
=
j
*
g
+
c
*-
k
+
i
*-
f
-
n
*-
h
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
h
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
){
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
h
)
/
f
;
d
=
Math
.
sin
(
d
*
h
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
h
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
){
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
h
)
/
f
;
d
=
Math
.
sin
(
d
*
h
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
h
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
h
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
h
instanceof
THREE
.
Color
?
h
:
new
THREE
.
Color
;
this
.
vertexColors
=
h
instanceof
Array
?
h
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
This diff is collapsed.
Click to expand it.
build/custom/ThreeDOM.js
View file @
44a8652c
// ThreeDOM.js r
39
- http://github.com/mrdoob/three.js
// ThreeDOM.js r
40
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
a
){
this
.
setHex
(
a
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
this
.
hex
=
a
.
hex
;
this
.
__styleString
=
a
.
__styleString
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
a
,
b
,
c
){
this
.
h
=
a
;
this
.
s
=
b
;
this
.
v
=
c
;
var
d
,
e
,
h
,
f
,
j
,
g
;
if
(
c
==
0
)
d
=
e
=
h
=
0
;
else
{
f
=
Math
.
floor
(
a
*
6
);
j
=
a
*
6
-
f
;
a
=
c
*
(
1
-
b
);
g
=
c
*
(
1
-
b
*
j
);
b
=
c
*
(
1
-
b
*
(
1
-
j
));
switch
(
f
){
case
1
:
d
=
g
;
e
=
c
;
h
=
a
;
break
;
case
2
:
d
=
a
;
e
=
c
;
h
=
b
;
break
;
case
3
:
d
=
a
;
e
=
g
;
h
=
c
;
break
;
case
4
:
d
=
b
;
e
=
a
;
h
=
c
;
break
;
case
5
:
d
=
c
;
e
=
a
;
h
=
g
;
break
;
case
6
:
case
0
:
d
=
c
;
e
=
b
;
h
=
a
}}
this
.
r
=
d
;
this
.
g
=
e
;
this
.
b
=
h
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
updateHSV
:
function
(){
this
.
v
=
this
.
s
=
this
.
h
=
0
;
var
a
=
Math
.
max
(
Math
.
max
(
this
.
r
,
this
.
g
),
this
.
b
),
b
=
Math
.
min
(
Math
.
min
(
this
.
r
,
this
.
g
),
this
.
b
),
c
;
if
(
b
==
a
)
b
=
c
=
0
;
else
{
c
=
a
-
b
;
b
=
c
/
a
;
c
=
this
.
r
==
a
?(
this
.
g
-
this
.
b
)
/
c
:
this
.
g
==
a
?
2
+
(
this
.
b
-
this
.
r
)
/
c
:
4
+
(
this
.
r
-
this
.
g
)
/
c
;
c
/=
6
;
c
<
0
&&
(
c
+=
1
);
c
>
1
&&
(
c
-=
1
)}
this
.
h
=
c
;
this
.
s
=
b
;
this
.
v
=
a
},
setHex
:
function
(
a
){
this
.
hex
=~~
a
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
a
.
y
*
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
c
);
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
a
=
1
/
a
;
this
.
x
*=
a
;
this
.
y
*=
a
;
this
.
z
*=
a
;
this
.
w
*=
a
}
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
h
=
a
.
x
,
f
=
a
.
y
,
j
=
a
.
z
;
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
h
+
c
*
j
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
h
-
b
*
j
;
this
.
z
=
d
*
a
+
e
*
j
+
b
*
f
-
c
*
h
;
this
.
w
=
e
*
a
-
b
*
h
-
c
*
f
-
d
*
j
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
h
=
this
.
x
,
f
=
this
.
y
,
j
=
this
.
z
,
g
=
this
.
w
,
i
=
g
*
c
+
f
*
e
-
j
*
d
,
l
=
g
*
d
+
j
*
c
-
h
*
e
,
k
=
g
*
e
+
h
*
d
-
f
*
c
;
c
=-
h
*
c
-
f
*
d
-
j
*
e
;
b
.
x
=
i
*
g
+
c
*-
h
+
l
*-
j
-
k
*-
f
;
b
.
y
=
l
*
g
+
c
*-
f
+
k
*-
h
-
i
*-
j
;
b
.
z
=
k
*
g
+
c
*-
j
+
i
*-
f
-
l
*-
h
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
h
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
){
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
h
)
/
f
;
d
=
Math
.
sin
(
d
*
h
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
h
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
){
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
h
)
/
f
;
d
=
Math
.
sin
(
d
*
h
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
h
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
h
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
h
instanceof
THREE
.
Color
?
h
:
new
THREE
.
Color
;
this
.
vertexColors
=
h
instanceof
Array
?
h
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Camera
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
fov
=
a
||
50
;
this
.
aspect
=
b
||
1
;
this
.
near
=
c
||
0.1
;
this
.
far
=
d
||
2
E3
;
this
.
target
=
e
||
new
THREE
.
Object3D
;
this
.
useTarget
=!
0
;
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
null
;
this
.
updateProjectionMatrix
()};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
...
...
This diff is collapsed.
Click to expand it.
build/custom/ThreeExtras.js
View file @
44a8652c
// ThreeExtras.js r
39
- http://github.com/mrdoob/three.js
// ThreeExtras.js r
40
- http://github.com/mrdoob/three.js
THREE
.
AnimationHandler
=
function
(){
var
a
=
[],
d
=
{},
b
=
{};
b
.
update
=
function
(
c
){
for
(
var
f
=
0
;
f
<
a
.
length
;
f
++
)
a
[
f
].
update
(
c
)};
b
.
addToUpdate
=
function
(
c
){
a
.
indexOf
(
c
)
===-
1
&&
a
.
push
(
c
)};
b
.
removeFromUpdate
=
function
(
c
){
c
=
a
.
indexOf
(
c
);
c
!==-
1
&&
a
.
splice
(
c
,
1
)};
b
.
add
=
function
(
c
){
d
[
c
.
name
]
!==
undefined
&&
console
.
log
(
"
THREE.AnimationHandler.add: Warning!
"
+
c
.
name
+
"
already exists in library. Overwriting.
"
);
d
[
c
.
name
]
=
c
;
if
(
c
.
initialized
!==!
0
){
for
(
var
f
=
0
;
f
<
c
.
hierarchy
.
length
;
f
++
){
for
(
var
g
=
0
;
g
<
c
.
hierarchy
[
f
].
keys
.
length
;
g
++
){
if
(
c
.
hierarchy
[
f
].
keys
[
g
].
time
<
0
)
c
.
hierarchy
[
f
].
keys
[
g
].
time
=
0
;
if
(
c
.
hierarchy
[
f
].
keys
[
g
].
rot
!==
undefined
&&!
(
c
.
hierarchy
[
f
].
keys
[
g
].
rot
instanceof
THREE
.
Quaternion
)){
var
h
=
c
.
hierarchy
[
f
].
keys
[
g
].
rot
;
c
.
hierarchy
[
f
].
keys
[
g
].
rot
=
new
THREE
.
Quaternion
(
h
[
0
],
h
[
1
],
h
[
2
],
h
[
3
])}}
if
(
c
.
hierarchy
[
f
].
keys
[
0
].
morphTargets
!==
undefined
){
h
=
{};
for
(
g
=
0
;
g
<
c
.
hierarchy
[
f
].
keys
.
length
;
g
++
)
for
(
var
j
=
0
;
j
<
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargets
.
length
;
j
++
){
var
l
=
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargets
[
j
];
h
[
l
]
=-
1
}
c
.
hierarchy
[
f
].
usedMorphTargets
=
h
;
for
(
g
=
0
;
g
<
c
.
hierarchy
[
f
].
keys
.
length
;
g
++
){
var
k
=
{};
for
(
l
in
h
){
for
(
j
=
0
;
j
<
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargets
.
length
;
j
++
)
if
(
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargets
[
j
]
===
l
){
k
[
l
]
=
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargetsInfluences
[
j
];
break
}
j
===
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargets
.
length
&&
(
k
[
l
]
=
0
)}
c
.
hierarchy
[
f
].
keys
[
g
].
morphTargetsInfluences
=
k
}}
for
(
g
=
1
;
g
<
c
.
hierarchy
[
f
].
keys
.
length
;
g
++
)
if
(
c
.
hierarchy
[
f
].
keys
[
g
].
time
===
c
.
hierarchy
[
f
].
keys
[
g
-
1
].
time
){
c
.
hierarchy
[
f
].
keys
.
splice
(
g
,
1
);
g
--
}
for
(
g
=
1
;
g
<
c
.
hierarchy
[
f
].
keys
.
length
;
g
++
)
c
.
hierarchy
[
f
].
keys
[
g
].
index
=
g
}
g
=
parseInt
(
c
.
length
*
...
...
@@ -33,7 +33,7 @@ value:0,texture:null},uImageIncrement:{type:"v2",value:new THREE.Vector2(0.00195
film
:{
uniforms
:{
tDiffuse
:{
type
:
"
t
"
,
value
:
0
,
texture
:
null
},
time
:{
type
:
"
f
"
,
value
:
0
},
nIntensity
:{
type
:
"
f
"
,
value
:
0.5
},
sIntensity
:{
type
:
"
f
"
,
value
:
0.05
},
sCount
:{
type
:
"
f
"
,
value
:
4096
},
grayscale
:{
type
:
"
i
"
,
value
:
1
}},
vertexShader
:
"
varying vec2 vUv;
\n
void main() {
\n
vUv = vec2( uv.x, 1.0 - uv.y );
\n
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
\n
}
"
,
fragmentShader
:
"
varying vec2 vUv;
\n
uniform sampler2D tDiffuse;
\n
uniform float time;
\n
uniform bool grayscale;
\n
uniform float nIntensity;
\n
uniform float sIntensity;
\n
uniform float sCount;
\n
void main() {
\n
vec4 cTextureScreen = texture2D( tDiffuse, vUv );
\n
float x = vUv.x * vUv.y * time * 1000.0;
\n
x = mod( x, 13.0 ) * mod( x, 123.0 );
\n
float dx = mod( x, 0.01 );
\n
vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );
\n
vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );
\n
cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;
\n
cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );
\n
if( grayscale ) {
\n
cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );
\n
}
\n
gl_FragColor = vec4( cResult, cTextureScreen.a );
\n
}
"
},
screen
:{
uniforms
:{
tDiffuse
:{
type
:
"
t
"
,
value
:
0
,
texture
:
null
},
opacity
:{
type
:
"
f
"
,
value
:
1
}},
vertexShader
:
"
varying vec2 vUv;
\n
void main() {
\n
vUv = vec2( uv.x, 1.0 - uv.y );
\n
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
\n
}
"
,
fragmentShader
:
"
varying vec2 vUv;
\n
uniform sampler2D tDiffuse;
\n
uniform float opacity;
\n
void main() {
\n
vec4 texel = texture2D( tDiffuse, vUv );
\n
gl_FragColor = opacity * texel;
\n
}
"
},
basic
:{
uniforms
:{},
vertexShader
:
"
void main() {
\n
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
\n
}
"
,
fragmentShader
:
"
void main() {
\n
gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );
\n
}
"
}},
buildKernel
:
function
(
a
){
var
d
,
b
,
e
,
c
,
f
=
2
*
Math
.
ceil
(
a
*
3
)
+
1
;
f
>
25
&&
(
f
=
25
);
c
=
(
f
-
1
)
*
0.5
;
b
=
Array
(
f
);
for
(
d
=
e
=
0
;
d
<
f
;
++
d
){
b
[
d
]
=
Math
.
exp
(
-
((
d
-
c
)
*
(
d
-
c
))
/
(
2
*
a
*
a
));
e
+=
b
[
d
]}
for
(
d
=
0
;
d
<
f
;
++
d
)
b
[
d
]
/=
e
;
return
b
}};
THREE
.
QuakeCamera
=
function
(
a
){
function
d
(
b
,
e
){
return
function
(){
e
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
movementSpeed
=
1
;
this
.
lookSpeed
=
0.005
0
;
this
.
noFly
=!
1
;
this
.
lookVertical
=!
0
;
this
.
autoForward
=!
1
;
this
.
activeLook
=!
0
;
this
.
heightSpeed
=!
1
;
this
.
heightCoef
=
1
;
this
.
heightMin
=
0
;
this
.
constrainVertical
=!
1
;
this
.
verticalMin
=
0
;
this
.
verticalMax
=
3.14
;
this
.
domElement
=
document
;
this
.
lastUpdate
=
(
new
Date
).
getTime
();
this
.
tdiff
=
0
;
if
(
a
){
if
(
a
.
movementSpeed
!==
undefined
)
this
.
movementSpeed
=
THREE
.
QuakeCamera
=
function
(
a
){
function
d
(
b
,
e
){
return
function
(){
e
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
movementSpeed
=
1
;
this
.
lookSpeed
=
0.005
;
this
.
noFly
=!
1
;
this
.
lookVertical
=!
0
;
this
.
autoForward
=!
1
;
this
.
activeLook
=!
0
;
this
.
heightSpeed
=!
1
;
this
.
heightCoef
=
1
;
this
.
heightMin
=
0
;
this
.
constrainVertical
=!
1
;
this
.
verticalMin
=
0
;
this
.
verticalMax
=
3.14
;
this
.
domElement
=
document
;
this
.
lastUpdate
=
(
new
Date
).
getTime
();
this
.
tdiff
=
0
;
if
(
a
){
if
(
a
.
movementSpeed
!==
undefined
)
this
.
movementSpeed
=
a
.
movementSpeed
;
if
(
a
.
lookSpeed
!==
undefined
)
this
.
lookSpeed
=
a
.
lookSpeed
;
if
(
a
.
noFly
!==
undefined
)
this
.
noFly
=
a
.
noFly
;
if
(
a
.
lookVertical
!==
undefined
)
this
.
lookVertical
=
a
.
lookVertical
;
if
(
a
.
autoForward
!==
undefined
)
this
.
autoForward
=
a
.
autoForward
;
if
(
a
.
activeLook
!==
undefined
)
this
.
activeLook
=
a
.
activeLook
;
if
(
a
.
heightSpeed
!==
undefined
)
this
.
heightSpeed
=
a
.
heightSpeed
;
if
(
a
.
heightCoef
!==
undefined
)
this
.
heightCoef
=
a
.
heightCoef
;
if
(
a
.
heightMin
!==
undefined
)
this
.
heightMin
=
a
.
heightMin
;
if
(
a
.
heightMax
!==
undefined
)
this
.
heightMax
=
a
.
heightMax
;
if
(
a
.
constrainVertical
!==
undefined
)
this
.
constrainVertical
=
a
.
constrainVertical
;
if
(
a
.
verticalMin
!==
undefined
)
this
.
verticalMin
=
a
.
verticalMin
;
if
(
a
.
verticalMax
!==
undefined
)
this
.
verticalMax
=
a
.
verticalMax
;
if
(
a
.
domElement
!==
undefined
)
this
.
domElement
=
a
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
this
.
autoSpeedFactor
=
0
;
this
.
moveForward
=!
1
;
this
.
moveBackward
=!
1
;
this
.
moveLeft
=!
1
;
this
.
moveRight
=!
1
;
this
.
freeze
=!
1
;
this
.
mouseDragOn
=!
1
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
this
.
onMouseDown
=
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
b
.
button
){
case
0
:
this
.
moveForward
=!
0
;
break
;
case
2
:
this
.
moveBackward
=!
0
}
this
.
mouseDragOn
=!
0
};
this
.
onMouseUp
=
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
b
.
button
){
case
0
:
this
.
moveForward
=!
1
;
break
;
case
2
:
this
.
moveBackward
=!
1
}
this
.
mouseDragOn
=!
1
};
this
.
onMouseMove
=
function
(
b
){
this
.
mouseX
=
b
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
b
.
clientY
-
this
.
windowHalfY
};
this
.
onKeyDown
=
...
...
@@ -45,14 +45,14 @@ this.onMouseMove),!1);this.domElement.addEventListener("mousedown",d(this,this.o
THREE
.
QuakeCamera
.
prototype
.
translate
=
function
(
a
,
d
){
this
.
matrix
.
rotateAxis
(
d
);
if
(
this
.
noFly
)
d
.
y
=
0
;
this
.
position
.
addSelf
(
d
.
multiplyScalar
(
a
));
this
.
target
.
position
.
addSelf
(
d
.
multiplyScalar
(
a
))};
THREE
.
PathCamera
=
function
(
a
){
function
d
(
l
,
k
,
m
,
p
){
var
o
=
{
name
:
m
,
fps
:
0.6
,
length
:
p
,
hierarchy
:[]},
y
,
x
=
k
.
getControlPointsArray
(),
v
=
k
.
getLength
(),
u
=
x
.
length
,
z
=
0
;
y
=
u
-
1
;
k
=
{
parent
:
-
1
,
keys
:[]};
k
.
keys
[
0
]
=
{
time
:
0
,
pos
:
x
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
k
.
keys
[
y
]
=
{
time
:
p
,
pos
:
x
[
y
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
y
=
1
;
y
<
u
-
1
;
y
++
){
z
=
p
*
v
.
chunks
[
y
]
/
v
.
total
;
k
.
keys
[
y
]
=
{
time
:
z
,
pos
:
x
[
y
]}}
o
.
hierarchy
[
0
]
=
k
;
THREE
.
AnimationHandler
.
add
(
o
);
return
new
THREE
.
Animation
(
l
,
m
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
b
(
l
,
k
){
var
m
,
p
,
o
=
new
THREE
.
Geometry
;
for
(
m
=
0
;
m
<
l
.
points
.
length
*
k
;
m
++
){
p
=
m
/
(
l
.
points
.
length
*
k
);
p
=
l
.
getPoint
(
p
);
o
.
vertices
[
m
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
p
.
x
,
p
.
y
,
p
.
z
))}
return
o
}
function
e
(
l
,
k
){
var
m
=
b
(
k
,
10
),
p
=
b
(
k
,
10
),
o
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
m
,
o
);
particleObj
=
new
THREE
.
ParticleSystem
(
p
,
new
THREE
.
ParticleBasicMaterial
({
color
:
16755200
,
size
:
3
}));
lineObj
.
scale
.
set
(
1
,
1
,
1
);
l
.
addChild
(
lineObj
);
particleObj
.
scale
.
set
(
1
,
1
,
1
);
l
.
addChild
(
particleObj
);
p
=
new
THREE
.
Sphere
(
1
,
16
,
8
);
o
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
k
.
points
.
length
;
i
++
){
m
=
new
THREE
.
Mesh
(
p
,
o
);
m
.
position
.
copy
(
k
.
points
[
i
]);
m
.
updateMatrix
();
l
.
addChild
(
m
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
id
=
"
PathCamera
"
+
THREE
.
PathCameraIdCounter
++
;
this
.
duration
=
1
E4
;
this
.
waypoints
=
[];
this
.
useConstantSpeed
=!
0
;
this
.
resamplingCoef
=
50
;
this
.
debugPath
=
new
THREE
.
Object3D
;
this
.
debugDummy
=
new
THREE
.
Object3D
;
this
.
animationParent
=
new
THREE
.
Object3D
;
this
.
lookSpeed
=
0.005
0
;
this
.
lookVertical
=
16
,
8
);
o
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
k
.
points
.
length
;
i
++
){
m
=
new
THREE
.
Mesh
(
p
,
o
);
m
.
position
.
copy
(
k
.
points
[
i
]);
m
.
updateMatrix
();
l
.
addChild
(
m
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
id
=
"
PathCamera
"
+
THREE
.
PathCameraIdCounter
++
;
this
.
duration
=
1
E4
;
this
.
waypoints
=
[];
this
.
useConstantSpeed
=!
0
;
this
.
resamplingCoef
=
50
;
this
.
debugPath
=
new
THREE
.
Object3D
;
this
.
debugDummy
=
new
THREE
.
Object3D
;
this
.
animationParent
=
new
THREE
.
Object3D
;
this
.
lookSpeed
=
0.005
;
this
.
lookVertical
=
!
0
;
this
.
lookHorizontal
=!
0
;
this
.
verticalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
horizontalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
duration
!==
undefined
)
this
.
duration
=
a
.
duration
*
1
E3
;
if
(
a
.
waypoints
!==
undefined
)
this
.
waypoints
=
a
.
waypoints
;
if
(
a
.
useConstantSpeed
!==
undefined
)
this
.
useConstantSpeed
=
a
.
useConstantSpeed
;
if
(
a
.
resamplingCoef
!==
undefined
)
this
.
resamplingCoef
=
a
.
resamplingCoef
;
if
(
a
.
createDebugPath
!==
undefined
)
this
.
createDebugPath
=
a
.
createDebugPath
;
if
(
a
.
createDebugDummy
!==
undefined
)
this
.
createDebugDummy
=
a
.
createDebugDummy
;
if
(
a
.
lookSpeed
!==
undefined
)
this
.
lookSpeed
=
a
.
lookSpeed
;
if
(
a
.
lookVertical
!==
undefined
)
this
.
lookVertical
=
a
.
lookVertical
;
if
(
a
.
lookHorizontal
!==
undefined
)
this
.
lookHorizontal
=
a
.
lookHorizontal
;
if
(
a
.
verticalAngleMap
!==
undefined
)
this
.
verticalAngleMap
=
a
.
verticalAngleMap
;
if
(
a
.
horizontalAngleMap
!==
undefined
)
this
.
horizontalAngleMap
=
a
.
horizontalAngleMap
;
if
(
a
.
domElement
!==
undefined
)
this
.
domElement
=
a
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
0
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
var
c
=
Math
.
PI
*
2
,
f
=
Math
.
PI
/
180
;
this
.
update
=
function
(
l
,
k
,
m
){
var
p
,
o
;
this
.
lookHorizontal
&&
(
this
.
lon
+=
this
.
mouseX
*
this
.
lookSpeed
);
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
this
.
lookSpeed
);
this
.
lon
=
Math
.
max
(
0
,
Math
.
min
(
360
,
this
.
lon
));
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
f
;
this
.
theta
=
this
.
lon
*
f
;
p
=
this
.
phi
%
c
;
this
.
phi
=
p
>=
0
?
p
:
p
+
c
;
p
=
this
.
verticalAngleMap
.
srcRange
;
o
=
this
.
verticalAngleMap
.
dstRange
;
this
.
phi
=
(
this
.
phi
-
p
[
0
])
*
(
o
[
1
]
-
o
[
0
])
/
(
p
[
1
]
-
p
[
0
])
+
o
[
0
];
p
=
this
.
horizontalAngleMap
.
srcRange
;
o
=
this
.
horizontalAngleMap
.
dstRange
;
this
.
theta
=
(
this
.
theta
-
p
[
0
])
*
(
o
[
1
]
-
o
[
0
])
/
(
p
[
1
]
-
p
[
0
])
+
o
[
0
];
p
=
this
.
target
.
position
;
p
.
x
=
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
p
.
y
=
100
*
Math
.
cos
(
this
.
phi
);
p
.
z
=
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
sin
(
this
.
theta
);
this
.
supr
.
update
.
call
(
this
,
l
,
k
,
m
)};
this
.
onMouseMove
=
function
(
l
){
this
.
mouseX
=
l
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
l
.
clientY
-
this
.
windowHalfY
};
this
.
spline
=
new
THREE
.
Spline
;
this
.
spline
.
initFromArray
(
this
.
waypoints
);
this
.
useConstantSpeed
&&
this
.
spline
.
reparametrizeByArcLength
(
this
.
resamplingCoef
);
if
(
this
.
createDebugDummy
){
a
=
new
THREE
.
MeshLambertMaterial
({
color
:
30719
});
var
g
=
new
THREE
.
MeshLambertMaterial
({
color
:
65280
}),
h
=
new
THREE
.
Cube
(
10
,
10
,
20
),
j
=
new
THREE
.
Cube
(
2
,
2
,
10
);
this
.
animationParent
=
new
THREE
.
Mesh
(
h
,
a
);
a
=
new
THREE
.
Mesh
(
j
,
g
);
a
.
position
.
set
(
0
,
10
,
0
);
this
.
animation
=
d
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
);
this
.
animationParent
.
addChild
(
this
);
this
.
animationParent
.
addChild
(
this
.
target
);
this
.
animationParent
.
addChild
(
a
)}
else
{
this
.
animation
=
d
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
);
this
.
animationParent
.
addChild
(
this
.
target
);
this
.
animationParent
.
addChild
(
this
)}
this
.
createDebugPath
&&
e
(
this
.
debugPath
,
this
.
spline
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
function
(
l
,
k
){
return
function
(){
k
.
apply
(
l
,
arguments
)}}(
this
,
this
.
onMouseMove
),
!
1
)};
THREE
.
PathCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PathCamera
.
prototype
.
constructor
=
THREE
.
PathCamera
;
THREE
.
PathCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
PathCameraIdCounter
=
0
;
THREE
.
FlyCamera
=
function
(
a
){
function
d
(
b
,
e
){
return
function
(){
e
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
tmpQuaternion
=
new
THREE
.
Quaternion
;
this
.
movementSpeed
=
1
;
this
.
rollSpeed
=
0.005
0
;
this
.
dragToLook
=!
1
;
this
.
autoForward
=!
1
;
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
movementSpeed
!==
undefined
)
this
.
movementSpeed
=
a
.
movementSpeed
;
if
(
a
.
rollSpeed
!==
undefined
)
this
.
rollSpeed
=
a
.
rollSpeed
;
if
(
a
.
dragToLook
!==
undefined
)
this
.
dragToLook
=
a
.
dragToLook
;
if
(
a
.
autoForward
!==
undefined
)
this
.
autoForward
=
THREE
.
FlyCamera
=
function
(
a
){
function
d
(
b
,
e
){
return
function
(){
e
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
tmpQuaternion
=
new
THREE
.
Quaternion
;
this
.
movementSpeed
=
1
;
this
.
rollSpeed
=
0.005
;
this
.
dragToLook
=!
1
;
this
.
autoForward
=!
1
;
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
movementSpeed
!==
undefined
)
this
.
movementSpeed
=
a
.
movementSpeed
;
if
(
a
.
rollSpeed
!==
undefined
)
this
.
rollSpeed
=
a
.
rollSpeed
;
if
(
a
.
dragToLook
!==
undefined
)
this
.
dragToLook
=
a
.
dragToLook
;
if
(
a
.
autoForward
!==
undefined
)
this
.
autoForward
=
a
.
autoForward
;
if
(
a
.
domElement
!==
undefined
)
this
.
domElement
=
a
.
domElement
}
this
.
useTarget
=!
1
;
this
.
useQuaternion
=!
0
;
this
.
mouseStatus
=
0
;
this
.
moveState
=
{
up
:
0
,
down
:
0
,
left
:
0
,
right
:
0
,
forward
:
0
,
back
:
0
,
pitchUp
:
0
,
pitchDown
:
0
,
yawLeft
:
0
,
yawRight
:
0
,
rollLeft
:
0
,
rollRight
:
0
};
this
.
moveVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
rotationVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
lastUpdate
=-
1
;
this
.
tdiff
=
0
;
this
.
handleEvent
=
function
(
b
){
if
(
typeof
this
[
b
.
type
]
==
"
function
"
)
this
[
b
.
type
](
b
)};
this
.
keydown
=
function
(
b
){
if
(
!
b
.
altKey
){
switch
(
b
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
0.1
;
break
;
case
87
:
this
.
moveState
.
forward
=
1
;
break
;
case
83
:
this
.
moveState
.
back
=
1
;
break
;
case
65
:
this
.
moveState
.
left
=
1
;
break
;
case
68
:
this
.
moveState
.
right
=
1
;
break
;
case
82
:
this
.
moveState
.
up
=
1
;
break
;
case
70
:
this
.
moveState
.
down
=
1
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
1
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
1
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
1
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
1
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
1
;
break
;
case
69
:
this
.
moveState
.
rollRight
=
1
}
this
.
updateMovementVector
();
this
.
updateRotationVector
()}};
this
.
keyup
=
function
(
b
){
switch
(
b
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
1
;
break
;
case
87
:
this
.
moveState
.
forward
=
0
;
break
;
case
83
:
this
.
moveState
.
back
=
0
;
break
;
case
65
:
this
.
moveState
.
left
=
0
;
break
;
case
68
:
this
.
moveState
.
right
=
0
;
break
;
case
82
:
this
.
moveState
.
up
=
0
;
break
;
case
70
:
this
.
moveState
.
down
=
0
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
0
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
0
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
0
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
0
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
0
;
break
;
...
...
@@ -80,7 +80,7 @@ e));b instanceof THREE.Face4&&d.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.
THREE
.
Icosahedron
=
function
(
a
){
function
d
(
m
,
p
,
o
){
var
y
=
Math
.
sqrt
(
m
*
m
+
p
*
p
+
o
*
o
);
return
c
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
m
/
y
,
p
/
y
,
o
/
y
)))
-
1
}
function
b
(
m
,
p
,
o
,
y
){
y
.
faces
.
push
(
new
THREE
.
Face3
(
m
,
p
,
o
))}
function
e
(
m
,
p
){
var
o
=
c
.
vertices
[
m
].
position
,
y
=
c
.
vertices
[
p
].
position
;
return
d
((
o
.
x
+
y
.
x
)
/
2
,(
o
.
y
+
y
.
y
)
/
2
,(
o
.
z
+
y
.
z
)
/
2
)}
var
c
=
this
,
f
=
new
THREE
.
Geometry
,
g
;
this
.
subdivisions
=
a
||
0
;
THREE
.
Geometry
.
call
(
this
);
a
=
(
1
+
Math
.
sqrt
(
5
))
/
2
;
d
(
-
1
,
a
,
0
);
d
(
1
,
a
,
0
);
d
(
-
1
,
-
a
,
0
);
d
(
1
,
-
a
,
0
);
d
(
0
,
-
1
,
a
);
d
(
0
,
1
,
a
);
d
(
0
,
-
1
,
-
a
);
d
(
0
,
1
,
-
a
);
d
(
a
,
0
,
-
1
);
d
(
a
,
0
,
1
);
d
(
-
a
,
0
,
-
1
);
d
(
-
a
,
0
,
1
);
b
(
0
,
11
,
5
,
f
);
b
(
0
,
5
,
1
,
f
);
b
(
0
,
1
,
7
,
f
);
b
(
0
,
7
,
10
,
f
);
b
(
0
,
10
,
11
,
f
);
b
(
1
,
5
,
9
,
f
);
b
(
5
,
11
,
4
,
f
);
b
(
11
,
10
,
2
,
f
);
b
(
10
,
7
,
6
,
f
);
b
(
7
,
1
,
8
,
f
);
b
(
3
,
9
,
4
,
f
);
b
(
3
,
4
,
2
,
f
);
b
(
3
,
2
,
6
,
f
);
b
(
3
,
6
,
8
,
f
);
b
(
3
,
8
,
9
,
f
);
b
(
4
,
9
,
5
,
f
);
b
(
2
,
4
,
11
,
f
);
b
(
6
,
2
,
10
,
f
);
b
(
8
,
6
,
7
,
f
);
b
(
9
,
8
,
1
,
f
);
for
(
a
=
0
;
a
<
this
.
subdivisions
;
a
++
){
g
=
new
THREE
.
Geometry
;
for
(
var
h
in
f
.
faces
){
var
j
=
e
(
f
.
faces
[
h
].
a
,
f
.
faces
[
h
].
b
),
l
=
e
(
f
.
faces
[
h
].
b
,
f
.
faces
[
h
].
c
),
k
=
e
(
f
.
faces
[
h
].
c
,
f
.
faces
[
h
].
a
);
b
(
f
.
faces
[
h
].
a
,
j
,
k
,
g
);
b
(
f
.
faces
[
h
].
b
,
l
,
j
,
g
);
b
(
f
.
faces
[
h
].
c
,
k
,
l
,
g
);
b
(
j
,
l
,
k
,
g
)}
f
.
faces
=
g
.
faces
}
c
.
faces
=
f
.
faces
;
delete
f
;
delete
g
;
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
Icosahedron
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
Icosahedron
.
prototype
.
constructor
=
THREE
.
Icosahedron
;
THREE
.
Lathe
=
function
(
a
,
d
,
b
){
THREE
.
Geometry
.
call
(
this
);
this
.
steps
=
d
||
12
;
this
.
angle
=
b
||
2
*
Math
.
PI
;
d
=
this
.
angle
/
this
.
steps
;
b
=
[];
for
(
var
e
=
[],
c
=
[],
f
=
[],
g
=
(
new
THREE
.
Matrix4
).
setRotationZ
(
d
),
h
=
0
;
h
<
a
.
length
;
h
++
){
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
a
[
h
]));
b
[
h
]
=
a
[
h
].
clone
();
e
[
h
]
=
this
.
vertices
.
length
-
1
}
for
(
var
j
=
0
;
j
<=
this
.
angle
+
0.001
0
;
j
+=
d
){
for
(
h
=
0
;
h
<
b
.
length
;
h
++
)
if
(
j
<
this
.
angle
){
b
[
h
]
=
g
.
multiplyVector3
(
b
[
h
].
clone
());
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
b
[
h
]));
c
[
h
]
=
this
.
vertices
.
length
-
1
}
else
c
=
f
;
j
==
0
&&
(
f
=
e
);
THREE
.
Lathe
=
function
(
a
,
d
,
b
){
THREE
.
Geometry
.
call
(
this
);
this
.
steps
=
d
||
12
;
this
.
angle
=
b
||
2
*
Math
.
PI
;
d
=
this
.
angle
/
this
.
steps
;
b
=
[];
for
(
var
e
=
[],
c
=
[],
f
=
[],
g
=
(
new
THREE
.
Matrix4
).
setRotationZ
(
d
),
h
=
0
;
h
<
a
.
length
;
h
++
){
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
a
[
h
]));
b
[
h
]
=
a
[
h
].
clone
();
e
[
h
]
=
this
.
vertices
.
length
-
1
}
for
(
var
j
=
0
;
j
<=
this
.
angle
+
0.001
;
j
+=
d
){
for
(
h
=
0
;
h
<
b
.
length
;
h
++
)
if
(
j
<
this
.
angle
){
b
[
h
]
=
g
.
multiplyVector3
(
b
[
h
].
clone
());
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
b
[
h
]));
c
[
h
]
=
this
.
vertices
.
length
-
1
}
else
c
=
f
;
j
==
0
&&
(
f
=
e
);
for
(
h
=
0
;
h
<
e
.
length
-
1
;
h
++
){
this
.
faces
.
push
(
new
THREE
.
Face4
(
c
[
h
],
c
[
h
+
1
],
e
[
h
+
1
],
e
[
h
]));
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
1
-
j
/
this
.
angle
,
h
/
a
.
length
),
new
THREE
.
UV
(
1
-
j
/
this
.
angle
,(
h
+
1
)
/
a
.
length
),
new
THREE
.
UV
(
1
-
(
j
-
d
)
/
this
.
angle
,(
h
+
1
)
/
a
.
length
),
new
THREE
.
UV
(
1
-
(
j
-
d
)
/
this
.
angle
,
h
/
a
.
length
)])}
e
=
c
;
c
=
[]}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
Lathe
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
Lathe
.
prototype
.
constructor
=
THREE
.
Lathe
;
THREE
.
Plane
=
function
(
a
,
d
,
b
,
e
){
THREE
.
Geometry
.
call
(
this
);
var
c
,
f
=
a
/
2
,
g
=
d
/
2
;
b
=
b
||
1
;
e
=
e
||
1
;
var
h
=
b
+
1
,
j
=
e
+
1
;
a
/=
b
;
var
l
=
d
/
e
;
for
(
c
=
0
;
c
<
j
;
c
++
)
for
(
d
=
0
;
d
<
h
;
d
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
d
*
a
-
f
,
-
(
c
*
l
-
g
),
0
)));
for
(
c
=
0
;
c
<
e
;
c
++
)
for
(
d
=
0
;
d
<
b
;
d
++
){
this
.
faces
.
push
(
new
THREE
.
Face4
(
d
+
h
*
c
,
d
+
h
*
(
c
+
1
),
d
+
1
+
h
*
(
c
+
1
),
d
+
1
+
h
*
c
));
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
d
/
b
,
c
/
e
),
new
THREE
.
UV
(
d
/
b
,(
c
+
1
)
/
e
),
new
THREE
.
UV
((
d
+
1
)
/
b
,(
c
+
1
)
/
e
),
new
THREE
.
UV
((
d
+
1
)
/
b
,
c
/
e
)])}
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
Plane
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
Plane
.
prototype
.
constructor
=
THREE
.
Plane
;
...
...
This diff is collapsed.
Click to expand it.
build/custom/ThreeSVG.js
View file @
44a8652c
// ThreeSVG.js r
39
- http://github.com/mrdoob/three.js
// ThreeSVG.js r
40
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
a
){
this
.
setHex
(
a
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
this
.
hex
=
a
.
hex
;
this
.
__styleString
=
a
.
__styleString
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
a
,
b
,
c
){
this
.
h
=
a
;
this
.
s
=
b
;
this
.
v
=
c
;
var
d
,
e
,
h
,
f
,
i
,
g
;
if
(
c
==
0
)
d
=
e
=
h
=
0
;
else
{
f
=
Math
.
floor
(
a
*
6
);
i
=
a
*
6
-
f
;
a
=
c
*
(
1
-
b
);
g
=
c
*
(
1
-
b
*
i
);
b
=
c
*
(
1
-
b
*
(
1
-
i
));
switch
(
f
){
case
1
:
d
=
g
;
e
=
c
;
h
=
a
;
break
;
case
2
:
d
=
a
;
e
=
c
;
h
=
b
;
break
;
case
3
:
d
=
a
;
e
=
g
;
h
=
c
;
break
;
case
4
:
d
=
b
;
e
=
a
;
h
=
c
;
break
;
case
5
:
d
=
c
;
e
=
a
;
h
=
g
;
break
;
case
6
:
case
0
:
d
=
c
;
e
=
b
;
h
=
a
}}
this
.
r
=
d
;
this
.
g
=
e
;
this
.
b
=
h
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
updateHSV
:
function
(){
this
.
v
=
this
.
s
=
this
.
h
=
0
;
var
a
=
Math
.
max
(
Math
.
max
(
this
.
r
,
this
.
g
),
this
.
b
),
b
=
Math
.
min
(
Math
.
min
(
this
.
r
,
this
.
g
),
this
.
b
),
c
;
if
(
b
==
a
)
b
=
c
=
0
;
else
{
c
=
a
-
b
;
b
=
c
/
a
;
c
=
this
.
r
==
a
?(
this
.
g
-
this
.
b
)
/
c
:
this
.
g
==
a
?
2
+
(
this
.
b
-
this
.
r
)
/
c
:
4
+
(
this
.
r
-
this
.
g
)
/
c
;
c
/=
6
;
c
<
0
&&
(
c
+=
1
);
c
>
1
&&
(
c
-=
1
)}
this
.
h
=
c
;
this
.
s
=
b
;
this
.
v
=
a
},
setHex
:
function
(
a
){
this
.
hex
=~~
a
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
a
.
y
*
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
c
);
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
a
=
1
/
a
;
this
.
x
*=
a
;
this
.
y
*=
a
;
this
.
z
*=
a
;
this
.
w
*=
a
}
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
h
=
a
.
x
,
f
=
a
.
y
,
i
=
a
.
z
;
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
h
+
c
*
i
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
h
-
b
*
i
;
this
.
z
=
d
*
a
+
e
*
i
+
b
*
f
-
c
*
h
;
this
.
w
=
e
*
a
-
b
*
h
-
c
*
f
-
d
*
i
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
h
=
this
.
x
,
f
=
this
.
y
,
i
=
this
.
z
,
g
=
this
.
w
,
j
=
g
*
c
+
f
*
e
-
i
*
d
,
m
=
g
*
d
+
i
*
c
-
h
*
e
,
k
=
g
*
e
+
h
*
d
-
f
*
c
;
c
=-
h
*
c
-
f
*
d
-
i
*
e
;
b
.
x
=
j
*
g
+
c
*-
h
+
m
*-
i
-
k
*-
f
;
b
.
y
=
m
*
g
+
c
*-
f
+
k
*-
h
-
j
*-
i
;
b
.
z
=
k
*
g
+
c
*-
i
+
j
*-
f
-
m
*-
h
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
h
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
){
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
h
)
/
f
;
d
=
Math
.
sin
(
d
*
h
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
){
c
.
w
=
a
.
w
;
c
.
x
=
a
.
x
;
c
.
y
=
a
.
y
;
c
.
z
=
a
.
z
;
return
c
}
var
h
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
){
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
);
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
);
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
);
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
);
return
c
}
e
=
Math
.
sin
((
1
-
d
)
*
h
)
/
f
;
d
=
Math
.
sin
(
d
*
h
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
h
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
h
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
h
instanceof
THREE
.
Color
?
h
:
new
THREE
.
Color
;
this
.
vertexColors
=
h
instanceof
Array
?
h
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
This diff is collapsed.
Click to expand it.
build/custom/ThreeWebGL.js
View file @
44a8652c
// ThreeWebGL.js r
39
- http://github.com/mrdoob/three.js
// ThreeWebGL.js r
40
- http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
){
window
.
Int32Array
=
Array
;
window
.
Float32Array
=
Array
}
THREE
.
Color
=
function
(
b
){
this
.
setHex
(
b
)};
THREE
.
Color
.
prototype
=
{
autoUpdate
:
!
0
,
copy
:
function
(
b
){
this
.
r
=
b
.
r
;
this
.
g
=
b
.
g
;
this
.
b
=
b
.
b
;
this
.
hex
=
b
.
hex
;
this
.
__styleString
=
b
.
__styleString
},
setRGB
:
function
(
b
,
d
,
e
){
this
.
r
=
b
;
this
.
g
=
d
;
this
.
b
=
e
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
setHSV
:
function
(
b
,
d
,
e
){
this
.
h
=
b
;
this
.
s
=
d
;
this
.
v
=
e
;
var
g
,
h
,
o
,
n
,
q
,
r
;
if
(
e
==
0
)
g
=
h
=
o
=
0
;
else
{
n
=
Math
.
floor
(
b
*
6
);
q
=
b
*
6
-
n
;
b
=
e
*
(
1
-
d
);
r
=
e
*
(
1
-
d
*
q
);
d
=
e
*
(
1
-
d
*
(
1
-
q
));
switch
(
n
){
case
1
:
g
=
r
;
h
=
e
;
o
=
b
;
break
;
case
2
:
g
=
b
;
h
=
e
;
o
=
d
;
break
;
case
3
:
g
=
b
;
h
=
r
;
o
=
e
;
break
;
case
4
:
g
=
d
;
h
=
b
;
o
=
e
;
break
;
case
5
:
g
=
e
;
h
=
b
;
o
=
r
;
break
;
case
6
:
case
0
:
g
=
e
;
h
=
d
;
o
=
b
}}
this
.
r
=
g
;
this
.
g
=
h
;
this
.
b
=
o
;
if
(
this
.
autoUpdate
){
this
.
updateHex
();
this
.
updateStyleString
()}},
updateHSV
:
function
(){
this
.
v
=
this
.
s
=
this
.
h
=
0
;
var
b
=
Math
.
max
(
Math
.
max
(
this
.
r
,
this
.
g
),
this
.
b
),
d
=
Math
.
min
(
Math
.
min
(
this
.
r
,
this
.
g
),
this
.
b
),
e
;
if
(
d
==
b
)
d
=
e
=
0
;
else
{
e
=
b
-
d
;
d
=
e
/
b
;
e
=
this
.
r
==
b
?(
this
.
g
-
this
.
b
)
/
e
:
this
.
g
==
b
?
2
+
(
this
.
b
-
this
.
r
)
/
e
:
4
+
(
this
.
r
-
this
.
g
)
/
e
;
e
/=
6
;
e
<
0
&&
(
e
+=
1
);
e
>
1
&&
(
e
-=
1
)}
this
.
h
=
e
;
this
.
s
=
d
;
this
.
v
=
b
},
setHex
:
function
(
b
){
this
.
hex
=~~
b
&
16777215
;
if
(
this
.
autoUpdate
){
this
.
updateRGB
();
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(b,d,e,g){this.x=b;this.y=d;this.z=e;thi
b
.
y
*
g
;
this
.
z
=
b
.
z
*
g
;
this
.
w
=
Math
.
cos
(
e
);
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
b
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
if
(
b
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
b
=
1
/
b
;
this
.
x
*=
b
;
this
.
y
*=
b
;
this
.
z
*=
b
;
this
.
w
*=
b
}
return
this
},
multiplySelf
:
function
(
b
){
var
d
=
this
.
x
,
e
=
this
.
y
,
g
=
this
.
z
,
h
=
this
.
w
,
o
=
b
.
x
,
n
=
b
.
y
,
q
=
b
.
z
;
b
=
b
.
w
;
this
.
x
=
d
*
b
+
h
*
o
+
e
*
q
-
g
*
n
;
this
.
y
=
e
*
b
+
h
*
n
+
g
*
o
-
d
*
q
;
this
.
z
=
g
*
b
+
h
*
q
+
d
*
n
-
e
*
o
;
this
.
w
=
h
*
b
-
d
*
o
-
e
*
n
-
g
*
q
;
return
this
},
multiply
:
function
(
b
,
d
){
this
.
x
=
b
.
x
*
d
.
w
+
b
.
y
*
d
.
z
-
b
.
z
*
d
.
y
+
b
.
w
*
d
.
x
;
this
.
y
=-
b
.
x
*
d
.
z
+
b
.
y
*
d
.
w
+
b
.
z
*
d
.
x
+
b
.
w
*
d
.
y
;
this
.
z
=
b
.
x
*
d
.
y
-
b
.
y
*
d
.
x
+
b
.
z
*
d
.
w
+
b
.
w
*
d
.
z
;
this
.
w
=-
b
.
x
*
d
.
x
-
b
.
y
*
d
.
y
-
b
.
z
*
d
.
z
+
b
.
w
*
d
.
w
;
return
this
},
multiplyVector3
:
function
(
b
,
d
){
d
||
(
d
=
b
);
var
e
=
b
.
x
,
g
=
b
.
y
,
h
=
b
.
z
,
o
=
this
.
x
,
n
=
this
.
y
,
q
=
this
.
z
,
r
=
this
.
w
,
v
=
r
*
e
+
n
*
h
-
q
*
g
,
E
=
r
*
g
+
q
*
e
-
o
*
h
,
F
=
r
*
h
+
o
*
g
-
n
*
e
;
e
=-
o
*
e
-
n
*
g
-
q
*
h
;
d
.
x
=
v
*
r
+
e
*-
o
+
E
*-
q
-
F
*-
n
;
d
.
y
=
E
*
r
+
e
*-
n
+
F
*-
o
-
v
*-
q
;
d
.
z
=
F
*
r
+
e
*-
q
+
v
*-
n
-
E
*-
o
;
return
d
}};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
d
,
e
,
g
){
var
h
=
b
.
w
*
d
.
w
+
b
.
x
*
d
.
x
+
b
.
y
*
d
.
y
+
b
.
z
*
d
.
z
;
if
(
Math
.
abs
(
h
)
>=
1
){
e
.
w
=
b
.
w
;
e
.
x
=
b
.
x
;
e
.
y
=
b
.
y
;
e
.
z
=
b
.
z
;
return
e
}
var
o
=
Math
.
acos
(
h
),
n
=
Math
.
sqrt
(
1
-
h
*
h
);
if
(
Math
.
abs
(
n
)
<
0.001
0
){
e
.
w
=
0.5
*
(
b
.
w
+
d
.
w
);
e
.
x
=
0.5
*
(
b
.
x
+
d
.
x
);
e
.
y
=
0.5
*
(
b
.
y
+
d
.
y
);
e
.
z
=
0.5
*
(
b
.
z
+
d
.
z
);
return
e
}
h
=
Math
.
sin
((
1
-
g
)
*
o
)
/
n
;
g
=
Math
.
sin
(
g
*
o
)
/
n
;
e
.
w
=
b
.
w
*
h
+
d
.
w
*
g
;
e
.
x
=
b
.
x
*
h
+
d
.
x
*
g
;
e
.
y
=
b
.
y
*
h
+
d
.
y
*
g
;
e
.
z
=
b
.
z
*
h
+
d
.
z
*
g
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
d
,
e
,
g
){
var
h
=
b
.
w
*
d
.
w
+
b
.
x
*
d
.
x
+
b
.
y
*
d
.
y
+
b
.
z
*
d
.
z
;
if
(
Math
.
abs
(
h
)
>=
1
){
e
.
w
=
b
.
w
;
e
.
x
=
b
.
x
;
e
.
y
=
b
.
y
;
e
.
z
=
b
.
z
;
return
e
}
var
o
=
Math
.
acos
(
h
),
n
=
Math
.
sqrt
(
1
-
h
*
h
);
if
(
Math
.
abs
(
n
)
<
0.001
){
e
.
w
=
0.5
*
(
b
.
w
+
d
.
w
);
e
.
x
=
0.5
*
(
b
.
x
+
d
.
x
);
e
.
y
=
0.5
*
(
b
.
y
+
d
.
y
);
e
.
z
=
0.5
*
(
b
.
z
+
d
.
z
);
return
e
}
h
=
Math
.
sin
((
1
-
g
)
*
o
)
/
n
;
g
=
Math
.
sin
(
g
*
o
)
/
n
;
e
.
w
=
b
.
w
*
h
+
d
.
w
*
g
;
e
.
x
=
b
.
x
*
h
+
d
.
x
*
g
;
e
.
y
=
b
.
y
*
h
+
d
.
y
*
g
;
e
.
z
=
b
.
z
*
h
+
d
.
z
*
g
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
b
,
d
,
e
,
g
,
h
,
o
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
normal
=
g
instanceof
THREE
.
Vector3
?
g
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
g
instanceof
Array
?
g
:[];
this
.
color
=
h
instanceof
THREE
.
Color
?
h
:
new
THREE
.
Color
;
this
.
vertexColors
=
h
instanceof
Array
?
h
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
o
instanceof
Array
?
o
:[
o
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
b
,
d
,
e
,
g
,
h
,
o
,
n
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
d
=
g
;
this
.
normal
=
h
instanceof
THREE
.
Vector3
?
h
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
h
instanceof
Array
?
h
:[];
this
.
color
=
o
instanceof
THREE
.
Color
?
o
:
new
THREE
.
Color
;
this
.
vertexColors
=
o
instanceof
Array
?
o
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
n
instanceof
Array
?
n
:[
n
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
b
,
d
){
this
.
set
(
b
||
0
,
d
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
b
,
d
){
this
.
u
=
b
;
this
.
v
=
d
;
return
this
},
copy
:
function
(
b
){
this
.
set
(
b
.
u
,
b
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
@@ -205,7 +205,7 @@ m.rotation);c.uniform2fv(x.scale,A);if(m.mergeWith3D&&!z){c.enable(c.DEPTH_TEST)
c
.
enableVertexAttribArray
(
J
.
attributes
.
uv
);
pb
=!
0
}
c
.
uniform1i
(
P
.
occlusionMap
,
0
);
c
.
uniform1i
(
P
.
map
,
1
);
c
.
bindBuffer
(
c
.
ARRAY_BUFFER
,
J
.
vertexBuffer
);
c
.
vertexAttribPointer
(
j
.
vertex
,
2
,
c
.
FLOAT
,
!
1
,
16
,
0
);
c
.
vertexAttribPointer
(
j
.
uv
,
2
,
c
.
FLOAT
,
!
1
,
16
,
8
);
c
.
bindBuffer
(
c
.
ELEMENT_ARRAY_BUFFER
,
J
.
elementBuffer
);
c
.
disable
(
c
.
CULL_FACE
);
c
.
depthMask
(
!
1
);
c
.
activeTexture
(
c
.
TEXTURE0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
J
.
occlusionTexture
);
c
.
activeTexture
(
c
.
TEXTURE1
);
for
(
k
=
0
;
k
<
m
;
k
++
){
j
=
f
.
__webglLensFlares
[
k
].
object
;
A
.
set
(
j
.
matrixWorld
.
n14
,
j
.
matrixWorld
.
n24
,
j
.
matrixWorld
.
n34
);
p
.
matrixWorldInverse
.
multiplyVector3
(
A
);
p
.
projectionMatrix
.
multiplyVector3
(
A
);
O
[
0
]
=
A
.
x
;
O
[
1
]
=
A
.
y
;
O
[
2
]
=
A
.
z
;
W
[
0
]
=
O
[
0
]
*
w
+
w
;
W
[
1
]
=
O
[
1
]
*
z
+
z
;
if
(
J
.
hasVertexTexture
||
W
[
0
]
>
0
&&
W
[
0
]
<
za
&&
W
[
1
]
>
0
&&
W
[
1
]
<
Aa
){
c
.
bindTexture
(
c
.
TEXTURE_2D
,
J
.
tempTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGB
,
W
[
0
]
-
8
,
W
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
P
.
renderType
,
0
);
c
.
uniform2fv
(
P
.
scale
,
B
);
c
.
uniform3fv
(
P
.
screenPosition
,
O
);
c
.
disable
(
c
.
BLEND
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
J
.
occlusionTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGBA
,
W
[
0
]
-
8
,
W
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
P
.
renderType
,
1
);
c
.
disable
(
c
.
DEPTH_TEST
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
J
.
tempTexture
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
j
.
positionScreen
.
x
=
O
[
0
];
j
.
positionScreen
.
y
=
O
[
1
];
j
.
positionScreen
.
z
=
O
[
2
];
j
.
customUpdateCallback
?
j
.
customUpdateCallback
(
j
):
j
.
updateLensFlares
();
c
.
uniform1i
(
P
.
renderType
,
2
);
c
.
enable
(
c
.
BLEND
);
x
=
0
;
for
(
y
=
j
.
lensFlares
.
length
;
x
<
y
;
x
++
){
u
=
j
.
lensFlares
[
x
];
if
(
u
.
opacity
>
0.001
0
&&
u
.
scale
>
0.001
0
){
O
[
0
]
=
u
.
x
;
O
[
1
]
=
u
.
y
;
O
[
2
]
=
u
.
z
;
D
=
u
.
size
*
u
.
scale
/
Aa
;
B
[
0
]
=
D
*
t
;
B
[
1
]
=
D
;
c
.
uniform3fv
(
P
.
screenPosition
,
O
);
c
.
uniform2fv
(
P
.
scale
,
B
);
c
.
uniform1f
(
P
.
rotation
,
u
.
rotation
);
c
.
uniform1f
(
P
.
opacity
,
u
.
opacity
);
pa
(
u
.
blending
);
K
(
u
.
texture
,
1
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
)}}}}
c
.
enable
(
c
.
CULL_FACE
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
depthMask
(
Y
)}
function
V
(
f
,
p
){
f
.
_modelViewMatrix
.
multiplyToArray
(
p
.
matrixWorldInverse
,
f
.
matrixWorld
,
f
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
f
.
_modelViewMatrix
).
transposeIntoArray
(
f
.
_normalMatrixArray
)}
0.001
&&
u
.
scale
>
0.001
){
O
[
0
]
=
u
.
x
;
O
[
1
]
=
u
.
y
;
O
[
2
]
=
u
.
z
;
D
=
u
.
size
*
u
.
scale
/
Aa
;
B
[
0
]
=
D
*
t
;
B
[
1
]
=
D
;
c
.
uniform3fv
(
P
.
screenPosition
,
O
);
c
.
uniform2fv
(
P
.
scale
,
B
);
c
.
uniform1f
(
P
.
rotation
,
u
.
rotation
);
c
.
uniform1f
(
P
.
opacity
,
u
.
opacity
);
pa
(
u
.
blending
);
K
(
u
.
texture
,
1
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
)}}}}
c
.
enable
(
c
.
CULL_FACE
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
depthMask
(
Y
)}
function
V
(
f
,
p
){
f
.
_modelViewMatrix
.
multiplyToArray
(
p
.
matrixWorldInverse
,
f
.
matrixWorld
,
f
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
f
.
_modelViewMatrix
).
transposeIntoArray
(
f
.
_normalMatrixArray
)}
function
L
(
f
){
var
p
,
j
,
k
,
m
,
x
;
if
(
f
instanceof
THREE
.
Mesh
){
j
=
f
.
geometry
;
for
(
p
in
j
.
geometryGroups
){
k
=
j
.
geometryGroups
[
p
];
x
=!
1
;
for
(
m
in
k
.
__webglCustomAttributes
)
if
(
k
.
__webglCustomAttributes
[
m
].
needsUpdate
){
x
=!
0
;
break
}
if
(
j
.
__dirtyVertices
||
j
.
__dirtyMorphTargets
||
j
.
__dirtyElements
||
j
.
__dirtyUvs
||
j
.
__dirtyNormals
||
j
.
__dirtyColors
||
j
.
__dirtyTangents
||
x
){
x
=
c
.
DYNAMIC_DRAW
;
var
y
=
void
0
,
u
=
void
0
,
A
=
void
0
,
t
=
void
0
;
A
=
void
0
;
var
w
=
void
0
,
z
=
void
0
,
D
=
void
0
,
B
=
void
0
,
O
=
void
0
,
W
=
void
0
,
P
=
void
0
,
X
=
void
0
,
Ga
=
void
0
,
T
=
void
0
,
Q
=
void
0
,
U
=
void
0
,
ta
=
void
0
;
z
=
void
0
;
D
=
void
0
;
t
=
void
0
;
B
=
void
0
;
t
=
void
0
;
var
s
=
void
0
,
G
=
void
0
;
z
=
void
0
;
s
=
void
0
;
G
=
void
0
;
var
i
=
void
0
,
Ka
=
void
0
;
s
=
void
0
;
G
=
void
0
;
i
=
void
0
;
Ka
=
void
0
;
s
=
void
0
;
G
=
void
0
;
i
=
void
0
;
Ka
=
void
0
;
s
=
void
0
;
G
=
void
0
;
i
=
void
0
;
t
=
void
0
;
B
=
void
0
;
w
=
void
0
;
A
=
void
0
;
A
=
void
0
;
s
=
void
0
;
G
=
void
0
;
i
=
void
0
;
var
Va
=
void
0
,
ua
=
0
,
Ba
=
0
,
Za
=
0
,
$a
=
0
,
Ja
=
0
,
La
=
0
,
ea
=
0
,
Ma
=
0
,
wa
=
0
,
C
=
0
,
Ca
=
0
;
G
=
s
=
0
;
var
Da
=
k
.
__vertexArray
,
fb
=
k
.
__uvArray
,
gb
=
k
.
__uv2Array
,
Qa
=
k
.
__normalArray
,
ia
=
k
.
__tangentArray
,
Ea
=
k
.
__colorArray
,
ja
=
k
.
__skinVertexAArray
,
ka
=
k
.
__skinVertexBArray
,
la
=
k
.
__skinIndexArray
,
ma
=
k
.
__skinWeightArray
,
hb
=
k
.
__morphTargetsArrays
,
Ra
=
k
.
__webglCustomAttributes
;
i
=
void
0
;
var
Na
=
k
.
__faceArray
,
Oa
=
k
.
__lineArray
,
qb
=
k
.
__needsSmoothNormals
;
W
=
k
.
__vertexColorType
;
O
=
k
.
__uvType
;
P
=
k
.
__normalType
;
var
Ha
=
f
.
geometry
,
ib
=
Ha
.
__dirtyVertices
,
jb
=
Ha
.
__dirtyElements
,
eb
=
Ha
.
__dirtyUvs
,
kb
=
Ha
.
__dirtyNormals
,
lb
=
Ha
.
__dirtyTangents
,
mb
=
Ha
.
__dirtyColors
,
nb
=
Ha
.
__dirtyMorphTargets
,
ab
=
Ha
.
vertices
,
rb
=
k
.
faces
,
ub
=
Ha
.
faces
,
sb
=
Ha
.
faceVertexUvs
[
0
],
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment