Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4fc7c4ea
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,发现更多精彩内容 >>
提交
4fc7c4ea
编写于
11月 28, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Object3D: Removed renderDepth.
上级
a609bc28
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
61 deletion
+24
-61
docs/api/core/Object3D.html
docs/api/core/Object3D.html
+0
-5
examples/js/renderers/Projector.js
examples/js/renderers/Projector.js
+5
-13
examples/webgl_decals.html
examples/webgl_decals.html
+15
-17
examples/webgl_performance.html
examples/webgl_performance.html
+0
-1
src/core/Object3D.js
src/core/Object3D.js
+0
-4
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+3
-11
src/renderers/webgl/plugins/SpritePlugin.js
src/renderers/webgl/plugins/SpritePlugin.js
+1
-10
未找到文件。
docs/api/core/Object3D.html
浏览文件 @
4fc7c4ea
...
@@ -89,11 +89,6 @@
...
@@ -89,11 +89,6 @@
Use quaternion instead of Euler angles for specifying local rotation.
Use quaternion instead of Euler angles for specifying local rotation.
</div>
</div>
<h3>
[property:Float renderDepth]
</h3>
<div>
Override depth-sorting order if non *null*.
</div>
<h3>
[property:Boolean visible]
</h3>
<h3>
[property:Boolean visible]
</h3>
<div>
<div>
Object gets rendered if *true*.
Object gets rendered if *true*.
...
...
examples/js/renderers/Projector.js
浏览文件 @
4fc7c4ea
...
@@ -126,7 +126,7 @@ THREE.Projector = function () {
...
@@ -126,7 +126,7 @@ THREE.Projector = function () {
_clippedVertex1PositionScreen
=
new
THREE
.
Vector4
(),
_clippedVertex1PositionScreen
=
new
THREE
.
Vector4
(),
_clippedVertex2PositionScreen
=
new
THREE
.
Vector4
();
_clippedVertex2PositionScreen
=
new
THREE
.
Vector4
();
//
//
this
.
projectVector
=
function
(
vector
,
camera
)
{
this
.
projectVector
=
function
(
vector
,
camera
)
{
...
@@ -148,7 +148,7 @@ THREE.Projector = function () {
...
@@ -148,7 +148,7 @@ THREE.Projector = function () {
console
.
error
(
'
THREE.Projector: .pickingRay() has been removed.
'
);
console
.
error
(
'
THREE.Projector: .pickingRay() has been removed.
'
);
};
};
//
//
var
RenderList
=
function
()
{
var
RenderList
=
function
()
{
...
@@ -352,17 +352,9 @@ THREE.Projector = function () {
...
@@ -352,17 +352,9 @@ THREE.Projector = function () {
_object
.
id
=
object
.
id
;
_object
.
id
=
object
.
id
;
_object
.
object
=
object
;
_object
.
object
=
object
;
if
(
object
.
renderDepth
!==
null
)
{
_vector3
.
setFromMatrixPosition
(
object
.
matrixWorld
);
_vector3
.
applyProjection
(
_viewProjectionMatrix
);
_object
.
z
=
object
.
renderDepth
;
_object
.
z
=
_vector3
.
z
;
}
else
{
_vector3
.
setFromMatrixPosition
(
object
.
matrixWorld
);
_vector3
.
applyProjection
(
_viewProjectionMatrix
);
_object
.
z
=
_vector3
.
z
;
}
_renderData
.
objects
.
push
(
_object
);
_renderData
.
objects
.
push
(
_object
);
...
...
examples/webgl_decals.html
浏览文件 @
4fc7c4ea
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
var
controls
,
renderHelpers
=
false
;
var
controls
,
renderHelpers
=
false
;
var
mouseVector
=
new
THREE
.
Vector3
();
var
mouseVector
=
new
THREE
.
Vector3
();
var
mouse
=
new
THREE
.
Vector2
();
var
mouse
=
new
THREE
.
Vector2
();
var
decalDiffuse
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/decal/decal-diffuse.png
'
);
var
decalDiffuse
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/decal/decal-diffuse.png
'
);
var
decalNormal
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/decal/decal-normal.jpg
'
);
var
decalNormal
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/decal/decal-normal.jpg
'
);
...
@@ -94,11 +94,10 @@
...
@@ -94,11 +94,10 @@
function
init
()
{
function
init
()
{
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
});
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
container
.
appendChild
(
renderer
.
domElement
);
scene
=
new
THREE
.
Scene
();
scene
=
new
THREE
.
Scene
();
helperScene
=
new
THREE
.
Scene
();
helperScene
=
new
THREE
.
Scene
();
...
@@ -106,7 +105,7 @@
...
@@ -106,7 +105,7 @@
camera
.
position
.
z
=
100
;
camera
.
position
.
z
=
100
;
camera
.
target
=
new
THREE
.
Vector3
();
camera
.
target
=
new
THREE
.
Vector3
();
controls
=
new
THREE
.
OrbitControls
(
camera
,
renderer
.
domElement
);
controls
=
new
THREE
.
OrbitControls
(
camera
,
renderer
.
domElement
);
scene
.
add
(
camera
);
scene
.
add
(
camera
);
var
light
=
new
THREE
.
HemisphereLight
(
0xffddcc
,
0x111122
);
var
light
=
new
THREE
.
HemisphereLight
(
0xffddcc
,
0x111122
);
...
@@ -139,7 +138,7 @@
...
@@ -139,7 +138,7 @@
window
.
addEventListener
(
'
mousedown
'
,
function
()
{
window
.
addEventListener
(
'
mousedown
'
,
function
()
{
moved
=
false
;
moved
=
false
;
},
false
);
},
false
);
window
.
addEventListener
(
'
mouseup
'
,
function
()
{
window
.
addEventListener
(
'
mouseup
'
,
function
()
{
...
@@ -161,7 +160,7 @@
...
@@ -161,7 +160,7 @@
x
=
event
.
clientX
;
x
=
event
.
clientX
;
y
=
event
.
clientY
;
y
=
event
.
clientY
;
}
}
mouse
.
x
=
(
x
/
window
.
innerWidth
)
*
2
-
1
;
mouse
.
x
=
(
x
/
window
.
innerWidth
)
*
2
-
1
;
mouse
.
y
=
-
(
y
/
window
.
innerHeight
)
*
2
+
1
;
mouse
.
y
=
-
(
y
/
window
.
innerHeight
)
*
2
+
1
;
...
@@ -172,7 +171,7 @@
...
@@ -172,7 +171,7 @@
function
checkIntersection
()
{
function
checkIntersection
()
{
if
(
!
mesh
)
return
;
if
(
!
mesh
)
return
;
mouseVector
.
set
(
mouse
.
x
,
mouse
.
y
,
1
).
unproject
(
camera
);
mouseVector
.
set
(
mouse
.
x
,
mouse
.
y
,
1
).
unproject
(
camera
);
raycaster
.
set
(
camera
.
position
,
mouseVector
.
sub
(
camera
.
position
).
normalize
()
);
raycaster
.
set
(
camera
.
position
,
mouseVector
.
sub
(
camera
.
position
).
normalize
()
);
...
@@ -203,7 +202,7 @@
...
@@ -203,7 +202,7 @@
}
}
}
}
var
gui
=
new
dat
.
GUI
();
var
gui
=
new
dat
.
GUI
();
gui
.
add
(
params
,
'
projection
'
,
{
'
From cam to mesh
'
:
'
camera
'
,
'
Normal to mesh
'
:
'
normal
'
}
);
gui
.
add
(
params
,
'
projection
'
,
{
'
From cam to mesh
'
:
'
camera
'
,
'
Normal to mesh
'
:
'
normal
'
}
);
...
@@ -215,7 +214,7 @@
...
@@ -215,7 +214,7 @@
onWindowResize
();
onWindowResize
();
render
();
render
();
}
}
function
loadLeePerrySmith
(
callback
)
{
function
loadLeePerrySmith
(
callback
)
{
...
@@ -282,12 +281,11 @@
...
@@ -282,12 +281,11 @@
s
.
set
(
scale
,
scale
,
scale
);
s
.
set
(
scale
,
scale
,
scale
);
if
(
params
.
rotate
)
r
.
z
=
Math
.
random
()
*
2
*
Math
.
PI
;
if
(
params
.
rotate
)
r
.
z
=
Math
.
random
()
*
2
*
Math
.
PI
;
var
material
=
decalMaterial
.
clone
();
var
material
=
decalMaterial
.
clone
();
material
.
color
.
setHex
(
Math
.
random
()
*
0xffffff
);
material
.
color
.
setHex
(
Math
.
random
()
*
0xffffff
);
var
m
=
new
THREE
.
Mesh
(
new
THREE
.
DecalGeometry
(
mesh
,
p
,
r
,
s
,
check
),
material
);
var
m
=
new
THREE
.
Mesh
(
new
THREE
.
DecalGeometry
(
mesh
,
p
,
r
,
s
,
check
),
material
);
m
.
renderDepth
=
-
scene
.
children
.
length
;
decals
.
push
(
m
);
decals
.
push
(
m
);
scene
.
add
(
m
);
scene
.
add
(
m
);
...
@@ -307,24 +305,24 @@
...
@@ -307,24 +305,24 @@
var
merge
=
{};
var
merge
=
{};
decals
.
forEach
(
function
(
decal
)
{
decals
.
forEach
(
function
(
decal
)
{
var
uuid
=
decal
.
material
.
uuid
;
var
uuid
=
decal
.
material
.
uuid
;
var
d
=
merge
[
uuid
]
=
merge
[
uuid
]
||
{};
var
d
=
merge
[
uuid
]
=
merge
[
uuid
]
||
{};
d
.
material
=
d
.
material
||
decal
.
material
;
d
.
material
=
d
.
material
||
decal
.
material
;
d
.
geometry
=
d
.
geometry
||
new
THREE
.
Geometry
();
d
.
geometry
=
d
.
geometry
||
new
THREE
.
Geometry
();
d
.
geometry
.
merge
(
decal
.
geometry
,
decal
.
matrix
);
d
.
geometry
.
merge
(
decal
.
geometry
,
decal
.
matrix
);
});
});
removeDecals
();
removeDecals
();
for
(
var
key
in
merge
)
{
for
(
var
key
in
merge
)
{
var
d
=
merge
[
key
];
var
d
=
merge
[
key
];
var
mesh
=
new
THREE
.
Mesh
(
d
.
geometry
,
d
.
material
);
var
mesh
=
new
THREE
.
Mesh
(
d
.
geometry
,
d
.
material
);
scene
.
add
(
mesh
);
scene
.
add
(
mesh
);
decals
.
push
(
mesh
);
decals
.
push
(
mesh
);
}
}
}
}
...
@@ -341,7 +339,7 @@
...
@@ -341,7 +339,7 @@
function
render
()
{
function
render
()
{
requestAnimationFrame
(
render
);
requestAnimationFrame
(
render
);
renderer
.
autoClear
=
false
;
renderer
.
autoClear
=
false
;
renderer
.
render
(
scene
,
camera
);
renderer
.
render
(
scene
,
camera
);
if
(
renderHelpers
)
renderer
.
render
(
helperScene
,
camera
);
if
(
renderHelpers
)
renderer
.
render
(
helperScene
,
camera
);
...
...
examples/webgl_performance.html
浏览文件 @
4fc7c4ea
...
@@ -136,7 +136,6 @@
...
@@ -136,7 +136,6 @@
}
}
renderer
.
render
(
scene
,
camera
);
renderer
.
render
(
scene
,
camera
);
}
}
...
...
src/core/Object3D.js
浏览文件 @
4fc7c4ea
...
@@ -56,8 +56,6 @@ THREE.Object3D = function () {
...
@@ -56,8 +56,6 @@ THREE.Object3D = function () {
},
},
}
);
}
);
this
.
renderDepth
=
null
;
this
.
rotationAutoUpdate
=
true
;
this
.
rotationAutoUpdate
=
true
;
this
.
matrix
=
new
THREE
.
Matrix4
();
this
.
matrix
=
new
THREE
.
Matrix4
();
...
@@ -755,8 +753,6 @@ THREE.Object3D.prototype = {
...
@@ -755,8 +753,6 @@ THREE.Object3D.prototype = {
object
.
quaternion
.
copy
(
this
.
quaternion
);
object
.
quaternion
.
copy
(
this
.
quaternion
);
object
.
scale
.
copy
(
this
.
scale
);
object
.
scale
.
copy
(
this
.
scale
);
object
.
renderDepth
=
this
.
renderDepth
;
object
.
rotationAutoUpdate
=
this
.
rotationAutoUpdate
;
object
.
rotationAutoUpdate
=
this
.
rotationAutoUpdate
;
object
.
matrix
.
copy
(
this
.
matrix
);
object
.
matrix
.
copy
(
this
.
matrix
);
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
4fc7c4ea
...
@@ -3402,18 +3402,10 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -3402,18 +3402,10 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
_this
.
sortObjects
===
true
)
{
if
(
_this
.
sortObjects
===
true
)
{
if
(
object
.
renderDepth
!==
null
)
{
_vector3
.
setFromMatrixPosition
(
object
.
matrixWorld
);
_vector3
.
applyProjection
(
_projScreenMatrix
);
webglObject
.
z
=
object
.
renderDepth
;
webglObject
.
z
=
_vector3
.
z
;
}
else
{
_vector3
.
setFromMatrixPosition
(
object
.
matrixWorld
);
_vector3
.
applyProjection
(
_projScreenMatrix
);
webglObject
.
z
=
_vector3
.
z
;
}
}
}
...
...
src/renderers/webgl/plugins/SpritePlugin.js
浏览文件 @
4fc7c4ea
...
@@ -158,16 +158,7 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
...
@@ -158,16 +158,7 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
var
sprite
=
sprites
[
i
];
var
sprite
=
sprites
[
i
];
sprite
.
_modelViewMatrix
.
multiplyMatrices
(
camera
.
matrixWorldInverse
,
sprite
.
matrixWorld
);
sprite
.
_modelViewMatrix
.
multiplyMatrices
(
camera
.
matrixWorldInverse
,
sprite
.
matrixWorld
);
sprite
.
z
=
-
sprite
.
_modelViewMatrix
.
elements
[
14
];
if
(
sprite
.
renderDepth
===
null
)
{
sprite
.
z
=
-
sprite
.
_modelViewMatrix
.
elements
[
14
];
}
else
{
sprite
.
z
=
sprite
.
renderDepth
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录