Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
1ae06ee0
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,发现更多精彩内容 >>
提交
1ae06ee0
编写于
7月 18, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Editor improvements and fixes to examples.
上级
6d21fc22
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
101 addition
and
61 deletion
+101
-61
editor/js/Sidebar.Geometry.js
editor/js/Sidebar.Geometry.js
+33
-18
editor/js/Sidebar.Material.js
editor/js/Sidebar.Material.js
+29
-0
editor/js/Sidebar.Object3D.js
editor/js/Sidebar.Object3D.js
+1
-1
examples/css3d_panorama.html
examples/css3d_panorama.html
+14
-14
examples/css3d_periodictable.html
examples/css3d_periodictable.html
+24
-21
examples/js/renderers/CSS3DRenderer.js
examples/js/renderers/CSS3DRenderer.js
+0
-7
未找到文件。
editor/js/Sidebar.Geometry.js
浏览文件 @
1ae06ee0
...
...
@@ -34,6 +34,23 @@ Sidebar.Geometry = function ( editor ) {
container
.
add
(
objectType
);
container
.
add
(
new
UI
.
Break
(),
new
UI
.
Break
()
);
// uuid
var
geometryUUIDRow
=
new
UI
.
Panel
();
var
geometryUUID
=
new
UI
.
Input
().
setWidth
(
'
115px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
setDisabled
(
true
);
var
geometryUUIDRenew
=
new
UI
.
Button
(
'
⟳
'
).
setMarginLeft
(
'
7px
'
).
onClick
(
function
()
{
geometryUUID
.
setValue
(
THREE
.
Math
.
generateUUID
()
);
update
();
}
);
geometryUUIDRow
.
add
(
new
UI
.
Text
(
'
UUID
'
).
setWidth
(
'
90px
'
).
setColor
(
'
#666
'
)
);
geometryUUIDRow
.
add
(
geometryUUID
);
geometryUUIDRow
.
add
(
geometryUUIDRenew
);
container
.
add
(
geometryUUIDRow
);
// name
var
geometryNameRow
=
new
UI
.
Panel
();
...
...
@@ -71,29 +88,28 @@ Sidebar.Geometry = function ( editor ) {
//
var
selected
=
null
;
function
update
()
{
if
(
selected
)
{
selected
.
name
=
geometryName
.
getValue
();
var
geometry
=
editor
.
selected
.
geometry
;
}
geometry
.
uuid
=
geometryUUID
.
getValue
();
geometry
.
name
=
geometryName
.
getValue
();
}
function
build
(
object
)
{
function
build
()
{
var
object
=
editor
.
selected
;
if
(
object
&&
object
.
geometry
)
{
selected
=
object
.
geometry
;
var
geometry
=
object
.
geometry
;
container
.
setDisplay
(
'
block
'
);
objectType
.
setValue
(
getGeometryInstanceName
(
object
.
geometry
)
);
updateFields
(
selected
);
updateFields
(
geometry
);
//
...
...
@@ -104,37 +120,37 @@ Sidebar.Geometry = function ( editor ) {
}
if
(
selected
instanceof
THREE
.
PlaneGeometry
)
{
if
(
geometry
instanceof
THREE
.
PlaneGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
PlaneGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
}
else
if
(
selected
instanceof
THREE
.
CubeGeometry
)
{
}
else
if
(
geometry
instanceof
THREE
.
CubeGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
CubeGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
}
else
if
(
selected
instanceof
THREE
.
CylinderGeometry
)
{
}
else
if
(
geometry
instanceof
THREE
.
CylinderGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
CylinderGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
}
else
if
(
selected
instanceof
THREE
.
SphereGeometry
)
{
}
else
if
(
geometry
instanceof
THREE
.
SphereGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
SphereGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
}
else
if
(
selected
instanceof
THREE
.
IcosahedronGeometry
)
{
}
else
if
(
geometry
instanceof
THREE
.
IcosahedronGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
IcosahedronGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
}
else
if
(
selected
instanceof
THREE
.
TorusGeometry
)
{
}
else
if
(
geometry
instanceof
THREE
.
TorusGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
TorusGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
}
else
if
(
selected
instanceof
THREE
.
TorusKnotGeometry
)
{
}
else
if
(
geometry
instanceof
THREE
.
TorusKnotGeometry
)
{
parameters
=
new
Sidebar
.
Geometry
.
TorusKnotGeometry
(
signals
,
object
);
container
.
add
(
parameters
);
...
...
@@ -143,8 +159,6 @@ Sidebar.Geometry = function ( editor ) {
}
else
{
selected
=
null
;
container
.
setDisplay
(
'
none
'
);
}
...
...
@@ -158,6 +172,7 @@ Sidebar.Geometry = function ( editor ) {
function
updateFields
(
geometry
)
{
geometryUUID
.
setValue
(
geometry
.
uuid
);
geometryName
.
setValue
(
geometry
.
name
);
geometryVertices
.
setValue
(
geometry
.
vertices
.
length
);
geometryFaces
.
setValue
(
geometry
.
faces
.
length
);
...
...
editor/js/Sidebar.Material.js
浏览文件 @
1ae06ee0
...
...
@@ -27,6 +27,23 @@ Sidebar.Material = function ( editor ) {
container
.
add
(
new
UI
.
Text
().
setValue
(
'
MATERIAL
'
).
setColor
(
'
#666
'
)
);
container
.
add
(
new
UI
.
Break
(),
new
UI
.
Break
()
);
// uuid
var
materialUUIDRow
=
new
UI
.
Panel
();
var
materialUUID
=
new
UI
.
Input
().
setWidth
(
'
115px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
setDisabled
(
true
);
var
materialUUIDRenew
=
new
UI
.
Button
(
'
⟳
'
).
setMarginLeft
(
'
7px
'
).
onClick
(
function
()
{
materialUUID
.
setValue
(
THREE
.
Math
.
generateUUID
()
);
update
();
}
);
materialUUIDRow
.
add
(
new
UI
.
Text
(
'
UUID
'
).
setWidth
(
'
90px
'
).
setColor
(
'
#666
'
)
);
materialUUIDRow
.
add
(
materialUUID
);
materialUUIDRow
.
add
(
materialUUIDRenew
);
container
.
add
(
materialUUIDRow
);
// name
var
materialNameRow
=
new
UI
.
Panel
();
...
...
@@ -245,6 +262,12 @@ Sidebar.Material = function ( editor ) {
if
(
material
)
{
if
(
material
.
uuid
!==
undefined
)
{
object
.
uuid
=
objectUUID
.
getValue
();
}
if
(
material
.
name
!==
undefined
)
{
material
.
name
=
materialName
.
getValue
();
...
...
@@ -504,6 +527,12 @@ Sidebar.Material = function ( editor ) {
var
material
=
object
.
material
;
if
(
material
.
uuid
!==
undefined
)
{
materialUUID
.
setValue
(
material
.
uuid
);
}
if
(
material
.
name
!==
undefined
)
{
materialName
.
setValue
(
material
.
name
);
...
...
editor/js/Sidebar.Object3D.js
浏览文件 @
1ae06ee0
...
...
@@ -11,7 +11,7 @@ Sidebar.Object3D = function ( editor ) {
container
.
add
(
objectType
);
container
.
add
(
new
UI
.
Break
(),
new
UI
.
Break
()
);
// id
//
uu
id
var
objectUUIDRow
=
new
UI
.
Panel
();
var
objectUUID
=
new
UI
.
Input
().
setWidth
(
'
115px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
setDisabled
(
true
);
...
...
examples/css3d_panorama.html
浏览文件 @
1ae06ee0
...
...
@@ -58,33 +58,33 @@
var
sides
=
[
{
url
:
'
textures/cube/Bridge2/posx.jpg
'
,
position
:
new
THREE
.
Vector3
(
-
512
,
0
,
0
)
,
rotation
:
new
THREE
.
Vector3
(
0
,
Math
.
PI
/
2
,
0
)
position
:
[
-
512
,
0
,
0
]
,
rotation
:
[
0
,
Math
.
PI
/
2
,
0
]
},
{
url
:
'
textures/cube/Bridge2/negx.jpg
'
,
position
:
new
THREE
.
Vector3
(
512
,
0
,
0
)
,
rotation
:
new
THREE
.
Vector3
(
0
,
-
Math
.
PI
/
2
,
0
)
position
:
[
512
,
0
,
0
]
,
rotation
:
[
0
,
-
Math
.
PI
/
2
,
0
]
},
{
url
:
'
textures/cube/Bridge2/posy.jpg
'
,
position
:
new
THREE
.
Vector3
(
0
,
512
,
0
)
,
rotation
:
new
THREE
.
Vector3
(
Math
.
PI
/
2
,
0
,
Math
.
PI
)
position
:
[
0
,
512
,
0
]
,
rotation
:
[
Math
.
PI
/
2
,
0
,
Math
.
PI
]
},
{
url
:
'
textures/cube/Bridge2/negy.jpg
'
,
position
:
new
THREE
.
Vector3
(
0
,
-
512
,
0
)
,
rotation
:
new
THREE
.
Vector3
(
-
Math
.
PI
/
2
,
0
,
Math
.
PI
)
position
:
[
0
,
-
512
,
0
]
,
rotation
:
[
-
Math
.
PI
/
2
,
0
,
Math
.
PI
]
},
{
url
:
'
textures/cube/Bridge2/posz.jpg
'
,
position
:
new
THREE
.
Vector3
(
0
,
0
,
512
)
,
rotation
:
new
THREE
.
Vector3
(
0
,
Math
.
PI
,
0
)
position
:
[
0
,
0
,
512
]
,
rotation
:
[
0
,
Math
.
PI
,
0
]
},
{
url
:
'
textures/cube/Bridge2/negz.jpg
'
,
position
:
new
THREE
.
Vector3
(
0
,
0
,
-
512
)
,
rotation
:
new
THREE
.
Vector3
(
0
,
0
,
0
)
position
:
[
0
,
0
,
-
512
]
,
rotation
:
[
0
,
0
,
0
]
}
];
...
...
@@ -97,8 +97,8 @@
element
.
src
=
side
.
url
;
var
object
=
new
THREE
.
CSS3DObject
(
element
);
object
.
position
=
side
.
position
;
object
.
rotation
=
side
.
rotation
;
object
.
position
.
fromArray
(
side
.
position
)
;
object
.
rotation
.
fromArray
(
side
.
rotation
)
;
scene
.
add
(
object
);
}
...
...
examples/css3d_periodictable.html
浏览文件 @
1ae06ee0
...
...
@@ -40,15 +40,16 @@
}
.element
{
width
:
1
4
0px
;
height
:
1
8
0px
;
box-shadow
:
0px
0px
20
px
rgba
(
0
,
255
,
255
,
0.5
);
width
:
1
2
0px
;
height
:
1
6
0px
;
box-shadow
:
0px
0px
12
px
rgba
(
0
,
255
,
255
,
0.5
);
border
:
1px
solid
rgba
(
127
,
255
,
255
,
0.25
);
text-align
:
center
;
cursor
:
default
;
}
.element
:hover
{
box-shadow
:
0px
0px
20
px
rgba
(
0
,
255
,
255
,
0.75
);
box-shadow
:
0px
0px
12
px
rgba
(
0
,
255
,
255
,
0.75
);
border
:
1px
solid
rgba
(
127
,
255
,
255
,
0.75
);
}
...
...
@@ -56,18 +57,18 @@
position
:
absolute
;
top
:
20px
;
right
:
20px
;
font-size
:
20
px
;
font-size
:
12
px
;
color
:
rgba
(
127
,
255
,
255
,
0.75
);
}
.element
.symbol
{
position
:
absolute
;
top
:
40px
;
width
:
100%
;
font-size
:
70px
;
text-align
:
center
;
color
:
rgba
(
255
,
255
,
255
,
0.75
);
left
:
0px
;
right
:
0px
;
font-size
:
60px
;
font-weight
:
bold
;
color
:
rgba
(
255
,
255
,
255
,
0.75
);
-webkit-filter
:
drop-shadow
(
0px
0px
20px
rgba
(
0
,
255
,
255
,
0.95
));
-moz-filter
:
drop-shadow
(
0px
0px
20px
rgba
(
0
,
255
,
255
,
0.95
));
...
...
@@ -78,10 +79,10 @@
.element
.details
{
position
:
absolute
;
top
:
12
5px
;
width
:
100%
;
font-size
:
18
px
;
text-align
:
center
;
bottom
:
1
5px
;
left
:
0px
;
right
:
0
px
;
font-size
:
12px
;
color
:
rgba
(
127
,
255
,
255
,
0.75
);
}
...
...
@@ -252,7 +253,7 @@
function
init
()
{
camera
=
new
THREE
.
PerspectiveCamera
(
75
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
5000
);
camera
.
position
.
z
=
1
8
00
;
camera
.
position
.
z
=
1
5
00
;
scene
=
new
THREE
.
Scene
();
...
...
@@ -290,8 +291,8 @@
//
var
object
=
new
THREE
.
Object3D
();
object
.
position
.
x
=
(
table
[
i
+
3
]
*
1
60
)
-
154
0
;
object
.
position
.
y
=
-
(
table
[
i
+
4
]
*
200
)
+
110
0
;
object
.
position
.
x
=
(
table
[
i
+
3
]
*
1
40
)
-
133
0
;
object
.
position
.
y
=
-
(
table
[
i
+
4
]
*
180
)
+
99
0
;
targets
.
table
.
push
(
object
);
...
...
@@ -308,9 +309,9 @@
var
object
=
new
THREE
.
Object3D
();
object
.
position
.
x
=
10
00
*
Math
.
cos
(
theta
)
*
Math
.
sin
(
phi
);
object
.
position
.
y
=
10
00
*
Math
.
sin
(
theta
)
*
Math
.
sin
(
phi
);
object
.
position
.
z
=
10
00
*
Math
.
cos
(
phi
);
object
.
position
.
x
=
8
00
*
Math
.
cos
(
theta
)
*
Math
.
sin
(
phi
);
object
.
position
.
y
=
8
00
*
Math
.
sin
(
theta
)
*
Math
.
sin
(
phi
);
object
.
position
.
z
=
8
00
*
Math
.
cos
(
phi
);
vector
.
copy
(
object
.
position
).
multiplyScalar
(
2
);
...
...
@@ -330,9 +331,9 @@
var
object
=
new
THREE
.
Object3D
();
object
.
position
.
x
=
11
00
*
Math
.
sin
(
phi
);
object
.
position
.
x
=
9
00
*
Math
.
sin
(
phi
);
object
.
position
.
y
=
-
(
i
*
8
)
+
450
;
object
.
position
.
z
=
11
00
*
Math
.
cos
(
phi
);
object
.
position
.
z
=
9
00
*
Math
.
cos
(
phi
);
vector
.
x
=
object
.
position
.
x
*
2
;
vector
.
y
=
object
.
position
.
y
;
...
...
@@ -442,6 +443,8 @@
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
render
();
}
function
animate
()
{
...
...
examples/js/renderers/CSS3DRenderer.js
浏览文件 @
1ae06ee0
...
...
@@ -57,16 +57,9 @@ THREE.CSS3DRenderer = function () {
domElement
.
style
.
overflow
=
'
hidden
'
;
domElement
.
style
.
WebkitTransformStyle
=
'
preserve-3d
'
;
domElement
.
style
.
WebkitPerspectiveOrigin
=
'
50% 50%
'
;
domElement
.
style
.
MozTransformStyle
=
'
preserve-3d
'
;
domElement
.
style
.
MozPerspectiveOrigin
=
'
50% 50%
'
;
domElement
.
style
.
oTransformStyle
=
'
preserve-3d
'
;
domElement
.
style
.
oPerspectiveOrigin
=
'
50% 50%
'
;
domElement
.
style
.
transformStyle
=
'
preserve-3d
'
;
domElement
.
style
.
perspectiveOrigin
=
'
50% 50%
'
;
this
.
domElement
=
domElement
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录