Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
dcbcf72f
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dcbcf72f
编写于
6月 01, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added CrosseyedWebGLRenderer.
上级
3bc83727
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
831 addition
and
300 deletion
+831
-300
build/Three.js
build/Three.js
+151
-147
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+1
-1
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+1
-1
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+151
-147
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+2
-2
examples/webgl_materials_cars_camaro_crosseyed.html
examples/webgl_materials_cars_camaro_crosseyed.html
+259
-0
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
...s/webgl_materials_cubemap_balls_refraction_crosseyed.html
+170
-0
src/extras/renderers/CrosseyedWebGLRenderer.js
src/extras/renderers/CrosseyedWebGLRenderer.js
+93
-0
utils/build.py
utils/build.py
+2
-1
未找到文件。
build/Three.js
浏览文件 @
dcbcf72f
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
dcbcf72f
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
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
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
j
=
this
.
w
,
k
=
j
*
c
+
f
*
e
-
h
*
d
,
m
=
j
*
d
+
h
*
c
-
g
*
e
,
p
=
j
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
k
*
j
+
c
*-
g
+
m
*-
h
-
p
*-
f
;
b
.
y
=
m
*
j
+
c
*-
f
+
p
*-
g
-
k
*-
h
;
b
.
z
=
p
*
j
+
c
*-
h
+
k
*-
f
-
m
*-
g
;
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
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
)
return
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
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
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
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
)
return
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
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
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
,
g
){
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
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
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
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
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
};
...
...
build/custom/ThreeDOM.js
浏览文件 @
dcbcf72f
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
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
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
i
=
this
.
w
,
k
=
i
*
c
+
f
*
e
-
h
*
d
,
l
=
i
*
d
+
h
*
c
-
g
*
e
,
n
=
i
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
k
*
i
+
c
*-
g
+
l
*-
h
-
n
*-
f
;
b
.
y
=
l
*
i
+
c
*-
f
+
n
*-
g
-
k
*-
h
;
b
.
z
=
n
*
i
+
c
*-
h
+
k
*-
f
-
l
*-
g
;
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
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
)
return
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
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
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
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
)
return
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
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
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
,
g
){
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
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
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
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
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
;
...
...
build/custom/ThreeExtras.js
浏览文件 @
dcbcf72f
此差异已折叠。
点击以展开。
build/custom/ThreeSVG.js
浏览文件 @
dcbcf72f
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
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
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
i
=
this
.
w
,
l
=
i
*
c
+
f
*
e
-
h
*
d
,
k
=
i
*
d
+
h
*
c
-
g
*
e
,
n
=
i
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
l
*
i
+
c
*-
g
+
k
*-
h
-
n
*-
f
;
b
.
y
=
k
*
i
+
c
*-
f
+
n
*-
g
-
l
*-
h
;
b
.
z
=
n
*
i
+
c
*-
h
+
l
*-
f
-
k
*-
g
;
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
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
)
return
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
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
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
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
)
return
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
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
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
,
g
){
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
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
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
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
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
};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
dcbcf72f
...
...
@@ -50,7 +50,7 @@ THREE.Quaternion.prototype={set:function(b,d,e,f){this.x=b;this.y=d;this.z=e;thi
f
;
this
.
z
=
b
.
z
*
f
;
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
);
b
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
f
=
this
.
z
,
h
=
this
.
w
,
i
=
b
.
x
,
g
=
b
.
y
,
j
=
b
.
z
,
b
=
b
.
w
;
this
.
x
=
d
*
b
+
h
*
i
+
e
*
j
-
f
*
g
;
this
.
y
=
e
*
b
+
h
*
g
+
f
*
i
-
d
*
j
;
this
.
z
=
f
*
b
+
h
*
j
+
d
*
g
-
e
*
i
;
this
.
w
=
h
*
b
-
d
*
i
-
e
*
g
-
f
*
j
;
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
,
f
=
b
.
y
,
h
=
b
.
z
,
i
=
this
.
x
,
g
=
this
.
y
,
j
=
this
.
z
,
p
=
this
.
w
,
k
=
p
*
e
+
g
*
h
-
j
*
f
,
n
=
p
*
f
+
j
*
e
-
i
*
h
,
v
=
p
*
h
+
i
*
f
-
g
*
e
,
e
=-
i
*
e
-
g
*
f
-
j
*
h
;
d
.
x
=
k
*
p
+
e
*-
i
+
n
*-
j
-
v
*-
g
;
d
.
y
=
n
*
p
+
e
*-
g
+
v
*-
i
-
k
*-
j
;
d
.
z
=
v
*
p
+
e
*-
j
+
k
*-
g
-
n
*-
i
;
return
d
}};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
d
,
e
,
f
){
var
h
=
b
.
w
*
d
.
w
+
b
.
x
*
d
.
x
+
b
.
y
*
d
.
y
+
b
.
z
*
d
.
z
;
if
(
Math
.
abs
(
h
)
>=
1
)
return
e
.
w
=
b
.
w
,
e
.
x
=
b
.
x
,
e
.
y
=
b
.
y
,
e
.
z
=
b
.
z
,
e
;
var
i
=
Math
.
acos
(
h
),
g
=
Math
.
sqrt
(
1
-
h
*
h
);
if
(
Math
.
abs
(
g
)
<
0.001
)
return
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
),
e
;
h
=
Math
.
sin
((
1
-
f
)
*
i
)
/
g
;
f
=
Math
.
sin
(
f
*
i
)
/
g
;
e
.
w
=
b
.
w
*
h
+
d
.
w
*
f
;
e
.
x
=
b
.
x
*
h
+
d
.
x
*
f
;
e
.
y
=
b
.
y
*
h
+
d
.
y
*
f
;
e
.
z
=
b
.
z
*
h
+
d
.
z
*
f
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
d
,
e
,
f
){
var
h
=
b
.
w
*
d
.
w
+
b
.
x
*
d
.
x
+
b
.
y
*
d
.
y
+
b
.
z
*
d
.
z
;
if
(
Math
.
abs
(
h
)
>=
1
)
return
e
.
w
=
b
.
w
,
e
.
x
=
b
.
x
,
e
.
y
=
b
.
y
,
e
.
z
=
b
.
z
,
e
;
var
i
=
Math
.
acos
(
h
),
g
=
Math
.
sqrt
(
1
-
h
*
h
);
if
(
Math
.
abs
(
g
)
<
0.001
0
)
return
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
),
e
;
h
=
Math
.
sin
((
1
-
f
)
*
i
)
/
g
;
f
=
Math
.
sin
(
f
*
i
)
/
g
;
e
.
w
=
b
.
w
*
h
+
d
.
w
*
f
;
e
.
x
=
b
.
x
*
h
+
d
.
x
*
f
;
e
.
y
=
b
.
y
*
h
+
d
.
y
*
f
;
e
.
z
=
b
.
z
*
h
+
d
.
z
*
f
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
b
,
d
,
e
,
f
,
h
,
i
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
h
instanceof
THREE
.
Color
?
h
:
new
THREE
.
Color
;
this
.
vertexColors
=
h
instanceof
Array
?
h
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
i
instanceof
Array
?
i
:[
i
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
b
,
d
,
e
,
f
,
h
,
i
,
g
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
d
=
f
;
this
.
normal
=
h
instanceof
THREE
.
Vector3
?
h
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
h
instanceof
Array
?
h
:[];
this
.
color
=
i
instanceof
THREE
.
Color
?
i
:
new
THREE
.
Color
;
this
.
vertexColors
=
i
instanceof
Array
?
i
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
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
};
...
...
@@ -214,7 +214,7 @@ c.uniform1f(h.rotation,g.rotation),c.uniform2fv(h.scale,k),g.mergeWith3D&&!n?(c.
(
c
.
enableVertexAttribArray
(
t
.
attributes
.
vertex
),
c
.
enableVertexAttribArray
(
t
.
attributes
.
uv
),
Ea
=!
0
);
c
.
uniform1i
(
y
.
occlusionMap
,
0
);
c
.
uniform1i
(
y
.
map
,
1
);
c
.
bindBuffer
(
c
.
ARRAY_BUFFER
,
t
.
vertexBuffer
);
c
.
vertexAttribPointer
(
e
.
vertex
,
2
,
c
.
FLOAT
,
!
1
,
16
,
0
);
c
.
vertexAttribPointer
(
e
.
uv
,
2
,
c
.
FLOAT
,
!
1
,
16
,
8
);
c
.
bindBuffer
(
c
.
ELEMENT_ARRAY_BUFFER
,
t
.
elementBuffer
);
c
.
disable
(
c
.
CULL_FACE
);
c
.
depthMask
(
!
1
);
c
.
activeTexture
(
c
.
TEXTURE0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
t
.
occlusionTexture
);
c
.
activeTexture
(
c
.
TEXTURE1
);
for
(
f
=
0
;
f
<
g
;
f
++
)
if
(
e
=
b
.
__webglLensFlares
[
f
].
object
,
k
.
set
(
e
.
matrixWorld
.
n14
,
e
.
matrixWorld
.
n24
,
e
.
matrixWorld
.
n34
),
d
.
matrixWorldInverse
.
multiplyVector3
(
k
),
d
.
projectionMatrix
.
multiplyVector3
(
k
),
q
[
0
]
=
k
.
x
,
q
[
1
]
=
k
.
y
,
q
[
2
]
=
k
.
z
,
z
[
0
]
=
q
[
0
]
*
o
+
o
,
z
[
1
]
=
q
[
1
]
*
n
+
n
,
t
.
hasVertexTexture
||
z
[
0
]
>
0
&&
z
[
0
]
<
O
&&
z
[
1
]
>
0
&&
z
[
1
]
<
H
){
c
.
bindTexture
(
c
.
TEXTURE_2D
,
t
.
tempTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGB
,
z
[
0
]
-
8
,
z
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
y
.
renderType
,
0
);
c
.
uniform2fv
(
y
.
scale
,
v
);
c
.
uniform3fv
(
y
.
screenPosition
,
q
);
c
.
disable
(
c
.
BLEND
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
t
.
occlusionTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGBA
,
z
[
0
]
-
8
,
z
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
y
.
renderType
,
1
);
c
.
disable
(
c
.
DEPTH_TEST
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
t
.
tempTexture
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
e
.
positionScreen
.
x
=
q
[
0
];
e
.
positionScreen
.
y
=
q
[
1
];
e
.
positionScreen
.
z
=
q
[
2
];
e
.
customUpdateCallback
?
e
.
customUpdateCallback
(
e
):
e
.
updateLensFlares
();
c
.
uniform1i
(
y
.
renderType
,
2
);
c
.
enable
(
c
.
BLEND
);
h
=
0
;
for
(
i
=
e
.
lensFlares
.
length
;
h
<
i
;
h
++
)
if
(
j
=
e
.
lensFlares
[
h
],
j
.
opacity
>
0.001
&&
j
.
scale
>
0.001
)
q
[
0
]
=
j
.
x
,
q
[
1
]
=
j
.
y
,
q
[
2
]
=
j
.
z
,
r
=
j
.
size
*
j
.
scale
/
H
,
v
[
0
]
=
r
*
p
,
v
[
1
]
=
r
,
c
.
uniform3fv
(
y
.
screenPosition
,
q
),
c
.
uniform2fv
(
y
.
scale
,
v
),
c
.
uniform1f
(
y
.
rotation
,
j
.
rotation
),
c
.
uniform1f
(
y
.
opacity
,
j
.
opacity
),
L
(
j
.
blending
),
x
(
j
.
texture
,
1
),
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
)}
c
.
enable
(
c
.
CULL_FACE
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
depthMask
(
ra
)}
function
D
(
b
,
c
){
b
.
_modelViewMatrix
.
multiplyToArray
(
c
.
matrixWorldInverse
,
b
.
matrixWorld
,
b
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
b
.
_modelViewMatrix
).
transposeIntoArray
(
b
.
_normalMatrixArray
)}
i
;
h
++
)
if
(
j
=
e
.
lensFlares
[
h
],
j
.
opacity
>
0.001
0
&&
j
.
scale
>
0.0010
)
q
[
0
]
=
j
.
x
,
q
[
1
]
=
j
.
y
,
q
[
2
]
=
j
.
z
,
r
=
j
.
size
*
j
.
scale
/
H
,
v
[
0
]
=
r
*
p
,
v
[
1
]
=
r
,
c
.
uniform3fv
(
y
.
screenPosition
,
q
),
c
.
uniform2fv
(
y
.
scale
,
v
),
c
.
uniform1f
(
y
.
rotation
,
j
.
rotation
),
c
.
uniform1f
(
y
.
opacity
,
j
.
opacity
),
L
(
j
.
blending
),
x
(
j
.
texture
,
1
),
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
)}
c
.
enable
(
c
.
CULL_FACE
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
depthMask
(
ra
)}
function
D
(
b
,
c
){
b
.
_modelViewMatrix
.
multiplyToArray
(
c
.
matrixWorldInverse
,
b
.
matrixWorld
,
b
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
b
.
_modelViewMatrix
).
transposeIntoArray
(
b
.
_normalMatrixArray
)}
function
y
(
b
){
var
e
,
f
,
g
,
h
,
i
;
if
(
b
instanceof
THREE
.
Mesh
){
f
=
b
.
geometry
;
for
(
e
in
f
.
geometryGroups
){
g
=
f
.
geometryGroups
[
e
];
i
=!
1
;
for
(
h
in
g
.
__webglCustomAttributes
)
if
(
g
.
__webglCustomAttributes
[
h
].
needsUpdate
){
i
=!
0
;
break
}
if
(
f
.
__dirtyVertices
||
f
.
__dirtyMorphTargets
||
f
.
__dirtyElements
||
f
.
__dirtyUvs
||
f
.
__dirtyNormals
||
f
.
__dirtyColors
||
f
.
__dirtyTangents
||
i
){
i
=
b
;
var
j
=
c
.
DYNAMIC_DRAW
;
if
(
g
.
__inittedArrays
){
var
k
=
void
0
,
p
=
void
0
,
n
=
void
0
,
o
=
void
0
,
G
=
n
=
void
0
,
r
=
void
0
,
v
=
void
0
,
q
=
void
0
,
t
=
void
0
,
z
=
void
0
,
y
=
void
0
,
x
=
void
0
,
C
=
void
0
,
u
=
void
0
,
I
=
void
0
,
K
=
void
0
,
D
=
void
0
,
s
=
o
=
q
=
o
=
v
=
r
=
void
0
,
A
=
void
0
,
m
=
A
=
s
=
r
=
void
0
,
F
=
void
0
,
J
=
m
=
A
=
s
=
n
=
n
=
G
=
q
=
o
=
m
=
A
=
s
=
F
=
m
=
A
=
s
=
F
=
m
=
A
=
s
=
void
0
,
B
=
0
,
E
=
0
,
O
=
0
,
P
=
0
,
H
=
0
,
M
=
0
,
T
=
0
,
N
=
0
,
ca
=
0
,
w
=
0
,
da
=
0
,
A
=
s
=
0
,
L
=
g
.
__vertexArray
,
Z
=
g
.
__uvArray
,
$
=
g
.
__uv2Array
,
Q
=
g
.
__normalArray
,
U
=
g
.
__tangentArray
,
ea
=
g
.
__colorArray
,
V
=
g
.
__skinVertexAArray
,
W
=
g
.
__skinVertexBArray
,
X
=
g
.
__skinIndexArray
,
Y
=
g
.
__skinWeightArray
,
aa
=
g
.
__morphTargetsArrays
,
R
=
g
.
__webglCustomAttributes
,
m
=
void
0
,
ma
=
g
.
__faceArray
,
S
=
g
.
__lineArray
,
ja
=
g
.
__needsSmoothNormals
,
z
=
g
.
__vertexColorType
,
t
=
g
.
__uvType
,
y
=
g
.
__normalType
,
ga
=
i
.
geometry
,
ha
=
ga
.
__dirtyVertices
,
ia
=
ga
.
__dirtyElements
,
fa
=
ga
.
__dirtyUvs
,
ka
=
ga
.
__dirtyNormals
,
na
=
ga
.
__dirtyTangents
,
oa
=
ga
.
__dirtyColors
,
pa
=
ga
.
__dirtyMorphTargets
,
la
=
ga
.
vertices
,
qa
=
g
.
faces
,
ra
=
ga
.
faces
,
sa
=
ga
.
faceVertexUvs
[
0
],
ta
=
ga
.
faceVertexUvs
[
1
],
xa
=
ga
.
skinVerticesA
,
ya
=
ga
.
skinVerticesB
,
za
=
ga
.
skinIndices
,
va
=
ga
.
skinWeights
,
wa
=
i
instanceof
THREE
.
ShadowVolume
?
ga
.
edgeFaces
:
void
0
;
morphTargets
=
ga
.
morphTargets
;
if
(
R
)
for
(
J
in
R
)
R
[
J
].
offset
=
0
,
R
[
J
].
offsetSrc
=
...
...
examples/webgl_materials_cars_camaro_crosseyed.html
0 → 100644
浏览文件 @
dcbcf72f
<!DOCTYPE HTML>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - materials - cube reflection [camaro]
</title>
<meta
charset=
"utf-8"
>
<style
type=
"text/css"
>
body
{
background
:
#000
;
color
:
#fff
;
padding
:
0
;
margin
:
0
;
overflow
:
hidden
;
font-family
:
georgia
;
text-align
:
center
;
}
h1
{
}
a
{
color
:
skyblue
}
canvas
{
pointer-events
:
none
;
z-index
:
10
;
position
:
relative
;
}
#log
{
position
:
absolute
;
top
:
50px
;
text-align
:
left
;
display
:
block
;
z-index
:
100
}
#d
{
text-align
:
center
;
margin
:
1em
0
-2.5em
0
;
z-index
:
0
;
position
:
relative
;
display
:
block
}
#buttons
{
margin
:
0.5em
0
0
0
}
button
{
font-family
:
georgia
;
border
:
0
;
background
:
#222
;
color
:
#fff
;
padding
:
0.2em
0.5em
;
cursor
:
pointer
;
border-radius
:
3px
}
button
:hover
{
background
:
#333
}
</style>
</head>
<body>
<div
id=
"d"
>
<div
id=
"info"
>
<a
href=
"http://github.com/mrdoob/three.js"
target=
"_blank"
>
three.js
</a>
- webgl cube reflection demo. chevrolet camaro by
<a
href=
"http://www.turbosquid.com/3d-models/blender-camaro/411348"
target=
"_blank"
>
dskfnwn
</a>
- O, P : change eye separation
</div>
<div
id=
"buttons"
></div>
</div>
<div
id=
"log"
></div>
<script
type=
"text/javascript"
src=
"js/ThreeCross.js"
></script>
<script
type=
"text/javascript"
src=
"js/Detector.js"
></script>
<script
type=
"text/javascript"
src=
"js/RequestAnimationFrame.js"
></script>
<script
type=
"text/javascript"
src=
"js/Stats.js"
></script>
<script
type=
"text/javascript"
>
if
(
!
Detector
.
webgl
)
Detector
.
addGetWebGLMessage
();
var
SCREEN_WIDTH
=
window
.
innerWidth
;
var
SCREEN_HEIGHT
=
window
.
innerHeight
;
var
container
,
stats
;
var
camera
,
scene
,
webglRenderer
;
var
lightMesh
;
var
directionalLight
,
pointLight
;
var
mouseX
=
0
,
mouseY
=
0
;
var
windowHalfX
=
window
.
innerWidth
/
2
;
var
windowHalfY
=
window
.
innerHeight
/
2
;
init
();
animate
();
function
init
()
{
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
Camera
(
70
,
SCREEN_WIDTH
/
SCREEN_HEIGHT
,
1
,
100000
);
camera
.
position
.
z
=
1000
;
camera
.
updateMatrix
();
scene
=
new
THREE
.
Scene
();
// LIGHTS
var
ambient
=
new
THREE
.
AmbientLight
(
0x555555
);
scene
.
addLight
(
ambient
);
directionalLight
=
new
THREE
.
DirectionalLight
(
0xffffff
);
directionalLight
.
position
.
x
=
1
;
directionalLight
.
position
.
y
=
1
;
directionalLight
.
position
.
z
=
0.5
;
directionalLight
.
position
.
normalize
();
scene
.
addLight
(
directionalLight
);
pointLight
=
new
THREE
.
PointLight
(
0xffaa00
);
pointLight
.
position
.
x
=
0
;
pointLight
.
position
.
y
=
0
;
pointLight
.
position
.
z
=
0
;
scene
.
addLight
(
pointLight
);
sphere
=
new
THREE
.
Sphere
(
100
,
16
,
8
,
1
);
lightMesh
=
new
THREE
.
Mesh
(
sphere
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffaa00
}
)
);
lightMesh
.
scale
.
x
=
lightMesh
.
scale
.
y
=
lightMesh
.
scale
.
z
=
0.05
;
lightMesh
.
position
=
pointLight
.
position
;
lightMesh
.
overdraw
=
true
;
lightMesh
.
updateMatrix
();
scene
.
addObject
(
lightMesh
);
webglRenderer
=
new
THREE
.
CrosseyedWebGLRenderer
(
{
separation
:
20
}
);
webglRenderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
webglRenderer
.
domElement
);
webglRenderer
.
setFaceCulling
(
0
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
stats
.
domElement
.
style
.
zIndex
=
100
;
container
.
appendChild
(
stats
.
domElement
);
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
document
.
addEventListener
(
'
keydown
'
,
onKeyDown
,
false
);
var
r
=
"
textures/cube/SwedishRoyalCastle/
"
;
var
urls
=
[
r
+
"
px.jpg
"
,
r
+
"
nx.jpg
"
,
r
+
"
py.jpg
"
,
r
+
"
ny.jpg
"
,
r
+
"
pz.jpg
"
,
r
+
"
nz.jpg
"
];
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
);
var
camaroMaterials
=
{
body
:
[],
chrome
:
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xffffff
,
envMap
:
textureCube
}
),
darkchrome
:
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x444444
,
envMap
:
textureCube
}
),
glass
:
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x223344
,
envMap
:
textureCube
,
opacity
:
0.25
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.25
,
transparent
:
true
}
),
tire
:
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x050505
}
),
interior
:
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x050505
,
shininess
:
20
}
),
black
:
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x000000
}
)
}
camaroMaterials
.
body
.
push
(
[
"
Orange
"
,
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xff6600
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.3
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Blue
"
,
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x226699
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.3
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Red
"
,
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x660000
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.5
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Black
"
,
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x000000
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.5
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
White
"
,
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xffffff
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.5
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Carmine
"
,
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x770000
,
specular
:
0xffaaaa
,
envMap
:
textureCube
,
combine
:
THREE
.
MultiplyOperation
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Gold
"
,
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xaa9944
,
specular
:
0xbbaa99
,
shininess
:
50
,
envMap
:
textureCube
,
combine
:
THREE
.
MultiplyOperation
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Bronze
"
,
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x150505
,
specular
:
0xee6600
,
shininess
:
10
,
envMap
:
textureCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.5
}
)
]
);
camaroMaterials
.
body
.
push
(
[
"
Chrome
"
,
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0xffffff
,
envMap
:
textureCube
,
combine
:
THREE
.
MultiplyOperation
}
)
]
);
var
loader
=
new
THREE
.
BinaryLoader
();
loader
.
load
(
{
model
:
"
obj/camaro/CamaroNoUv_bin.js
"
,
callback
:
function
(
geometry
)
{
createScene
(
geometry
,
camaroMaterials
)
}
}
);
}
function
$
(
id
)
{
return
document
.
getElementById
(
id
)
}
function
createButtons
(
materials
,
geometry
)
{
var
i
,
src
=
""
,
parent
=
$
(
"
buttons
"
);
for
(
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
src
+=
'
<button id="m
'
+
i
+
'
">
'
+
materials
[
i
][
0
]
+
'
</button>
'
;
}
parent
.
innerHTML
=
src
;
for
(
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
$
(
"
m
"
+
i
).
counter
=
i
;
$
(
"
m
"
+
i
).
addEventListener
(
'
click
'
,
function
()
{
geometry
.
materials
[
0
][
0
]
=
materials
[
this
.
counter
][
1
]
},
false
);
}
}
function
createScene
(
geometry
,
materials
)
{
var
s
=
75
,
m
=
new
THREE
.
MeshFaceMaterial
();
geometry
.
materials
[
0
][
0
]
=
materials
.
body
[
0
][
1
];
// car body
geometry
.
materials
[
1
][
0
]
=
materials
.
chrome
;
// wheels chrome
geometry
.
materials
[
2
][
0
]
=
materials
.
chrome
;
// grille chrome
geometry
.
materials
[
3
][
0
]
=
materials
.
darkchrome
;
// door lines
geometry
.
materials
[
4
][
0
]
=
materials
.
glass
;
// windshield
geometry
.
materials
[
5
][
0
]
=
materials
.
interior
;
// interior
geometry
.
materials
[
6
][
0
]
=
materials
.
tire
;
// tire
geometry
.
materials
[
7
][
0
]
=
materials
.
black
;
// tireling
geometry
.
materials
[
8
][
0
]
=
materials
.
black
;
// behind grille
THREE
.
SceneUtils
.
addMesh
(
scene
,
geometry
,
s
,
0
,
0
,
0
,
0.0
,
1.0
,
0.0
,
m
);
createButtons
(
materials
.
body
,
geometry
);
}
function
onDocumentMouseMove
(
event
)
{
mouseX
=
(
event
.
clientX
-
windowHalfX
);
mouseY
=
(
event
.
clientY
-
windowHalfY
);
}
function
onKeyDown
(
event
)
{
switch
(
event
.
keyCode
)
{
/* O */
case
79
:
webglRenderer
.
separation
-=
0.5
;
break
;
/* P */
case
80
:
webglRenderer
.
separation
+=
0.5
;
break
;
}
console
.
log
(
webglRenderer
.
separation
);
};
//
function
animate
()
{
requestAnimationFrame
(
animate
);
render
();
stats
.
update
();
}
function
render
()
{
var
timer
=
-
new
Date
().
getTime
()
*
0.0002
;
camera
.
position
.
x
+=
(
mouseX
-
camera
.
position
.
x
)
*
.
05
;
camera
.
position
.
y
+=
(
-
mouseY
-
camera
.
position
.
y
)
*
.
05
;
lightMesh
.
position
.
x
=
1500
*
Math
.
cos
(
timer
);
lightMesh
.
position
.
z
=
1500
*
Math
.
sin
(
timer
);
webglRenderer
.
render
(
scene
,
camera
);
}
function
log
(
text
)
{
var
e
=
document
.
getElementById
(
"
log
"
);
e
.
innerHTML
=
text
+
"
<br/>
"
+
e
.
innerHTML
;
}
</script>
</body>
</html>
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
0 → 100644
浏览文件 @
dcbcf72f
<!DOCTYPE HTML>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - materials - cube refraction [balls]
</title>
<meta
charset=
"utf-8"
>
<style
type=
"text/css"
>
body
{
background
:
#777
;
padding
:
0
;
margin
:
0
;
font-weight
:
bold
;
overflow
:
hidden
;
}
#info
{
position
:
absolute
;
top
:
0px
;
width
:
100%
;
color
:
#ffffff
;
padding
:
5px
;
font-family
:
Monospace
;
font-size
:
13px
;
text-align
:
center
;
z-index
:
1000
;
}
a
{
color
:
#ffffff
;
}
#oldie
a
{
color
:
#da0
}
</style>
</head>
<body>
<div
id=
"info"
>
<a
href=
"http://github.com/mrdoob/three.js"
target=
"_blank"
>
three.js
</a>
- webgl cube refraction demo. skybox by
<a
href=
"http://www.zfight.com/"
target=
"_blank"
>
Jochum Skoglund
</a>
- O, P : change eye separation
</div>
<script
type=
"text/javascript"
src=
"js/ThreeCross.js"
></script>
<script
type=
"text/javascript"
src=
"js/Detector.js"
></script>
<script
type=
"text/javascript"
src=
"js/RequestAnimationFrame.js"
></script>
<script
type=
"text/javascript"
>
if
(
!
Detector
.
webgl
)
Detector
.
addGetWebGLMessage
();
var
container
,
timer
;
var
camera
,
scene
,
webglRenderer
;
var
mesh
,
zmesh
,
lightMesh
,
geometry
;
var
spheres
=
[];
var
directionalLight
,
pointLight
;
var
mouseX
=
0
,
mouseY
=
0
;
var
windowHalfX
=
window
.
innerWidth
/
2
;
var
windowHalfY
=
window
.
innerHeight
/
2
;
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
init
();
animate
();
function
init
()
{
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
Camera
(
60
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
100000
);
camera
.
position
.
z
=
3200
;
scene
=
new
THREE
.
Scene
();
var
geometry
=
new
THREE
.
Sphere
(
100
,
32
,
16
);
var
path
=
"
textures/cube/skybox/
"
;
var
format
=
'
.jpg
'
;
var
urls
=
[
path
+
'
px
'
+
format
,
path
+
'
nx
'
+
format
,
path
+
'
py
'
+
format
,
path
+
'
ny
'
+
format
,
path
+
'
pz
'
+
format
,
path
+
'
nz
'
+
format
];
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
new
THREE
.
CubeRefractionMapping
()
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
envMap
:
textureCube
,
refractionRatio
:
0.95
}
);
for
(
var
i
=
0
;
i
<
500
;
i
++
)
{
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
Math
.
random
()
*
10000
-
5000
;
mesh
.
position
.
y
=
Math
.
random
()
*
10000
-
5000
;
mesh
.
position
.
z
=
Math
.
random
()
*
10000
-
5000
;
mesh
.
scale
.
x
=
mesh
.
scale
.
y
=
mesh
.
scale
.
z
=
Math
.
random
()
*
3
+
1
;
scene
.
addObject
(
mesh
);
spheres
.
push
(
mesh
);
}
THREE
.
SceneUtils
.
addPanoramaCubeWebGL
(
scene
,
100000
,
textureCube
);
webglRenderer
=
new
THREE
.
CrosseyedWebGLRenderer
(
{
separation
:
90
}
);
webglRenderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
webglRenderer
.
domElement
);
document
.
addEventListener
(
'
keydown
'
,
onKeyDown
,
false
);
}
function
onDocumentMouseMove
(
event
)
{
mouseX
=
(
event
.
clientX
-
windowHalfX
)
*
10
;
mouseY
=
(
event
.
clientY
-
windowHalfY
)
*
10
;
}
function
onKeyDown
(
event
)
{
switch
(
event
.
keyCode
)
{
/* O */
case
79
:
webglRenderer
.
separation
-=
0.5
;
break
;
/* P */
case
80
:
webglRenderer
.
separation
+=
0.5
;
break
;
}
console
.
log
(
webglRenderer
.
separation
);
};
//
function
animate
()
{
requestAnimationFrame
(
animate
);
render
();
}
function
render
()
{
timer
=
new
Date
().
getTime
()
*
0.0001
;
camera
.
position
.
x
+=
(
mouseX
-
camera
.
position
.
x
)
*
.
05
;
camera
.
position
.
y
+=
(
-
mouseY
-
camera
.
position
.
y
)
*
.
05
;
for
(
var
i
=
0
,
il
=
spheres
.
length
;
i
<
il
;
i
++
)
{
var
sphere
=
spheres
[
i
];
sphere
.
position
.
x
=
5000
*
Math
.
cos
(
timer
+
i
);
sphere
.
position
.
y
=
5000
*
Math
.
sin
(
timer
+
i
*
1.1
);
}
webglRenderer
.
render
(
scene
,
camera
);
}
</script>
</body>
</html>
src/extras/renderers/CrosseyedWebGLRenderer.js
0 → 100644
浏览文件 @
dcbcf72f
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE
.
CrosseyedWebGLRenderer
=
function
(
parameters
)
{
THREE
.
WebGLRenderer
.
call
(
this
,
parameters
);
var
_this
=
this
,
_setSize
=
this
.
setSize
,
_render
=
this
.
render
;
var
_cameraL
=
new
THREE
.
Camera
(),
_cameraR
=
new
THREE
.
Camera
();
var
_params
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
NearestFilter
,
format
:
THREE
.
RGBAFormat
};
var
_renderTargetL
=
new
THREE
.
WebGLRenderTarget
(
256
,
512
,
_params
),
_renderTargetR
=
new
THREE
.
WebGLRenderTarget
(
256
,
512
,
_params
);
_this
.
separation
=
10
;
if
(
parameters
&&
parameters
.
separation
!==
undefined
)
_this
.
separation
=
parameters
.
separation
;
var
SCREEN_WIDTH
=
window
.
innerWidth
;
var
SCREEN_HEIGHT
=
window
.
innerHeight
;
var
HALF_WIDTH
=
SCREEN_WIDTH
/
2
;
var
_orthoCamera
=
new
THREE
.
Camera
();
_orthoCamera
.
projectionMatrix
=
THREE
.
Matrix4
.
makeOrtho
(
SCREEN_WIDTH
/
-
2
,
SCREEN_WIDTH
/
2
,
SCREEN_HEIGHT
/
2
,
SCREEN_HEIGHT
/
-
2
,
-
10000
,
10000
);
var
_camera
=
new
THREE
.
Camera
(
53
,
HALF_WIDTH
/
SCREEN_HEIGHT
,
1
,
10000
);
_camera
.
position
.
z
=
-
10
;
var
base
=
THREE
.
ShaderUtils
.
lib
[
"
screen
"
];
var
uniformsL
=
THREE
.
UniformsUtils
.
clone
(
base
.
uniforms
);
var
uniformsR
=
THREE
.
UniformsUtils
.
clone
(
base
.
uniforms
);
uniformsL
.
tDiffuse
.
texture
=
_renderTargetL
;
uniformsR
.
tDiffuse
.
texture
=
_renderTargetR
;
var
screenMaterialL
=
new
THREE
.
MeshShaderMaterial
(
{
fragmentShader
:
base
.
fragmentShader
,
vertexShader
:
base
.
vertexShader
,
uniforms
:
uniformsL
}
);
var
screenMaterialR
=
new
THREE
.
MeshShaderMaterial
(
{
fragmentShader
:
base
.
fragmentShader
,
vertexShader
:
base
.
vertexShader
,
uniforms
:
uniformsR
}
);
var
_left
=
new
THREE
.
Mesh
(
new
THREE
.
Plane
(
HALF_WIDTH
,
SCREEN_HEIGHT
),
screenMaterialL
);
var
_right
=
new
THREE
.
Mesh
(
new
THREE
.
Plane
(
HALF_WIDTH
,
SCREEN_HEIGHT
),
screenMaterialR
);
_left
.
position
.
x
=
-
HALF_WIDTH
/
2
;
_right
.
position
.
x
=
HALF_WIDTH
/
2
;
var
_scene
=
new
THREE
.
Scene
();
_scene
.
addObject
(
_left
);
_scene
.
addObject
(
_right
);
this
.
setSize
=
function
(
width
,
height
)
{
_setSize
.
call
(
_this
,
width
,
height
);
_renderTargetL
.
width
=
width
/
2
;
_renderTargetL
.
height
=
height
;
_renderTargetR
.
width
=
width
/
2
;
_renderTargetR
.
height
=
height
;
};
this
.
render
=
function
(
scene
,
camera
,
renderTarget
,
forceClear
)
{
_cameraL
.
fov
=
camera
.
fov
;
_cameraL
.
aspect
=
0.5
*
camera
.
aspect
;
_cameraL
.
near
=
camera
.
near
;
_cameraL
.
far
=
camera
.
far
;
_cameraL
.
updateProjectionMatrix
();
_cameraL
.
position
.
copy
(
camera
.
position
);
_cameraL
.
target
.
position
.
copy
(
camera
.
target
.
position
);
_cameraL
.
translateX
(
_this
.
separation
);
_cameraR
.
projectionMatrix
=
_cameraL
.
projectionMatrix
;
_cameraR
.
position
.
copy
(
camera
.
position
);
_cameraR
.
target
.
position
.
copy
(
camera
.
target
.
position
);
_cameraR
.
translateX
(
-
_this
.
separation
);
_render
.
call
(
_this
,
scene
,
_cameraL
,
_renderTargetL
);
_render
.
call
(
_this
,
scene
,
_cameraR
,
_renderTargetR
);
_render
.
call
(
_this
,
_scene
,
_orthoCamera
);
};
};
THREE
.
CrosseyedWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
();
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
;
utils/build.py
浏览文件 @
dcbcf72f
...
...
@@ -110,7 +110,8 @@ EXTRAS_FILES = [
'extras/objects/Trident.js'
,
'extras/physics/Collisions.js'
,
'extras/physics/CollisionUtils.js'
,
'extras/renderers/AnaglyphWebGLRenderer.js'
'extras/renderers/AnaglyphWebGLRenderer.js'
,
'extras/renderers/CrosseyedWebGLRenderer.js'
]
CANVAS_FILES
=
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录