Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
51368ca6
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,发现更多精彩内容 >>
提交
51368ca6
编写于
9月 04, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
REVISION ++
上级
b5dfd828
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
754 addition
and
605 deletion
+754
-605
README.md
README.md
+16
-0
REVISION
REVISION
+1
-1
build/Three.js
build/Three.js
+440
-385
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+1
-1
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+1
-1
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+239
-184
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
examples/webgl_collada.html
examples/webgl_collada.html
+0
-1
examples/webgl_interactive_draggablecubes.html
examples/webgl_interactive_draggablecubes.html
+23
-2
src/extras/loaders/ColladaLoader.js
src/extras/loaders/ColladaLoader.js
+29
-27
utils/build.py
utils/build.py
+2
-1
未找到文件。
README.md
浏览文件 @
51368ca6
...
...
@@ -136,6 +136,21 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
### Change Log ###
2011 09 04 -
**r44**
(330.356 KB, gzip: 84.039 KB)
*
Added
`ColladaLoader`
. (
[
timknip2
](
https://github.com/timknip2
)
)
*
Improved
`ExtrudeGeometry`
. (
[
zz85
](
http://github.com/zz85
)
)
*
Fixed
`CylinderGeometry`
normals. (
[
alteredq
](
http://github.com/alteredq
)
)
*
Fixed issue with
`WebGLRenderer.setTexture`
(
[
rectalogic
](
https://github.com/rectalogic
)
)
*
Fixed
`TorusGeometry`
normals. (
[
mrdoob
](
http://github.com/mrdoob
)
)
*
Fixed
`Ray`
behind-ray intersects. (
[
mrdoob
](
http://github.com/mrdoob
)
)
*
Added
`OrthoCamera`
. (
[
alteredq
](
http://github.com/alteredq
)
)
*
Refactored postprocessing effects used in some examples. (
[
alteredq
](
http://github.com/alteredq
)
)
*
Added
`.deallocateObject()`
and
`.deallocateTexture()`
methods to
`WebGLRenderer`
. (
[
mrdoob
](
http://github.com/mrdoob
)
)
*
Fixed a glitch in normal and phong shader. (
[
evanw
](
http://github.com/evanw
)
and
[
alteredq
](
http://github.com/alteredq
)
)
*
Added
`.frustumCulled`
property to
`Object3D`
. (
[
alteredq
](
http://github.com/alteredq
)
and
[
mrdoob
](
http://github.com/mrdoob
)
)
2011 08 14 -
**r43**
(298.199 KB, gzip: 74.805 KB)
*
Improved Blender exporter - 2.58 (and 2.59) support, normals maps, specular, ao maps... (
[
alteredq
](
http://github.com/alteredq
)
)
...
...
@@ -155,6 +170,7 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
*
`CanvasRenderer`
now supports
`RepeatWrapping`
,
`texture.offset`
and
`texture.repeat`
. (
[
mrdoob
](
http://github.com/mrdoob
)
)
*
Removed Stencil Shadows and Lensflare code. (
[
mrdoob
](
http://github.com/mrdoob
)
)
2011 07 06 -
**r42**
(277.852 KB, gzip: 69.469 KB)
*
Added
`AnaglypWebGLRenderer`
and
`CrosseyedWebGLRenderer`
. (
[
mrdoob
](
http://github.com/mrdoob
)
,
[
alteredq
](
http://github.com/alteredq
)
and
[
marklundin
](
http://github.com/marklundin
)
)
...
...
REVISION
浏览文件 @
51368ca6
44
dev
44
build/Three.js
浏览文件 @
51368ca6
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeCanvas.js
浏览文件 @
51368ca6
// ThreeCanvas.js r44
dev
- http://github.com/mrdoob/three.js
// ThreeCanvas.js r44 - http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
)
window
.
Int32Array
=
Array
,
window
.
Float32Array
=
Array
;
THREE
.
Color
=
function
(
a
){
a
!==
void
0
&&
this
.
setHex
(
a
);
return
this
};
THREE
.
Color
.
prototype
=
{
constructor
:
THREE
.
Color
,
r
:
1
,
g
:
1
,
b
:
1
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
return
this
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
return
this
},
setHSV
:
function
(
a
,
b
,
c
){
var
d
,
f
,
g
;
if
(
c
==
0
)
this
.
r
=
this
.
g
=
this
.
b
=
0
;
else
switch
(
d
=
Math
.
floor
(
a
*
6
),
f
=
a
*
6
-
d
,
a
=
c
*
(
1
-
b
),
g
=
c
*
(
1
-
b
*
f
),
b
=
c
*
(
1
-
b
*
(
1
-
f
)),
d
){
case
1
:
this
.
r
=
g
;
this
.
g
=
c
;
this
.
b
=
a
;
break
;
case
2
:
this
.
r
=
a
;
this
.
g
=
c
;
this
.
b
=
b
;
break
;
case
3
:
this
.
r
=
a
;
this
.
g
=
g
;
this
.
b
=
c
;
break
;
case
4
:
this
.
r
=
b
;
this
.
g
=
a
;
this
.
b
=
c
;
break
;
case
5
:
this
.
r
=
c
;
this
.
g
=
a
;
this
.
b
=
g
;
break
;
case
6
:
case
0
:
this
.
r
=
c
,
this
.
g
=
b
,
this
.
b
=
a
}
return
this
},
setHex
:
function
(
a
){
a
=
Math
.
floor
(
a
);
this
.
r
=
(
a
>>
16
&
255
)
/
255
;
this
.
g
=
(
a
>>
8
&
255
)
/
255
;
this
.
b
=
(
a
&
255
)
/
255
;
return
this
},
getHex
:
function
(){
return
~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
getContextStyle
:
function
(){
return
"
rgb(
"
+
Math
.
floor
(
this
.
r
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
g
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
b
*
255
)
+
"
)
"
},
clone
:
function
(){
return
(
new
THREE
.
Color
).
setRGB
(
this
.
r
,
this
.
g
,
this
.
b
)}};
...
...
build/custom/ThreeDOM.js
浏览文件 @
51368ca6
// ThreeDOM.js r44
dev
- http://github.com/mrdoob/three.js
// ThreeDOM.js r44 - http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
)
window
.
Int32Array
=
Array
,
window
.
Float32Array
=
Array
;
THREE
.
Color
=
function
(
a
){
a
!==
void
0
&&
this
.
setHex
(
a
);
return
this
};
THREE
.
Color
.
prototype
=
{
constructor
:
THREE
.
Color
,
r
:
1
,
g
:
1
,
b
:
1
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
return
this
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
return
this
},
setHSV
:
function
(
a
,
b
,
c
){
var
d
,
e
,
g
;
if
(
c
==
0
)
this
.
r
=
this
.
g
=
this
.
b
=
0
;
else
switch
(
d
=
Math
.
floor
(
a
*
6
),
e
=
a
*
6
-
d
,
a
=
c
*
(
1
-
b
),
g
=
c
*
(
1
-
b
*
e
),
b
=
c
*
(
1
-
b
*
(
1
-
e
)),
d
){
case
1
:
this
.
r
=
g
;
this
.
g
=
c
;
this
.
b
=
a
;
break
;
case
2
:
this
.
r
=
a
;
this
.
g
=
c
;
this
.
b
=
b
;
break
;
case
3
:
this
.
r
=
a
;
this
.
g
=
g
;
this
.
b
=
c
;
break
;
case
4
:
this
.
r
=
b
;
this
.
g
=
a
;
this
.
b
=
c
;
break
;
case
5
:
this
.
r
=
c
;
this
.
g
=
a
;
this
.
b
=
g
;
break
;
case
6
:
case
0
:
this
.
r
=
c
,
this
.
g
=
b
,
this
.
b
=
a
}
return
this
},
setHex
:
function
(
a
){
a
=
Math
.
floor
(
a
);
this
.
r
=
(
a
>>
16
&
255
)
/
255
;
this
.
g
=
(
a
>>
8
&
255
)
/
255
;
this
.
b
=
(
a
&
255
)
/
255
;
return
this
},
getHex
:
function
(){
return
~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
getContextStyle
:
function
(){
return
"
rgb(
"
+
Math
.
floor
(
this
.
r
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
g
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
b
*
255
)
+
"
)
"
},
clone
:
function
(){
return
(
new
THREE
.
Color
).
setRGB
(
this
.
r
,
this
.
g
,
this
.
b
)}};
...
...
build/custom/ThreeExtras.js
浏览文件 @
51368ca6
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeSVG.js
浏览文件 @
51368ca6
// ThreeSVG.js r44
dev
- http://github.com/mrdoob/three.js
// ThreeSVG.js r44 - http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
)
window
.
Int32Array
=
Array
,
window
.
Float32Array
=
Array
;
THREE
.
Color
=
function
(
a
){
a
!==
void
0
&&
this
.
setHex
(
a
);
return
this
};
THREE
.
Color
.
prototype
=
{
constructor
:
THREE
.
Color
,
r
:
1
,
g
:
1
,
b
:
1
,
copy
:
function
(
a
){
this
.
r
=
a
.
r
;
this
.
g
=
a
.
g
;
this
.
b
=
a
.
b
;
return
this
},
setRGB
:
function
(
a
,
b
,
c
){
this
.
r
=
a
;
this
.
g
=
b
;
this
.
b
=
c
;
return
this
},
setHSV
:
function
(
a
,
b
,
c
){
var
d
,
e
,
g
;
if
(
c
==
0
)
this
.
r
=
this
.
g
=
this
.
b
=
0
;
else
switch
(
d
=
Math
.
floor
(
a
*
6
),
e
=
a
*
6
-
d
,
a
=
c
*
(
1
-
b
),
g
=
c
*
(
1
-
b
*
e
),
b
=
c
*
(
1
-
b
*
(
1
-
e
)),
d
){
case
1
:
this
.
r
=
g
;
this
.
g
=
c
;
this
.
b
=
a
;
break
;
case
2
:
this
.
r
=
a
;
this
.
g
=
c
;
this
.
b
=
b
;
break
;
case
3
:
this
.
r
=
a
;
this
.
g
=
g
;
this
.
b
=
c
;
break
;
case
4
:
this
.
r
=
b
;
this
.
g
=
a
;
this
.
b
=
c
;
break
;
case
5
:
this
.
r
=
c
;
this
.
g
=
a
;
this
.
b
=
g
;
break
;
case
6
:
case
0
:
this
.
r
=
c
,
this
.
g
=
b
,
this
.
b
=
a
}
return
this
},
setHex
:
function
(
a
){
a
=
Math
.
floor
(
a
);
this
.
r
=
(
a
>>
16
&
255
)
/
255
;
this
.
g
=
(
a
>>
8
&
255
)
/
255
;
this
.
b
=
(
a
&
255
)
/
255
;
return
this
},
getHex
:
function
(){
return
~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
getContextStyle
:
function
(){
return
"
rgb(
"
+
Math
.
floor
(
this
.
r
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
g
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
b
*
255
)
+
"
)
"
},
clone
:
function
(){
return
(
new
THREE
.
Color
).
setRGB
(
this
.
r
,
this
.
g
,
this
.
b
)}};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
51368ca6
// ThreeWebGL.js r44
dev
- http://github.com/mrdoob/three.js
// ThreeWebGL.js r44 - http://github.com/mrdoob/three.js
var
THREE
=
THREE
||
{};
if
(
!
window
.
Int32Array
)
window
.
Int32Array
=
Array
,
window
.
Float32Array
=
Array
;
THREE
.
Color
=
function
(
b
){
b
!==
void
0
&&
this
.
setHex
(
b
);
return
this
};
THREE
.
Color
.
prototype
=
{
constructor
:
THREE
.
Color
,
r
:
1
,
g
:
1
,
b
:
1
,
copy
:
function
(
b
){
this
.
r
=
b
.
r
;
this
.
g
=
b
.
g
;
this
.
b
=
b
.
b
;
return
this
},
setRGB
:
function
(
b
,
c
,
d
){
this
.
r
=
b
;
this
.
g
=
c
;
this
.
b
=
d
;
return
this
},
setHSV
:
function
(
b
,
c
,
d
){
var
e
,
j
,
h
;
if
(
d
==
0
)
this
.
r
=
this
.
g
=
this
.
b
=
0
;
else
switch
(
e
=
Math
.
floor
(
b
*
6
),
j
=
b
*
6
-
e
,
b
=
d
*
(
1
-
c
),
h
=
d
*
(
1
-
c
*
j
),
c
=
d
*
(
1
-
c
*
(
1
-
j
)),
e
){
case
1
:
this
.
r
=
h
;
this
.
g
=
d
;
this
.
b
=
b
;
break
;
case
2
:
this
.
r
=
b
;
this
.
g
=
d
;
this
.
b
=
c
;
break
;
case
3
:
this
.
r
=
b
;
this
.
g
=
h
;
this
.
b
=
d
;
break
;
case
4
:
this
.
r
=
c
;
this
.
g
=
b
;
this
.
b
=
d
;
break
;
case
5
:
this
.
r
=
d
;
this
.
g
=
b
;
this
.
b
=
h
;
break
;
case
6
:
case
0
:
this
.
r
=
d
,
this
.
g
=
c
,
this
.
b
=
b
}
return
this
},
setHex
:
function
(
b
){
b
=
Math
.
floor
(
b
);
this
.
r
=
(
b
>>
16
&
255
)
/
255
;
this
.
g
=
(
b
>>
8
&
255
)
/
255
;
this
.
b
=
(
b
&
255
)
/
255
;
return
this
},
getHex
:
function
(){
return
~~
(
this
.
r
*
255
)
<<
16
^~~
(
this
.
g
*
255
)
<<
8
^~~
(
this
.
b
*
255
)},
getContextStyle
:
function
(){
return
"
rgb(
"
+
Math
.
floor
(
this
.
r
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
g
*
255
)
+
"
,
"
+
Math
.
floor
(
this
.
b
*
255
)
+
"
)
"
},
clone
:
function
(){
return
(
new
THREE
.
Color
).
setRGB
(
this
.
r
,
this
.
g
,
this
.
b
)}};
...
...
examples/webgl_collada.html
浏览文件 @
51368ca6
...
...
@@ -21,7 +21,6 @@
<script
type=
"text/javascript"
src=
"js/Detector.js"
></script>
<script
type=
"text/javascript"
src=
"js/RequestAnimationFrame.js"
></script>
<script
type=
"text/javascript"
src=
"js/Stats.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/loaders/ColladaLoader.js"
></script>
<script
type=
"text/javascript"
>
...
...
examples/webgl_interactive_draggablecubes.html
浏览文件 @
51368ca6
...
...
@@ -21,7 +21,7 @@
<script
type=
"text/javascript"
>
var
container
,
stats
;
var
container
,
data
,
stats
;
var
camera
,
scene
,
projector
,
renderer
;
var
objects
=
[],
plane
;
...
...
@@ -91,9 +91,16 @@
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
sortObjects
=
false
;
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
data
=
document
.
createElement
(
'
div
'
);
data
.
style
.
position
=
'
absolute
'
;
data
.
style
.
whiteSpace
=
'
nowrap
'
;
data
.
style
.
color
=
'
#404040
'
;
data
.
style
.
padding
=
'
8px
'
;
data
.
style
.
backgroundColor
=
'
#ffffff
'
;
container
.
appendChild
(
data
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
...
...
@@ -109,6 +116,9 @@
event
.
preventDefault
();
data
.
style
.
left
=
(
-
20
+
event
.
clientX
)
+
'
px
'
;
data
.
style
.
top
=
(
10
+
event
.
clientY
)
+
'
px
'
;
mouse
.
x
=
(
event
.
clientX
/
window
.
innerWidth
)
*
2
-
1
;
mouse
.
y
=
-
(
event
.
clientY
/
window
.
innerHeight
)
*
2
+
1
;
...
...
@@ -202,6 +212,17 @@
renderer
.
render
(
scene
,
camera
);
if
(
INTERSECTED
)
{
data
.
style
.
visibility
=
'
visible
'
;
data
.
innerHTML
=
'
x:
'
+
INTERSECTED
.
position
.
x
+
'
<br>y:
'
+
INTERSECTED
.
position
.
y
+
'
<br>z:
'
+
INTERSECTED
.
position
.
z
;
}
else
{
data
.
style
.
visibility
=
'
hidden
'
;
}
}
</script>
...
...
src/extras/loaders/ColladaLoader.js
浏览文件 @
51368ca6
...
...
@@ -923,10 +923,10 @@ var ColladaLoader = function () {
function
Morph
()
{
this
.
method
;
this
.
source
;
this
.
targets
;
this
.
weights
;
this
.
method
=
null
;
this
.
source
=
null
;
this
.
targets
=
null
;
this
.
weights
=
null
;
};
...
...
@@ -1731,7 +1731,7 @@ var ColladaLoader = function () {
this
.
geometry
=
geometry
.
id
;
this
.
primitives
=
[];
this
.
vertices
=
null
;
this
.
geometry3js
;
this
.
geometry3js
=
null
;
};
...
...
@@ -1944,7 +1944,7 @@ var ColladaLoader = function () {
this
.
material
=
""
;
this
.
count
=
0
;
this
.
inputs
=
[];
this
.
vcount
;
this
.
vcount
=
null
;
this
.
p
=
[];
this
.
geometry
=
new
THREE
.
Geometry
();
...
...
@@ -2290,7 +2290,7 @@ var ColladaLoader = function () {
this
.
type
=
type
;
this
.
effect
=
effect
;
this
.
material
;
this
.
material
=
null
;
};
...
...
@@ -2428,11 +2428,13 @@ var ColladaLoader = function () {
default
:
/*
if ( !transparent ) {
// this.material = new THREE.MeshPhongMaterial(props);
}
*/
break
;
...
...
@@ -2445,8 +2447,8 @@ var ColladaLoader = function () {
function
Surface
(
effect
)
{
this
.
effect
=
effect
;
this
.
init_from
;
this
.
format
;
this
.
init_from
=
null
;
this
.
format
=
null
;
};
...
...
@@ -2485,12 +2487,12 @@ var ColladaLoader = function () {
function
Sampler2D
(
effect
)
{
this
.
effect
=
effect
;
this
.
source
;
this
.
wrap_s
;
this
.
wrap_t
;
this
.
minfilter
;
this
.
magfilter
;
this
.
mipfilter
;
this
.
source
=
null
;
this
.
wrap_s
=
null
;
this
.
wrap_t
=
null
;
this
.
minfilter
=
null
;
this
.
magfilter
=
null
;
this
.
mipfilter
=
null
;
};
...
...
@@ -2551,8 +2553,8 @@ var ColladaLoader = function () {
this
.
id
=
""
;
this
.
name
=
""
;
this
.
shader
=
null
;
this
.
surface
;
this
.
sampler
;
this
.
surface
=
null
;
this
.
sampler
=
null
;
};
...
...
@@ -2770,11 +2772,11 @@ var ColladaLoader = function () {
this
.
animation
=
animation
;
this
.
source
=
""
;
this
.
target
=
""
;
this
.
sid
;
this
.
dotSyntax
;
this
.
arrSyntax
;
this
.
arrIndices
;
this
.
member
;
this
.
sid
=
null
;
this
.
dotSyntax
=
null
;
this
.
arrSyntax
=
null
;
this
.
arrIndices
=
null
;
this
.
member
=
null
;
};
...
...
@@ -2828,11 +2830,11 @@ var ColladaLoader = function () {
this
.
id
=
""
;
this
.
animation
=
animation
;
this
.
inputs
=
[];
this
.
input
;
this
.
output
;
this
.
interpolation
;
this
.
startTime
;
this
.
endTime
;
this
.
input
=
null
;
this
.
output
=
null
;
this
.
interpolation
=
null
;
this
.
startTime
=
null
;
this
.
endTime
=
null
;
this
.
duration
=
0
;
};
...
...
utils/build.py
浏览文件 @
51368ca6
...
...
@@ -109,8 +109,9 @@ EXTRAS_FILES = [
'extras/geometries/TorusGeometry.js'
,
'extras/geometries/TorusKnotGeometry.js'
,
'extras/loaders/Loader.js'
,
'extras/loaders/JSONLoader.js'
,
'extras/loaders/BinaryLoader.js'
,
'extras/loaders/ColladaLoader.js'
,
'extras/loaders/JSONLoader.js'
,
'extras/loaders/SceneLoader.js'
,
'extras/loaders/UTF8Loader.js'
,
'extras/objects/MarchingCubes.js'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录