Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
5accd0cf
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
5accd0cf
编写于
1月 18, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Brought back Object3D.rotationMatrix (Projector still uses it).
上级
ecedea4b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
29 deletion
+31
-29
build/Three.js
build/Three.js
+5
-5
build/ThreeDebug.js
build/ThreeDebug.js
+5
-5
build/ThreeExtras.js
build/ThreeExtras.js
+5
-5
examples/uqbiquity_test.html
examples/uqbiquity_test.html
+4
-8
src/core/Matrix4.js
src/core/Matrix4.js
+6
-5
src/objects/Object3D.js
src/objects/Object3D.js
+6
-1
未找到文件。
build/Three.js
浏览文件 @
5accd0cf
...
...
@@ -59,11 +59,11 @@ THREE.Camera=function(a,d,e,f){this.fov=a;this.aspect=d;this.near=e;this.far=f;t
this
.
translateZ
=
function
(
h
){
this
.
tmpVec
.
sub
(
this
.
target
.
position
,
this
.
position
).
normalize
().
multiplyScalar
(
h
);
this
.
position
.
subSelf
(
this
.
tmpVec
);
this
.
target
.
position
.
subSelf
(
this
.
tmpVec
)};
this
.
updateMatrix
=
function
(){
this
.
matrix
.
lookAt
(
this
.
position
,
this
.
target
.
position
,
this
.
up
)};
this
.
updateProjectionMatrix
=
function
(){
this
.
projectionMatrix
=
THREE
.
Matrix4
.
makePerspective
(
this
.
fov
,
this
.
aspect
,
this
.
near
,
this
.
far
)};
this
.
updateProjectionMatrix
()};
THREE
.
Camera
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Camera (
"
+
this
.
position
+
"
,
"
+
this
.
target
.
position
+
"
)
"
}};
THREE
.
Light
=
function
(
a
){
this
.
color
=
new
THREE
.
Color
(
a
)};
THREE
.
AmbientLight
=
function
(
a
){
THREE
.
Light
.
call
(
this
,
a
)};
THREE
.
AmbientLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
AmbientLight
.
prototype
.
constructor
=
THREE
.
AmbientLight
;
THREE
.
DirectionalLight
=
function
(
a
,
d
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
this
.
intensity
=
d
||
1
};
THREE
.
DirectionalLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
DirectionalLight
.
prototype
.
constructor
=
THREE
.
DirectionalLight
;
THREE
.
PointLight
=
function
(
a
,
d
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
=
new
THREE
.
Vector3
;
this
.
intensity
=
d
||
1
};
THREE
.
DirectionalLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
DirectionalLight
.
prototype
.
constructor
=
THREE
.
PointLight
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
position
=
new
THREE
.
Vector3
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
tmpMatrix
=
new
THREE
.
Matrix4
;
this
.
screen
=
new
THREE
.
Vector3
;
this
.
visible
=
this
.
autoUpdateMatrix
=
true
};
THREE
.
Object3D
.
prototype
=
{
updateMatrix
:
function
(){
var
a
=
this
.
position
,
d
=
this
.
rotation
,
e
=
this
.
scale
,
f
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
a
.
x
,
a
.
y
,
a
.
z
);
if
(
d
.
x
!=
0
){
f
.
setRotX
(
d
.
x
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
d
.
y
!=
0
){
f
.
setRotY
(
d
.
y
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
d
.
z
!=
0
){
f
.
setRotZ
(
d
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
e
.
x
!=
0
||
e
.
y
!=
0
||
e
.
z
!=
0
){
f
.
setScale
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
type
=
e
!=
undefined
?
e
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
overdraw
=
this
.
doubleSided
=
this
.
flipSided
=
false
;
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
()}
;
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
FlatShading
=
0
;
THREE
.
SmoothShading
=
1
;
THREE
.
NormalBlending
=
0
;
THREE
.
AdditiveBlending
=
1
;
THREE
.
SubtractiveBlending
=
2
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
position
=
new
THREE
.
Vector3
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
rotationMatrix
=
new
THREE
.
Matrix4
;
this
.
tmpMatrix
=
new
THREE
.
Matrix4
;
this
.
screen
=
new
THREE
.
Vector3
;
this
.
visible
=
this
.
autoUpdateMatrix
=
true
};
THREE
.
Object3D
.
prototype
=
{
updateMatrix
:
function
(){
var
a
=
this
.
position
,
d
=
this
.
rotation
,
e
=
this
.
scale
,
f
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
a
.
x
,
a
.
y
,
a
.
z
);
this
.
rotationMatrix
.
identity
();
if
(
d
.
x
!=
0
){
f
.
setRotX
(
d
.
x
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
d
.
y
!=
0
){
f
.
setRotY
(
d
.
y
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
d
.
z
!=
0
){
f
.
setRotZ
(
d
.
z
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
e
.
x
!=
0
||
e
.
y
!=
0
||
e
.
z
!=
0
){
f
.
setScale
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
type
=
e
!=
undefined
?
e
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
overdraw
=
this
.
doubleSided
=
this
.
flipSided
=
false
;
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
()};
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
FlatShading
=
0
;
THREE
.
SmoothShading
=
1
;
THREE
.
NormalBlending
=
0
;
THREE
.
AdditiveBlending
=
1
;
THREE
.
SubtractiveBlending
=
2
;
THREE
.
LineBasicMaterial
=
function
(
a
){
this
.
color
=
new
THREE
.
Color
(
16777215
);
this
.
opacity
=
1
;
this
.
blending
=
THREE
.
NormalBlending
;
this
.
linewidth
=
1
;
this
.
linejoin
=
this
.
linecap
=
"
round
"
;
if
(
a
){
a
.
color
!==
undefined
&&
this
.
color
.
setHex
(
a
.
color
);
if
(
a
.
opacity
!==
undefined
)
this
.
opacity
=
a
.
opacity
;
if
(
a
.
blending
!==
undefined
)
this
.
blending
=
a
.
blending
;
if
(
a
.
linewidth
!==
undefined
)
this
.
linewidth
=
a
.
linewidth
;
if
(
a
.
linecap
!==
undefined
)
this
.
linecap
=
a
.
linecap
;
if
(
a
.
linejoin
!==
undefined
)
this
.
linejoin
=
a
.
linejoin
}};
THREE
.
LineBasicMaterial
.
prototype
=
{
toString
:
function
(){
return
"
THREE.LineBasicMaterial (<br/>color:
"
+
this
.
color
+
"
<br/>opacity:
"
+
this
.
opacity
+
"
<br/>blending:
"
+
this
.
blending
+
"
<br/>linewidth:
"
+
this
.
linewidth
+
"
<br/>linecap:
"
+
this
.
linecap
+
"
<br/>linejoin:
"
+
this
.
linejoin
+
"
<br/>)
"
}};
THREE
.
MeshBasicMaterial
=
function
(
a
){
this
.
id
=
THREE
.
MeshBasicMaterialCounter
.
value
++
;
this
.
color
=
new
THREE
.
Color
(
16777215
);
this
.
env_map
=
this
.
map
=
null
;
this
.
combine
=
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
1
;
this
.
refraction_ratio
=
0.98
;
this
.
fog
=
true
;
this
.
opacity
=
1
;
this
.
shading
=
THREE
.
SmoothShading
;
this
.
blending
=
THREE
.
NormalBlending
;
this
.
wireframe
=
false
;
this
.
wireframe_linewidth
=
1
;
this
.
wireframe_linejoin
=
this
.
wireframe_linecap
=
"
round
"
;
if
(
a
){
a
.
color
!==
undefined
&&
this
.
color
.
setHex
(
a
.
color
);
if
(
a
.
map
!==
undefined
)
this
.
map
=
...
...
build/ThreeDebug.js
浏览文件 @
5accd0cf
...
...
@@ -59,11 +59,11 @@ THREE.Camera=function(a,d,e,f){this.fov=a;this.aspect=d;this.near=e;this.far=f;t
this
.
translateZ
=
function
(
h
){
this
.
tmpVec
.
sub
(
this
.
target
.
position
,
this
.
position
).
normalize
().
multiplyScalar
(
h
);
this
.
position
.
subSelf
(
this
.
tmpVec
);
this
.
target
.
position
.
subSelf
(
this
.
tmpVec
)};
this
.
updateMatrix
=
function
(){
this
.
matrix
.
lookAt
(
this
.
position
,
this
.
target
.
position
,
this
.
up
)};
this
.
updateProjectionMatrix
=
function
(){
this
.
projectionMatrix
=
THREE
.
Matrix4
.
makePerspective
(
this
.
fov
,
this
.
aspect
,
this
.
near
,
this
.
far
)};
this
.
updateProjectionMatrix
()};
THREE
.
Camera
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Camera (
"
+
this
.
position
+
"
,
"
+
this
.
target
.
position
+
"
)
"
}};
THREE
.
Light
=
function
(
a
){
this
.
color
=
new
THREE
.
Color
(
a
)};
THREE
.
AmbientLight
=
function
(
a
){
THREE
.
Light
.
call
(
this
,
a
)};
THREE
.
AmbientLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
AmbientLight
.
prototype
.
constructor
=
THREE
.
AmbientLight
;
THREE
.
DirectionalLight
=
function
(
a
,
d
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
this
.
intensity
=
d
||
1
};
THREE
.
DirectionalLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
DirectionalLight
.
prototype
.
constructor
=
THREE
.
DirectionalLight
;
THREE
.
PointLight
=
function
(
a
,
d
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
=
new
THREE
.
Vector3
;
this
.
intensity
=
d
||
1
};
THREE
.
DirectionalLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
DirectionalLight
.
prototype
.
constructor
=
THREE
.
PointLight
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
position
=
new
THREE
.
Vector3
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
tmpMatrix
=
new
THREE
.
Matrix4
;
this
.
screen
=
new
THREE
.
Vector3
;
this
.
visible
=
this
.
autoUpdateMatrix
=
true
};
THREE
.
Object3D
.
prototype
=
{
updateMatrix
:
function
(){
var
a
=
this
.
position
,
d
=
this
.
rotation
,
e
=
this
.
scale
,
f
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
a
.
x
,
a
.
y
,
a
.
z
);
if
(
d
.
x
!=
0
){
f
.
setRotX
(
d
.
x
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
d
.
y
!=
0
){
f
.
setRotY
(
d
.
y
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
d
.
z
!=
0
){
f
.
setRotZ
(
d
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
e
.
x
!=
0
||
e
.
y
!=
0
||
e
.
z
!=
0
){
f
.
setScale
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
type
=
e
!=
undefined
?
e
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
overdraw
=
this
.
doubleSided
=
this
.
flipSided
=
false
;
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
()}
;
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
FlatShading
=
0
;
THREE
.
SmoothShading
=
1
;
THREE
.
NormalBlending
=
0
;
THREE
.
AdditiveBlending
=
1
;
THREE
.
SubtractiveBlending
=
2
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
position
=
new
THREE
.
Vector3
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
rotationMatrix
=
new
THREE
.
Matrix4
;
this
.
tmpMatrix
=
new
THREE
.
Matrix4
;
this
.
screen
=
new
THREE
.
Vector3
;
this
.
visible
=
this
.
autoUpdateMatrix
=
true
};
THREE
.
Object3D
.
prototype
=
{
updateMatrix
:
function
(){
var
a
=
this
.
position
,
d
=
this
.
rotation
,
e
=
this
.
scale
,
f
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
a
.
x
,
a
.
y
,
a
.
z
);
this
.
rotationMatrix
.
identity
();
if
(
d
.
x
!=
0
){
f
.
setRotX
(
d
.
x
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
d
.
y
!=
0
){
f
.
setRotY
(
d
.
y
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
d
.
z
!=
0
){
f
.
setRotZ
(
d
.
z
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
e
.
x
!=
0
||
e
.
y
!=
0
||
e
.
z
!=
0
){
f
.
setScale
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
type
=
e
!=
undefined
?
e
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
d
instanceof
Array
?
d
:[
d
];
this
.
overdraw
=
this
.
doubleSided
=
this
.
flipSided
=
false
;
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
()};
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
FlatShading
=
0
;
THREE
.
SmoothShading
=
1
;
THREE
.
NormalBlending
=
0
;
THREE
.
AdditiveBlending
=
1
;
THREE
.
SubtractiveBlending
=
2
;
THREE
.
LineBasicMaterial
=
function
(
a
){
this
.
color
=
new
THREE
.
Color
(
16777215
);
this
.
opacity
=
1
;
this
.
blending
=
THREE
.
NormalBlending
;
this
.
linewidth
=
1
;
this
.
linejoin
=
this
.
linecap
=
"
round
"
;
if
(
a
){
a
.
color
!==
undefined
&&
this
.
color
.
setHex
(
a
.
color
);
if
(
a
.
opacity
!==
undefined
)
this
.
opacity
=
a
.
opacity
;
if
(
a
.
blending
!==
undefined
)
this
.
blending
=
a
.
blending
;
if
(
a
.
linewidth
!==
undefined
)
this
.
linewidth
=
a
.
linewidth
;
if
(
a
.
linecap
!==
undefined
)
this
.
linecap
=
a
.
linecap
;
if
(
a
.
linejoin
!==
undefined
)
this
.
linejoin
=
a
.
linejoin
}};
THREE
.
LineBasicMaterial
.
prototype
=
{
toString
:
function
(){
return
"
THREE.LineBasicMaterial (<br/>color:
"
+
this
.
color
+
"
<br/>opacity:
"
+
this
.
opacity
+
"
<br/>blending:
"
+
this
.
blending
+
"
<br/>linewidth:
"
+
this
.
linewidth
+
"
<br/>linecap:
"
+
this
.
linecap
+
"
<br/>linejoin:
"
+
this
.
linejoin
+
"
<br/>)
"
}};
THREE
.
MeshBasicMaterial
=
function
(
a
){
this
.
id
=
THREE
.
MeshBasicMaterialCounter
.
value
++
;
this
.
color
=
new
THREE
.
Color
(
16777215
);
this
.
env_map
=
this
.
map
=
null
;
this
.
combine
=
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
1
;
this
.
refraction_ratio
=
0.98
;
this
.
fog
=
true
;
this
.
opacity
=
1
;
this
.
shading
=
THREE
.
SmoothShading
;
this
.
blending
=
THREE
.
NormalBlending
;
this
.
wireframe
=
false
;
this
.
wireframe_linewidth
=
1
;
this
.
wireframe_linejoin
=
this
.
wireframe_linecap
=
"
round
"
;
if
(
a
){
a
.
color
!==
undefined
&&
this
.
color
.
setHex
(
a
.
color
);
if
(
a
.
map
!==
undefined
)
this
.
map
=
...
...
build/ThreeExtras.js
浏览文件 @
5accd0cf
...
...
@@ -59,11 +59,11 @@ THREE.Camera=function(a,b,e,f){this.fov=a;this.aspect=b;this.near=e;this.far=f;t
this
.
translateZ
=
function
(
g
){
this
.
tmpVec
.
sub
(
this
.
target
.
position
,
this
.
position
).
normalize
().
multiplyScalar
(
g
);
this
.
position
.
subSelf
(
this
.
tmpVec
);
this
.
target
.
position
.
subSelf
(
this
.
tmpVec
)};
this
.
updateMatrix
=
function
(){
this
.
matrix
.
lookAt
(
this
.
position
,
this
.
target
.
position
,
this
.
up
)};
this
.
updateProjectionMatrix
=
function
(){
this
.
projectionMatrix
=
THREE
.
Matrix4
.
makePerspective
(
this
.
fov
,
this
.
aspect
,
this
.
near
,
this
.
far
)};
this
.
updateProjectionMatrix
()};
THREE
.
Camera
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Camera (
"
+
this
.
position
+
"
,
"
+
this
.
target
.
position
+
"
)
"
}};
THREE
.
Light
=
function
(
a
){
this
.
color
=
new
THREE
.
Color
(
a
)};
THREE
.
AmbientLight
=
function
(
a
){
THREE
.
Light
.
call
(
this
,
a
)};
THREE
.
AmbientLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
AmbientLight
.
prototype
.
constructor
=
THREE
.
AmbientLight
;
THREE
.
DirectionalLight
=
function
(
a
,
b
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
this
.
intensity
=
b
||
1
};
THREE
.
DirectionalLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
DirectionalLight
.
prototype
.
constructor
=
THREE
.
DirectionalLight
;
THREE
.
PointLight
=
function
(
a
,
b
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
position
=
new
THREE
.
Vector3
;
this
.
intensity
=
b
||
1
};
THREE
.
DirectionalLight
.
prototype
=
new
THREE
.
Light
;
THREE
.
DirectionalLight
.
prototype
.
constructor
=
THREE
.
PointLight
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
position
=
new
THREE
.
Vector3
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
tmpMatrix
=
new
THREE
.
Matrix4
;
this
.
screen
=
new
THREE
.
Vector3
;
this
.
visible
=
this
.
autoUpdateMatrix
=
true
};
THREE
.
Object3D
.
prototype
=
{
updateMatrix
:
function
(){
var
a
=
this
.
position
,
b
=
this
.
rotation
,
e
=
this
.
scale
,
f
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
a
.
x
,
a
.
y
,
a
.
z
);
if
(
b
.
x
!=
0
){
f
.
setRotX
(
b
.
x
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
b
.
y
!=
0
){
f
.
setRotY
(
b
.
y
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
b
.
z
!=
0
){
f
.
setRotZ
(
b
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}
if
(
e
.
x
!=
0
||
e
.
y
!=
0
||
e
.
z
!=
0
){
f
.
setScale
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
b
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
type
=
e
!=
undefined
?
e
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
overdraw
=
this
.
doubleSided
=
this
.
flipSided
=
false
;
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
()}
;
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
FlatShading
=
0
;
THREE
.
SmoothShading
=
1
;
THREE
.
NormalBlending
=
0
;
THREE
.
AdditiveBlending
=
1
;
THREE
.
SubtractiveBlending
=
2
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
position
=
new
THREE
.
Vector3
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
rotationMatrix
=
new
THREE
.
Matrix4
;
this
.
tmpMatrix
=
new
THREE
.
Matrix4
;
this
.
screen
=
new
THREE
.
Vector3
;
this
.
visible
=
this
.
autoUpdateMatrix
=
true
};
THREE
.
Object3D
.
prototype
=
{
updateMatrix
:
function
(){
var
a
=
this
.
position
,
b
=
this
.
rotation
,
e
=
this
.
scale
,
f
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
a
.
x
,
a
.
y
,
a
.
z
);
this
.
rotationMatrix
.
identity
();
if
(
b
.
x
!=
0
){
f
.
setRotX
(
b
.
x
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
b
.
y
!=
0
){
f
.
setRotY
(
b
.
y
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
b
.
z
!=
0
){
f
.
setRotZ
(
b
.
z
);
this
.
matrix
.
multiplySelf
(
f
);
this
.
rotationMatrix
.
multiplySelf
(
f
)}
if
(
e
.
x
!=
0
||
e
.
y
!=
0
||
e
.
z
!=
0
){
f
.
setScale
(
e
.
x
,
e
.
y
,
e
.
z
);
this
.
matrix
.
multiplySelf
(
f
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
autoUpdateMatrix
=
false
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
b
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
type
=
e
!=
undefined
?
e
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
overdraw
=
this
.
doubleSided
=
this
.
flipSided
=
false
;
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
()};
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
FlatShading
=
0
;
THREE
.
SmoothShading
=
1
;
THREE
.
NormalBlending
=
0
;
THREE
.
AdditiveBlending
=
1
;
THREE
.
SubtractiveBlending
=
2
;
THREE
.
LineBasicMaterial
=
function
(
a
){
this
.
color
=
new
THREE
.
Color
(
16777215
);
this
.
opacity
=
1
;
this
.
blending
=
THREE
.
NormalBlending
;
this
.
linewidth
=
1
;
this
.
linejoin
=
this
.
linecap
=
"
round
"
;
if
(
a
){
a
.
color
!==
undefined
&&
this
.
color
.
setHex
(
a
.
color
);
if
(
a
.
opacity
!==
undefined
)
this
.
opacity
=
a
.
opacity
;
if
(
a
.
blending
!==
undefined
)
this
.
blending
=
a
.
blending
;
if
(
a
.
linewidth
!==
undefined
)
this
.
linewidth
=
a
.
linewidth
;
if
(
a
.
linecap
!==
undefined
)
this
.
linecap
=
a
.
linecap
;
if
(
a
.
linejoin
!==
undefined
)
this
.
linejoin
=
a
.
linejoin
}};
THREE
.
LineBasicMaterial
.
prototype
=
{
toString
:
function
(){
return
"
THREE.LineBasicMaterial (<br/>color:
"
+
this
.
color
+
"
<br/>opacity:
"
+
this
.
opacity
+
"
<br/>blending:
"
+
this
.
blending
+
"
<br/>linewidth:
"
+
this
.
linewidth
+
"
<br/>linecap:
"
+
this
.
linecap
+
"
<br/>linejoin:
"
+
this
.
linejoin
+
"
<br/>)
"
}};
THREE
.
MeshBasicMaterial
=
function
(
a
){
this
.
id
=
THREE
.
MeshBasicMaterialCounter
.
value
++
;
this
.
color
=
new
THREE
.
Color
(
16777215
);
this
.
env_map
=
this
.
map
=
null
;
this
.
combine
=
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
1
;
this
.
refraction_ratio
=
0.98
;
this
.
fog
=
true
;
this
.
opacity
=
1
;
this
.
shading
=
THREE
.
SmoothShading
;
this
.
blending
=
THREE
.
NormalBlending
;
this
.
wireframe
=
false
;
this
.
wireframe_linewidth
=
1
;
this
.
wireframe_linejoin
=
this
.
wireframe_linecap
=
"
round
"
;
if
(
a
){
a
.
color
!==
undefined
&&
this
.
color
.
setHex
(
a
.
color
);
if
(
a
.
map
!==
undefined
)
this
.
map
=
...
...
examples/uqbiquity_test.html
浏览文件 @
5accd0cf
...
...
@@ -54,6 +54,7 @@
<script
type=
"text/javascript"
src=
"../src/materials/ParticleCircleMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/ParticleDOMMaterial.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Texture.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/RenderTarget.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Uniforms.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/mappings/CubeReflectionMapping.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/mappings/CubeRefractionMapping.js"
></script>
...
...
@@ -70,7 +71,6 @@
<script
type=
"text/javascript"
src=
"../src/renderers/CanvasRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/SVGRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/WebGLRenderer.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/WebGLRenderer2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableObject.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableFace3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableParticle.js"
></script>
...
...
@@ -89,22 +89,18 @@
var
SCREEN_HEIGHT
=
window
.
innerHeight
;
var
AMOUNT
=
100
;
var
container
;
var
stats
;
var
container
,
stats
;
var
camera
;
var
scene
;
var
camera
,
scene
;
var
canvasRenderer
,
svgRenderer
,
webglRenderer
;
var
mesh
,
qrcode
;
var
mouseX
=
0
;
var
mouseY
=
0
;
var
mouseX
=
0
,
mouseY
=
0
;
var
windowHalfX
=
window
.
innerWidth
/
2
;
var
windowHalfY
=
window
.
innerHeight
/
2
;
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
init
();
...
...
src/core/Matrix4.js
浏览文件 @
5accd0cf
...
...
@@ -12,7 +12,7 @@ THREE.Matrix4 = function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33
this
.
n21
=
n21
||
0
;
this
.
n22
=
n22
||
1
;
this
.
n23
=
n23
||
0
;
this
.
n24
=
n24
||
0
;
this
.
n31
=
n31
||
0
;
this
.
n32
=
n32
||
0
;
this
.
n33
=
n33
||
1
;
this
.
n34
=
n34
||
0
;
this
.
n41
=
n41
||
0
;
this
.
n42
=
n42
||
0
;
this
.
n43
=
n43
||
0
;
this
.
n44
=
n44
||
1
;
this
.
flat
=
new
Array
(
16
);
this
.
m33
=
new
THREE
.
Matrix3
();
...
...
@@ -289,7 +289,7 @@ THREE.Matrix4.prototype = {
this
.
flat
[
13
]
=
this
.
n24
;
this
.
flat
[
14
]
=
this
.
n34
;
this
.
flat
[
15
]
=
this
.
n44
;
return
this
.
flat
;
},
...
...
@@ -323,6 +323,7 @@ THREE.Matrix4.prototype = {
},
setRotAxis
:
function
(
axis
,
angle
)
{
//Based on http://www.gamedev.net/reference/articles/article1199.asp
c
=
Math
.
cos
(
angle
),
...
...
@@ -501,7 +502,7 @@ THREE.Matrix4.makeInvert3x3 = function ( m1 ) {
}
THREE
.
Matrix4
.
makeFrustum
=
function
(
left
,
right
,
bottom
,
top
,
near
,
far
)
{
THREE
.
Matrix4
.
makeFrustum
=
function
(
left
,
right
,
bottom
,
top
,
near
,
far
)
{
var
m
,
x
,
y
,
a
,
b
,
c
,
d
;
...
...
@@ -522,7 +523,7 @@ THREE.Matrix4.makeFrustum = function( left, right, bottom, top, near, far ) {
};
THREE
.
Matrix4
.
makePerspective
=
function
(
fov
,
aspect
,
near
,
far
)
{
THREE
.
Matrix4
.
makePerspective
=
function
(
fov
,
aspect
,
near
,
far
)
{
var
ymax
,
ymin
,
xmin
,
xmax
;
...
...
@@ -535,7 +536,7 @@ THREE.Matrix4.makePerspective = function( fov, aspect, near, far ) {
};
THREE
.
Matrix4
.
makeOrtho
=
function
(
left
,
right
,
top
,
bottom
,
near
,
far
)
{
THREE
.
Matrix4
.
makeOrtho
=
function
(
left
,
right
,
top
,
bottom
,
near
,
far
)
{
var
m
,
x
,
y
,
z
,
w
,
h
,
p
;
...
...
src/objects/Object3D.js
浏览文件 @
5accd0cf
...
...
@@ -11,6 +11,7 @@ THREE.Object3D = function () {
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
();
this
.
rotationMatrix
=
new
THREE
.
Matrix4
();
this
.
tmpMatrix
=
new
THREE
.
Matrix4
();
this
.
screen
=
new
THREE
.
Vector3
();
...
...
@@ -27,27 +28,31 @@ THREE.Object3D.prototype = {
var
p
=
this
.
position
,
r
=
this
.
rotation
,
s
=
this
.
scale
,
m
=
this
.
tmpMatrix
;
this
.
matrix
.
setTranslation
(
p
.
x
,
p
.
y
,
p
.
z
);
this
.
rotationMatrix
.
identity
();
if
(
r
.
x
!=
0
)
{
m
.
setRotX
(
r
.
x
);
this
.
matrix
.
multiplySelf
(
m
);
this
.
rotationMatrix
.
multiplySelf
(
m
);
}
if
(
r
.
y
!=
0
)
{
m
.
setRotY
(
r
.
y
);
this
.
matrix
.
multiplySelf
(
m
);
this
.
rotationMatrix
.
multiplySelf
(
m
);
}
if
(
r
.
z
!=
0
)
{
m
.
setRotZ
(
r
.
z
);
this
.
matrix
.
multiplySelf
(
m
);
this
.
rotationMatrix
.
multiplySelf
(
m
);
}
if
(
s
.
x
!=
0
||
s
.
y
!=
0
||
s
.
z
!=
0
)
{
m
.
setScale
(
s
.
x
,
s
.
y
,
s
.
z
);
this
.
matrix
.
multiplySelf
(
m
);
}
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录