Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f9de50b0
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,发现更多精彩内容 >>
提交
f9de50b0
编写于
6月 13, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More derendererization.
上级
eae0616a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
13 deletion
+10
-13
build/Three.js
build/Three.js
+3
-3
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+3
-3
src/extras/renderers/AnaglyphWebGLRenderer.js
src/extras/renderers/AnaglyphWebGLRenderer.js
+2
-3
src/extras/renderers/CrosseyedWebGLRenderer.js
src/extras/renderers/CrosseyedWebGLRenderer.js
+2
-4
未找到文件。
build/Three.js
浏览文件 @
f9de50b0
...
...
@@ -562,7 +562,7 @@ THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionU
THREE
.
CollisionUtils
.
MeshColliderWBox
=
function
(
b
){
return
new
THREE
.
MeshCollider
(
b
,
THREE
.
CollisionUtils
.
MeshOBB
(
b
))};
if
(
THREE
.
WebGLRenderer
)
THREE
.
AnaglyphWebGLRenderer
=
function
(
b
){
THREE
.
WebGLRenderer
.
call
(
this
,
b
);
var
c
=
this
,
d
=
this
.
setSize
,
e
=
this
.
render
,
g
=
new
THREE
.
Camera
,
f
=
new
THREE
.
Camera
,
b
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
NearestFilter
,
format
:
THREE
.
RGBAFormat
},
j
=
new
THREE
.
WebGLRenderTarget
(
512
,
512
,
b
),
k
=
new
THREE
.
WebGLRenderTarget
(
512
,
512
,
b
),
m
=
new
THREE
.
Camera
(
53
,
1
,
1
,
1
E4
);
m
.
position
.
z
=
2
;
_material
=
new
THREE
.
MeshShaderMaterial
({
uniforms
:{
mapLeft
:{
type
:
"
t
"
,
value
:
0
,
texture
:
j
},
mapRight
:{
type
:
"
t
"
,
value
:
1
,
texture
:
k
}},
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
:
"
uniform sampler2D mapLeft;
\n
uniform sampler2D mapRight;
\n
varying vec2 vUv;
\n
void main() {
\n
vec4 colorL, colorR;
\n
vec2 uv = vUv;
\n
colorL = texture2D( mapLeft, uv );
\n
colorR = texture2D( mapRight, uv );
\n
gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;
\n
}
"
});
var
n
=
new
THREE
.
Scene
;
n
.
addObject
(
new
THREE
.
Mesh
(
new
THREE
.
PlaneGeometry
(
2
,
2
),
_material
));
this
.
setSize
=
function
(
b
,
e
){
d
.
call
(
c
,
b
,
e
);
j
.
width
=
b
;
j
.
height
=
e
;
k
.
width
=
b
;
k
.
height
=
e
};
this
.
render
=
function
(
b
,
d
){
g
.
projectionMatrix
=
d
.
projectionMatrix
;
g
.
position
.
copy
(
d
.
position
);
g
.
target
.
position
.
copy
(
d
.
target
.
position
);
g
.
translateX
(
-
10
);
f
.
projectionMatrix
=
d
.
projectionMatrix
;
f
.
position
.
copy
(
d
.
position
);
f
.
target
.
position
.
copy
(
d
.
target
.
position
);
f
.
translateX
(
10
);
e
.
call
(
c
,
b
,
g
,
j
,
!
0
);
e
.
call
(
c
,
b
,
f
,
k
,
!
0
);
e
.
call
(
c
,
n
,
m
)}
;
THREE
.
AnaglyphWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
;
THREE
.
AnaglyphWebGLRenderer
.
prototype
.
constructor
=
THREE
.
AnaglyphWebGLRenderer
}
;
new
THREE
.
Scene
;
n
.
addObject
(
new
THREE
.
Mesh
(
new
THREE
.
PlaneGeometry
(
2
,
2
),
_material
));
this
.
setSize
=
function
(
b
,
e
){
d
.
call
(
c
,
b
,
e
);
j
.
width
=
b
;
j
.
height
=
e
;
k
.
width
=
b
;
k
.
height
=
e
};
this
.
render
=
function
(
b
,
d
){
g
.
projectionMatrix
=
d
.
projectionMatrix
;
g
.
position
.
copy
(
d
.
position
);
g
.
target
.
position
.
copy
(
d
.
target
.
position
);
g
.
translateX
(
-
10
);
f
.
projectionMatrix
=
d
.
projectionMatrix
;
f
.
position
.
copy
(
d
.
position
);
f
.
target
.
position
.
copy
(
d
.
target
.
position
);
f
.
translateX
(
10
);
e
.
call
(
c
,
b
,
g
,
j
,
!
0
);
e
.
call
(
c
,
b
,
f
,
k
,
!
0
);
e
.
call
(
c
,
n
,
m
)}
},
THREE
.
AnaglyphWebGLRenderer
.
prototype
.
constructor
=
THREE
.
AnaglyphWebGLRenderer
;
if
(
THREE
.
WebGLRenderer
)
THREE
.
CrosseyedWebGLRenderer
=
function
(
b
){
THREE
.
WebGLRenderer
.
call
(
this
,
b
);
this
.
autoClear
=!
1
;
var
c
=
this
,
d
=
this
.
setSize
,
e
=
this
.
render
,
g
,
f
,
j
=
new
THREE
.
Camera
,
k
=
new
THREE
.
Camera
;
c
.
separation
=
10
;
if
(
b
&&
b
.
separation
!==
void
0
)
c
.
separation
=
b
.
separation
;(
new
THREE
.
Camera
(
53
,
window
.
innerWidth
/
2
/
window
.
innerHeight
,
1
,
1
E4
)).
position
.
z
=-
10
;
this
.
setSize
=
function
(
b
,
e
){
d
.
call
(
c
,
b
,
e
);
g
=
b
/
2
;
f
=
e
};
this
.
render
=
function
(
b
,
d
){
this
.
clear
();
j
.
fov
=
d
.
fov
;
j
.
aspect
=
0.5
*
d
.
aspect
;
j
.
near
=
d
.
near
;
j
.
far
=
d
.
far
;
j
.
updateProjectionMatrix
();
j
.
position
.
copy
(
d
.
position
);
j
.
target
.
position
.
copy
(
d
.
target
.
position
);
j
.
translateX
(
c
.
separation
);
k
.
projectionMatrix
=
j
.
projectionMatrix
;
k
.
position
.
copy
(
d
.
position
);
k
.
target
.
position
.
copy
(
d
.
target
.
position
);
k
.
translateX
(
-
c
.
separation
);
this
.
setViewport
(
0
,
0
,
g
,
f
);
e
.
call
(
c
,
b
,
j
);
this
.
setViewport
(
g
,
0
,
g
,
f
);
e
.
call
(
c
,
b
,
k
,
!
1
)}
;
THREE
.
CrosseyedWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
;
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
}
;
j
.
updateProjectionMatrix
();
j
.
position
.
copy
(
d
.
position
);
j
.
target
.
position
.
copy
(
d
.
target
.
position
);
j
.
translateX
(
c
.
separation
);
k
.
projectionMatrix
=
j
.
projectionMatrix
;
k
.
position
.
copy
(
d
.
position
);
k
.
target
.
position
.
copy
(
d
.
target
.
position
);
k
.
translateX
(
-
c
.
separation
);
this
.
setViewport
(
0
,
0
,
g
,
f
);
e
.
call
(
c
,
b
,
j
);
this
.
setViewport
(
g
,
0
,
g
,
f
);
e
.
call
(
c
,
b
,
k
,
!
1
)}
},
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
;
build/custom/ThreeExtras.js
浏览文件 @
f9de50b0
...
...
@@ -220,7 +220,7 @@ THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionU
THREE
.
CollisionUtils
.
MeshColliderWBox
=
function
(
a
){
return
new
THREE
.
MeshCollider
(
a
,
THREE
.
CollisionUtils
.
MeshOBB
(
a
))};
if
(
THREE
.
WebGLRenderer
)
THREE
.
AnaglyphWebGLRenderer
=
function
(
a
){
THREE
.
WebGLRenderer
.
call
(
this
,
a
);
var
b
=
this
,
c
=
this
.
setSize
,
d
=
this
.
render
,
e
=
new
THREE
.
Camera
,
f
=
new
THREE
.
Camera
,
a
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
NearestFilter
,
format
:
THREE
.
RGBAFormat
},
g
=
new
THREE
.
WebGLRenderTarget
(
512
,
512
,
a
),
j
=
new
THREE
.
WebGLRenderTarget
(
512
,
512
,
a
),
h
=
new
THREE
.
Camera
(
53
,
1
,
1
,
1
E4
);
h
.
position
.
z
=
2
;
_material
=
new
THREE
.
MeshShaderMaterial
({
uniforms
:{
mapLeft
:{
type
:
"
t
"
,
value
:
0
,
texture
:
g
},
mapRight
:{
type
:
"
t
"
,
value
:
1
,
texture
:
j
}},
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
:
"
uniform sampler2D mapLeft;
\n
uniform sampler2D mapRight;
\n
varying vec2 vUv;
\n
void main() {
\n
vec4 colorL, colorR;
\n
vec2 uv = vUv;
\n
colorL = texture2D( mapLeft, uv );
\n
colorR = texture2D( mapRight, uv );
\n
gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;
\n
}
"
});
var
k
=
new
THREE
.
Scene
;
k
.
addObject
(
new
THREE
.
Mesh
(
new
THREE
.
PlaneGeometry
(
2
,
2
),
_material
));
this
.
setSize
=
function
(
a
,
d
){
c
.
call
(
b
,
a
,
d
);
g
.
width
=
a
;
g
.
height
=
d
;
j
.
width
=
a
;
j
.
height
=
d
};
this
.
render
=
function
(
a
,
c
){
e
.
projectionMatrix
=
c
.
projectionMatrix
;
e
.
position
.
copy
(
c
.
position
);
e
.
target
.
position
.
copy
(
c
.
target
.
position
);
e
.
translateX
(
-
10
);
f
.
projectionMatrix
=
c
.
projectionMatrix
;
f
.
position
.
copy
(
c
.
position
);
f
.
target
.
position
.
copy
(
c
.
target
.
position
);
f
.
translateX
(
10
);
d
.
call
(
b
,
a
,
e
,
g
,
!
0
);
d
.
call
(
b
,
a
,
f
,
j
,
!
0
);
d
.
call
(
b
,
k
,
h
)}
;
THREE
.
AnaglyphWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
;
THREE
.
AnaglyphWebGLRenderer
.
prototype
.
constructor
=
THREE
.
AnaglyphWebGLRenderer
}
;
new
THREE
.
Scene
;
k
.
addObject
(
new
THREE
.
Mesh
(
new
THREE
.
PlaneGeometry
(
2
,
2
),
_material
));
this
.
setSize
=
function
(
a
,
d
){
c
.
call
(
b
,
a
,
d
);
g
.
width
=
a
;
g
.
height
=
d
;
j
.
width
=
a
;
j
.
height
=
d
};
this
.
render
=
function
(
a
,
c
){
e
.
projectionMatrix
=
c
.
projectionMatrix
;
e
.
position
.
copy
(
c
.
position
);
e
.
target
.
position
.
copy
(
c
.
target
.
position
);
e
.
translateX
(
-
10
);
f
.
projectionMatrix
=
c
.
projectionMatrix
;
f
.
position
.
copy
(
c
.
position
);
f
.
target
.
position
.
copy
(
c
.
target
.
position
);
f
.
translateX
(
10
);
d
.
call
(
b
,
a
,
e
,
g
,
!
0
);
d
.
call
(
b
,
a
,
f
,
j
,
!
0
);
d
.
call
(
b
,
k
,
h
)}
},
THREE
.
AnaglyphWebGLRenderer
.
prototype
.
constructor
=
THREE
.
AnaglyphWebGLRenderer
;
if
(
THREE
.
WebGLRenderer
)
THREE
.
CrosseyedWebGLRenderer
=
function
(
a
){
THREE
.
WebGLRenderer
.
call
(
this
,
a
);
this
.
autoClear
=!
1
;
var
b
=
this
,
c
=
this
.
setSize
,
d
=
this
.
render
,
e
,
f
,
g
=
new
THREE
.
Camera
,
j
=
new
THREE
.
Camera
;
b
.
separation
=
10
;
if
(
a
&&
a
.
separation
!==
void
0
)
b
.
separation
=
a
.
separation
;(
new
THREE
.
Camera
(
53
,
window
.
innerWidth
/
2
/
window
.
innerHeight
,
1
,
1
E4
)).
position
.
z
=-
10
;
this
.
setSize
=
function
(
a
,
d
){
c
.
call
(
b
,
a
,
d
);
e
=
a
/
2
;
f
=
d
};
this
.
render
=
function
(
a
,
c
){
this
.
clear
();
g
.
fov
=
c
.
fov
;
g
.
aspect
=
0.5
*
c
.
aspect
;
g
.
near
=
c
.
near
;
g
.
far
=
c
.
far
;
g
.
updateProjectionMatrix
();
g
.
position
.
copy
(
c
.
position
);
g
.
target
.
position
.
copy
(
c
.
target
.
position
);
g
.
translateX
(
b
.
separation
);
j
.
projectionMatrix
=
g
.
projectionMatrix
;
j
.
position
.
copy
(
c
.
position
);
j
.
target
.
position
.
copy
(
c
.
target
.
position
);
j
.
translateX
(
-
b
.
separation
);
this
.
setViewport
(
0
,
0
,
e
,
f
);
d
.
call
(
b
,
a
,
g
);
this
.
setViewport
(
e
,
0
,
e
,
f
);
d
.
call
(
b
,
a
,
j
,
!
1
)}
;
THREE
.
CrosseyedWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
;
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
}
;
g
.
updateProjectionMatrix
();
g
.
position
.
copy
(
c
.
position
);
g
.
target
.
position
.
copy
(
c
.
target
.
position
);
g
.
translateX
(
b
.
separation
);
j
.
projectionMatrix
=
g
.
projectionMatrix
;
j
.
position
.
copy
(
c
.
position
);
j
.
target
.
position
.
copy
(
c
.
target
.
position
);
j
.
translateX
(
-
b
.
separation
);
this
.
setViewport
(
0
,
0
,
e
,
f
);
d
.
call
(
b
,
a
,
g
);
this
.
setViewport
(
e
,
0
,
e
,
f
);
d
.
call
(
b
,
a
,
j
,
!
1
)}
},
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
;
src/extras/renderers/AnaglyphWebGLRenderer.js
浏览文件 @
f9de50b0
...
...
@@ -95,9 +95,8 @@ if ( THREE.WebGLRenderer ) {
};
THREE
.
AnaglyphWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
();
THREE
.
AnaglyphWebGLRenderer
.
prototype
.
constructor
=
THREE
.
AnaglyphWebGLRenderer
;
};
THREE
.
AnaglyphWebGLRenderer
.
prototype
.
constructor
=
THREE
.
AnaglyphWebGLRenderer
;
}
src/extras/renderers/CrosseyedWebGLRenderer.js
浏览文件 @
f9de50b0
...
...
@@ -65,10 +65,8 @@ if ( THREE.WebGLRenderer ) {
};
THREE
.
CrosseyedWebGLRenderer
.
prototype
=
new
THREE
.
WebGLRenderer
();
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
;
};
THREE
.
CrosseyedWebGLRenderer
.
prototype
.
constructor
=
THREE
.
CrosseyedWebGLRenderer
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录