Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
970327dd
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,发现更多精彩内容 >>
提交
970327dd
编写于
9月 26, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
cb8e09db
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
10 deletion
+28
-10
build/three.js
build/three.js
+21
-4
build/three.min.js
build/three.min.js
+7
-6
未找到文件。
build/three.js
浏览文件 @
970327dd
...
...
@@ -10359,6 +10359,8 @@ THREE.OrthographicCamera = function ( left, right, top, bottom, near, far ) {
this.type = 'OrthographicCamera';
this.zoom = 1;
this.left = left;
this.right = right;
this.top = top;
...
...
@@ -10375,7 +10377,7 @@ THREE.OrthographicCamera.prototype = Object.create( THREE.Camera.prototype );
THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () {
this.projectionMatrix.makeOrthographic( this.left
, this.right, this.top, this.bott
om, this.near, this.far );
this.projectionMatrix.makeOrthographic( this.left
/ this.zoom, this.right / this.zoom, this.top / this.zoom, this.bottom / this.zo
om, this.near, this.far );
};
...
...
@@ -10385,6 +10387,8 @@ THREE.OrthographicCamera.prototype.clone = function () {
THREE.Camera.prototype.clone.call( this, camera );
camera.zoom = this.zoom;
camera.left = this.left;
camera.right = this.right;
camera.top = this.top;
...
...
@@ -10393,6 +10397,8 @@ THREE.OrthographicCamera.prototype.clone = function () {
camera.near = this.near;
camera.far = this.far;
camera.projectionMatrix.copy( this.projectionMatrix );
return camera;
};
...
...
@@ -10410,6 +10416,8 @@ THREE.PerspectiveCamera = function ( fov, aspect, near, far ) {
this.type = 'PerspectiveCamera';
this.zoom = 1;
this.fov = fov !== undefined ? fov : 50;
this.aspect = aspect !== undefined ? aspect : 1;
this.near = near !== undefined ? near : 0.1;
...
...
@@ -10493,7 +10501,7 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
if ( this.fullWidth ) {
var aspect = this.fullWidth / this.fullHeight;
var top = Math.tan( THREE.Math.degToRad(
this.fov
* 0.5 ) ) * this.near;
var top = Math.tan( THREE.Math.degToRad(
( this.fov / this.zoom )
* 0.5 ) ) * this.near;
var bottom = - top;
var left = aspect * bottom;
var right = aspect * top;
...
...
@@ -10511,7 +10519,7 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
} else {
this.projectionMatrix.makePerspective( this.fov, this.aspect, this.near, this.far );
this.projectionMatrix.makePerspective( this.fov
/ this.zoom
, this.aspect, this.near, this.far );
}
...
...
@@ -10519,10 +10527,19 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
THREE.PerspectiveCamera.prototype.clone = function () {
var camera = new THREE.PerspectiveCamera(
this.fov, this.aspect, this.near, this.far
);
var camera = new THREE.PerspectiveCamera();
THREE.Camera.prototype.clone.call( this, camera );
camera.zoom = this.zoom;
camera.fov = this.fov;
camera.aspect = this.aspect;
camera.near = this.near;
camera.far = this.far;
camera.projectionMatrix.copy( this.projectionMatrix );
return camera;
};
...
...
build/three.min.js
浏览文件 @
970327dd
...
...
@@ -222,13 +222,14 @@ THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrix
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,1);g.lookAt(new THREE.Vector3(0,1,0));this.add(g);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,-1);f.lookAt(new THREE.Vector3(0,-1,0));
this.add(f);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,r=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=
1
;
a
.
render
(
b
,
e
,
c
);
c
.
activeCubeFace
=
2
;
a
.
render
(
b
,
g
,
c
);
c
.
activeCubeFace
=
3
;
a
.
render
(
b
,
f
,
c
);
c
.
activeCubeFace
=
4
;
a
.
render
(
b
,
h
,
c
);
c
.
generateMipmaps
=
r
;
c
.
activeCubeFace
=
5
;
a
.
render
(
b
,
k
,
c
)}};
THREE
.
CubeCamera
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
OrthographicCamera
=
function
(
a
,
b
,
c
,
d
,
e
,
g
){
THREE
.
Camera
.
call
(
this
);
this
.
type
=
"
OrthographicCamera
"
;
this
.
left
=
a
;
this
.
right
=
b
;
this
.
top
=
c
;
this
.
bottom
=
d
;
this
.
near
=
void
0
!==
e
?
e
:.
1
;
this
.
far
=
void
0
!==
g
?
g
:
2
E3
;
this
.
updateProjectionMatrix
()};
THREE
.
OrthographicCamera
.
prototype
=
Object
.
create
(
THREE
.
Camera
.
prototype
);
THREE
.
OrthographicCamera
.
prototype
.
updateProjectionMatrix
=
function
(){
this
.
projectionMatrix
.
makeOrthographic
(
this
.
left
,
this
.
right
,
this
.
top
,
this
.
bottom
,
this
.
near
,
this
.
far
)};
THREE
.
OrthographicCamera
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
OrthographicCamera
;
THREE
.
Camera
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
left
=
this
.
left
;
a
.
right
=
this
.
right
;
a
.
top
=
this
.
top
;
a
.
bottom
=
this
.
bottom
;
a
.
near
=
this
.
near
;
a
.
far
=
this
.
far
;
return
a
};
THREE
.
PerspectiveCamera
=
function
(
a
,
b
,
c
,
d
){
THREE
.
Camera
.
call
(
this
);
this
.
type
=
"
PerspectiveCamera
"
;
this
.
fov
=
void
0
!==
a
?
a
:
50
;
this
.
aspect
=
void
0
!==
b
?
b
:
1
;
this
.
near
=
void
0
!==
c
?
c
:.
1
;
this
.
far
=
void
0
!==
d
?
d
:
2
E3
;
this
.
updateProjectionMatrix
()};
THREE
.
PerspectiveCamera
.
prototype
=
Object
.
create
(
THREE
.
Camera
.
prototype
);
THREE
.
PerspectiveCamera
.
prototype
.
setLens
=
function
(
a
,
b
){
void
0
===
b
&&
(
b
=
24
);
this
.
fov
=
2
*
THREE
.
Math
.
radToDeg
(
Math
.
atan
(
b
/
(
2
*
a
)));
this
.
updateProjectionMatrix
()};
1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,g,c);c.activeCubeFace=3;a.render(b,f,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=r;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==g?g:2E3;this.updateProjectionMatrix()};
THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left/this.zoom,this.right/this.zoom,this.top/this.zoom,this.bottom/this.zoom,this.near,this.far)};
THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.zoom=this.zoom;a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;a.projectionMatrix.copy(this.projectionMatrix);return a};
THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.type="PerspectiveCamera";this.zoom=1;this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
THREE
.
PerspectiveCamera
.
prototype
.
updateProjectionMatrix
=
function
(){
if
(
this
.
fullWidth
){
var
a
=
this
.
fullWidth
/
this
.
fullHeight
,
b
=
Math
.
tan
(
THREE
.
Math
.
degToRad
(
.
5
*
this
.
fov
))
*
this
.
near
,
c
=-
b
,
d
=
a
*
c
,
a
=
Math
.
abs
(
a
*
b
-
d
),
c
=
Math
.
abs
(
b
-
c
);
this
.
projectionMatrix
.
makeFrustum
(
d
+
this
.
x
*
a
/
this
.
fullWidth
,
d
+
(
this
.
x
+
this
.
width
)
*
a
/
this
.
fullWidth
,
b
-
(
this
.
y
+
this
.
height
)
*
c
/
this
.
fullHeight
,
b
-
this
.
y
*
c
/
this
.
fullHeight
,
this
.
near
,
this
.
far
)}
else
this
.
projectionMatrix
.
makePerspective
(
this
.
fov
,
this
.
aspect
,
this
.
near
,
this
.
far
)};
THREE
.
PerspectiveCamera
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
PerspectiveCamera
(
this
.
fov
,
this
.
aspect
,
this
.
near
,
this
.
far
);
THREE
.
Camera
.
prototype
.
clone
.
call
(
this
,
a
);
return
a
};
THREE
.
Light
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
type
=
"
Light
"
;
this
.
color
=
new
THREE
.
Color
(
a
)};
THREE
.
Light
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Light
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Light
);
THREE
.
Object3D
.
prototype
.
clone
.
call
(
this
,
a
);
a
.
color
.
copy
(
this
.
color
);
return
a
}
;
THREE
.
AmbientLight
=
function
(
a
){
THREE
.
Light
.
call
(
this
,
a
);
this
.
type
=
"
AmbientLight
"
};
THREE
.
AmbientLight
.
prototype
=
Object
.
create
(
THREE
.
Light
.
prototype
);
THREE
.
AmbientLight
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
AmbientLight
;
THREE
.
Light
.
prototype
.
clone
.
call
(
this
,
a
);
return
a
};
THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(
this.fov/this.zoom*.5))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov/this.zoom,this.aspect,this.near,
this.far)};THREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;THREE.Camera.prototype.clone.call(this,a);a.zoom=this.zoom;a.fov=this.fov;a.aspect=this.aspect;a.near=this.near;a.far=this.far;a.projectionMatrix.copy(this.projectionMatrix);return a};THREE.Light=function(a){THREE.Object3D.call(this);this.type="Light";this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype)
;
THREE.
Light.prototype.clone=function(a){void 0===a&&(a=new THREE.Light);THREE.Object3D.prototype.clone.call(this,a);a.color.copy(this.color);return a};THREE.
AmbientLight=function(a){THREE.Light.call(this,a);this.type="AmbientLight"};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;THREE.Light.prototype.clone.call(this,a);return a};
THREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.type="AreaLight";this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=.5;this.quadraticAttenuation=.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);
THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.type="DirectionalLight";this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;
this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,.99,.998];this.shadowCascadeFarZ=[.99,.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录