Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
3cdc007b
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,发现更多精彩内容 >>
提交
3cdc007b
编写于
11月 06, 2010
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* Fixed some minor issues handling opacity in hex colors
上级
1849e905
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
38 addition
and
49 deletion
+38
-49
build/Three.js
build/Three.js
+2
-2
build/ThreeDebug.js
build/ThreeDebug.js
+2
-2
examples/camera_free.html
examples/camera_free.html
+1
-0
src/core/Color.js
src/core/Color.js
+1
-7
src/materials/LineColorMaterial.js
src/materials/LineColorMaterial.js
+1
-2
src/materials/MeshBitmapMaterial.js
src/materials/MeshBitmapMaterial.js
+4
-5
src/materials/MeshColorFillMaterial.js
src/materials/MeshColorFillMaterial.js
+1
-1
src/materials/MeshColorStrokeMaterial.js
src/materials/MeshColorStrokeMaterial.js
+1
-1
src/materials/MeshPhongMaterial.js
src/materials/MeshPhongMaterial.js
+6
-5
src/materials/ParticleCircleMaterial.js
src/materials/ParticleCircleMaterial.js
+1
-1
src/objects/Mesh.js
src/objects/Mesh.js
+12
-11
src/scenes/Scene.js
src/scenes/Scene.js
+6
-12
未找到文件。
build/Three.js
浏览文件 @
3cdc007b
此差异已折叠。
点击以展开。
build/ThreeDebug.js
浏览文件 @
3cdc007b
此差异已折叠。
点击以展开。
examples/camera_free.html
浏览文件 @
3cdc007b
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
<script
type=
"text/javascript"
src=
"../src/core/Vector2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector4.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Vector4.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Ray.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Rectangle.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Rectangle.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Matrix3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Matrix3.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Matrix4.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Matrix4.js"
></script>
...
...
src/core/Color.js
浏览文件 @
3cdc007b
...
@@ -4,12 +4,6 @@
...
@@ -4,12 +4,6 @@
THREE
.
Color
=
function
(
hex
)
{
THREE
.
Color
=
function
(
hex
)
{
/*
this.r; this.g; this.b; this.a;
this.hex;
this.__styleString;
*/
this
.
autoUpdate
=
true
;
this
.
autoUpdate
=
true
;
this
.
setHex
(
hex
);
this
.
setHex
(
hex
);
...
@@ -73,7 +67,7 @@ THREE.Color.prototype = {
...
@@ -73,7 +67,7 @@ THREE.Color.prototype = {
updateHex
:
function
()
{
updateHex
:
function
()
{
this
.
hex
=
Math
.
floor
(
this
.
a
*
255
)
<<
24
|
Math
.
floor
(
this
.
r
*
255
)
<<
16
|
Math
.
floor
(
this
.
g
*
255
)
<<
8
|
Math
.
floor
(
this
.
b
*
255
);
this
.
hex
=
Math
.
floor
(
this
.
a
*
255
)
<<
24
^
Math
.
floor
(
this
.
r
*
255
)
<<
16
^
Math
.
floor
(
this
.
g
*
255
)
<<
8
^
Math
.
floor
(
this
.
b
*
255
);
},
},
...
...
src/materials/LineColorMaterial.js
浏览文件 @
3cdc007b
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
THREE
.
LineColorMaterial
=
function
(
hex
,
opacity
,
lineWidth
)
{
THREE
.
LineColorMaterial
=
function
(
hex
,
opacity
,
lineWidth
)
{
this
.
lineWidth
=
lineWidth
||
1
;
this
.
lineWidth
=
lineWidth
||
1
;
this
.
color
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
hex
);
this
.
color
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
hex
);
};
};
...
...
src/materials/MeshBitmapMaterial.js
浏览文件 @
3cdc007b
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
THREE
.
MeshBitmapMaterial
=
function
(
bitmap
,
mode
)
{
THREE
.
MeshBitmapMaterial
=
function
(
bitmap
,
mode
)
{
this
.
id
=
THREE
.
MeshBitmapMaterialCounter
.
value
++
;
this
.
bitmap
=
bitmap
;
this
.
bitmap
=
bitmap
;
this
.
mode
=
mode
||
THREE
.
MeshBitmapMaterialMode
.
UVMAPPING
;
this
.
mode
=
mode
||
THREE
.
MeshBitmapMaterialMode
.
UVMAPPING
;
this
.
id
=
THREE
.
MeshBitmapMaterialCounter
.
value
++
;
this
.
toString
=
function
()
{
this
.
toString
=
function
()
{
return
'
THREE.MeshBitmapMaterial ( bitmap:
'
+
this
.
bitmap
+
'
, mode:
'
+
this
.
mode
+
'
, id:
'
+
this
.
id
+
'
)
'
;
return
'
THREE.MeshBitmapMaterial ( bitmap:
'
+
this
.
bitmap
+
'
, mode:
'
+
this
.
mode
+
'
, id:
'
+
this
.
id
+
'
)
'
;
...
@@ -17,6 +17,5 @@ THREE.MeshBitmapMaterial = function ( bitmap, mode ) {
...
@@ -17,6 +17,5 @@ THREE.MeshBitmapMaterial = function ( bitmap, mode ) {
};
};
THREE
.
MeshBitmapMaterialCounter
=
{
value
:
0
};
THREE
.
MeshBitmapMaterialCounter
=
{
value
:
0
};
THREE
.
MeshBitmapMaterialMode
=
{
UVMAPPING
:
0
};
THREE
.
MeshBitmapMaterialMode
=
{
UVMAPPING
:
0
};
src/materials/MeshColorFillMaterial.js
浏览文件 @
3cdc007b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
THREE
.
MeshColorFillMaterial
=
function
(
hex
,
opacity
)
{
THREE
.
MeshColorFillMaterial
=
function
(
hex
,
opacity
)
{
this
.
color
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
hex
);
this
.
color
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
hex
);
this
.
toString
=
function
()
{
this
.
toString
=
function
()
{
...
...
src/materials/MeshColorStrokeMaterial.js
浏览文件 @
3cdc007b
...
@@ -6,7 +6,7 @@ THREE.MeshColorStrokeMaterial = function ( hex, opacity, lineWidth ) {
...
@@ -6,7 +6,7 @@ THREE.MeshColorStrokeMaterial = function ( hex, opacity, lineWidth ) {
this
.
lineWidth
=
lineWidth
||
1
;
this
.
lineWidth
=
lineWidth
||
1
;
this
.
color
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
hex
);
this
.
color
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
hex
);
this
.
toString
=
function
()
{
this
.
toString
=
function
()
{
...
...
src/materials/MeshPhongMaterial.js
浏览文件 @
3cdc007b
...
@@ -4,11 +4,12 @@
...
@@ -4,11 +4,12 @@
THREE
.
MeshPhongMaterial
=
function
(
ambient
,
diffuse
,
specular
,
shininess
,
opacity
)
{
THREE
.
MeshPhongMaterial
=
function
(
ambient
,
diffuse
,
specular
,
shininess
,
opacity
)
{
this
.
ambient
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
ambient
);
this
.
ambient
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
ambient
);
this
.
diffuse
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
diffuse
);
this
.
diffuse
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
diffuse
);
this
.
specular
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
specular
);
this
.
specular
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
specular
);
this
.
shininess
=
shininess
;
this
.
opacity
=
opacity
;
this
.
shininess
=
shininess
;
this
.
opacity
=
opacity
;
this
.
toString
=
function
()
{
this
.
toString
=
function
()
{
...
...
src/materials/ParticleCircleMaterial.js
浏览文件 @
3cdc007b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
THREE
.
ParticleCircleMaterial
=
function
(
hex
,
opacity
)
{
THREE
.
ParticleCircleMaterial
=
function
(
hex
,
opacity
)
{
this
.
color
=
new
THREE
.
Color
(
(
opacity
>=
0
?
(
opacity
*
0xff
)
<<
24
:
0xff000000
)
|
hex
);
this
.
color
=
new
THREE
.
Color
(
(
opacity
!==
undefined
?
opacity
:
1
)
*
0xff
<<
24
^
hex
);
this
.
toString
=
function
()
{
this
.
toString
=
function
()
{
...
...
src/objects/Mesh.js
浏览文件 @
3cdc007b
...
@@ -52,7 +52,7 @@ THREE.Mesh.prototype.sortFacesByMaterial = function () {
...
@@ -52,7 +52,7 @@ THREE.Mesh.prototype.sortFacesByMaterial = function () {
}
}
return
hash_array
.
join
(
"
_
"
);
return
hash_array
.
join
(
'
_
'
);
}
}
...
@@ -60,40 +60,41 @@ THREE.Mesh.prototype.sortFacesByMaterial = function () {
...
@@ -60,40 +60,41 @@ THREE.Mesh.prototype.sortFacesByMaterial = function () {
face
=
this
.
geometry
.
faces
[
f
];
face
=
this
.
geometry
.
faces
[
f
];
material
=
face
.
material
;
material
=
face
.
material
;
mhash
=
materialHash
(
material
);
mhash
=
materialHash
(
material
);
if
(
hash_map
[
mhash
]
==
undefined
)
{
if
(
hash_map
[
mhash
]
==
undefined
)
{
hash_map
[
mhash
]
=
{
'
hash
'
:
mhash
,
'
counter
'
:
0
};
hash_map
[
mhash
]
=
{
'
hash
'
:
mhash
,
'
counter
'
:
0
};
}
}
ghash
=
hash_map
[
mhash
].
hash
+
"
_
"
+
hash_map
[
mhash
].
counter
;
ghash
=
hash_map
[
mhash
].
hash
+
'
_
'
+
hash_map
[
mhash
].
counter
;
if
(
this
.
materialFaceGroup
[
ghash
]
==
undefined
)
{
if
(
this
.
materialFaceGroup
[
ghash
]
==
undefined
)
{
this
.
materialFaceGroup
[
ghash
]
=
{
'
faces
'
:
[],
'
material
'
:
material
,
'
vertices
'
:
0
};
this
.
materialFaceGroup
[
ghash
]
=
{
'
faces
'
:
[],
'
material
'
:
material
,
'
vertices
'
:
0
};
}
}
vertices
=
face
instanceof
THREE
.
Face3
?
3
:
4
;
vertices
=
face
instanceof
THREE
.
Face3
?
3
:
4
;
if
(
this
.
materialFaceGroup
[
ghash
].
vertices
+
vertices
>
65535
)
{
if
(
this
.
materialFaceGroup
[
ghash
].
vertices
+
vertices
>
65535
)
{
hash_map
[
mhash
].
counter
+=
1
;
hash_map
[
mhash
].
counter
+=
1
;
ghash
=
hash_map
[
mhash
].
hash
+
"
_
"
+
hash_map
[
mhash
].
counter
;
ghash
=
hash_map
[
mhash
].
hash
+
'
_
'
+
hash_map
[
mhash
].
counter
;
if
(
this
.
materialFaceGroup
[
ghash
]
==
undefined
)
{
if
(
this
.
materialFaceGroup
[
ghash
]
==
undefined
)
{
this
.
materialFaceGroup
[
ghash
]
=
{
'
faces
'
:
[],
'
material
'
:
material
,
'
vertices
'
:
0
};
this
.
materialFaceGroup
[
ghash
]
=
{
'
faces
'
:
[],
'
material
'
:
material
,
'
vertices
'
:
0
};
}
}
}
}
this
.
materialFaceGroup
[
ghash
].
faces
.
push
(
f
);
this
.
materialFaceGroup
[
ghash
].
faces
.
push
(
f
);
this
.
materialFaceGroup
[
ghash
].
vertices
+=
vertices
;
this
.
materialFaceGroup
[
ghash
].
vertices
+=
vertices
;
}
}
...
...
src/scenes/Scene.js
浏览文件 @
3cdc007b
...
@@ -15,14 +15,11 @@ THREE.Scene = function () {
...
@@ -15,14 +15,11 @@ THREE.Scene = function () {
this
.
removeObject
=
function
(
object
)
{
this
.
removeObject
=
function
(
object
)
{
for
(
var
i
=
0
,
l
=
this
.
objects
.
length
;
i
<
l
;
i
++
)
{
var
i
=
this
.
objects
.
indexOf
(
object
);
if
(
object
==
this
.
objects
[
i
]
)
{
if
(
i
!==
-
1
)
{
this
.
objects
.
splice
(
i
,
1
);
this
.
objects
.
splice
(
i
,
1
);
return
;
}
}
}
...
@@ -36,14 +33,11 @@ THREE.Scene = function () {
...
@@ -36,14 +33,11 @@ THREE.Scene = function () {
this
.
removeLight
=
function
(
light
)
{
this
.
removeLight
=
function
(
light
)
{
for
(
var
i
=
0
,
l
=
this
.
lights
.
length
;
i
<
l
;
i
++
)
{
var
i
=
this
.
lights
.
indexOf
(
light
);
if
(
light
==
this
.
lights
[
i
]
)
{
this
.
lights
.
splice
(
i
,
1
);
if
(
i
!==
-
1
)
{
return
;
}
this
.
lights
.
splice
(
i
,
1
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录