Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
a7df28c6
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,发现更多精彩内容 >>
提交
a7df28c6
编写于
11月 03, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Editor: Removed counters.
上级
0a16307c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
34 deletion
+20
-34
editor/js/Menubar.Add.js
editor/js/Menubar.Add.js
+20
-34
未找到文件。
editor/js/Menubar.Add.js
浏览文件 @
a7df28c6
...
@@ -16,20 +16,6 @@ Menubar.Add = function ( editor ) {
...
@@ -16,20 +16,6 @@ Menubar.Add = function ( editor ) {
options
.
setClass
(
'
options
'
);
options
.
setClass
(
'
options
'
);
container
.
add
(
options
);
container
.
add
(
options
);
//
var
meshCount
=
0
;
var
lightCount
=
0
;
var
cameraCount
=
0
;
editor
.
signals
.
editorCleared
.
add
(
function
()
{
meshCount
=
0
;
lightCount
=
0
;
cameraCount
=
0
;
}
);
// Group
// Group
var
option
=
new
UI
.
Row
();
var
option
=
new
UI
.
Row
();
...
@@ -38,7 +24,7 @@ Menubar.Add = function ( editor ) {
...
@@ -38,7 +24,7 @@ Menubar.Add = function ( editor ) {
option
.
onClick
(
function
()
{
option
.
onClick
(
function
()
{
var
mesh
=
new
THREE
.
Group
();
var
mesh
=
new
THREE
.
Group
();
mesh
.
name
=
'
Group
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Group
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -59,7 +45,7 @@ Menubar.Add = function ( editor ) {
...
@@ -59,7 +45,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
PlaneBufferGeometry
(
1
,
1
,
1
,
1
);
var
geometry
=
new
THREE
.
PlaneBufferGeometry
(
1
,
1
,
1
,
1
);
var
material
=
new
THREE
.
MeshStandardMaterial
();
var
material
=
new
THREE
.
MeshStandardMaterial
();
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
name
=
'
Plane
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Plane
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -75,7 +61,7 @@ Menubar.Add = function ( editor ) {
...
@@ -75,7 +61,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
BoxBufferGeometry
(
1
,
1
,
1
,
1
,
1
,
1
);
var
geometry
=
new
THREE
.
BoxBufferGeometry
(
1
,
1
,
1
,
1
,
1
,
1
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Box
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Box
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -91,7 +77,7 @@ Menubar.Add = function ( editor ) {
...
@@ -91,7 +77,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
CircleBufferGeometry
(
1
,
8
,
0
,
Math
.
PI
*
2
);
var
geometry
=
new
THREE
.
CircleBufferGeometry
(
1
,
8
,
0
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Circle
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Circle
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -107,7 +93,7 @@ Menubar.Add = function ( editor ) {
...
@@ -107,7 +93,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
CylinderBufferGeometry
(
1
,
1
,
1
,
8
,
1
,
false
,
0
,
Math
.
PI
*
2
);
var
geometry
=
new
THREE
.
CylinderBufferGeometry
(
1
,
1
,
1
,
8
,
1
,
false
,
0
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Cylinder
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Cylinder
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -123,7 +109,7 @@ Menubar.Add = function ( editor ) {
...
@@ -123,7 +109,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
SphereBufferGeometry
(
1
,
8
,
6
,
0
,
Math
.
PI
*
2
,
0
,
Math
.
PI
);
var
geometry
=
new
THREE
.
SphereBufferGeometry
(
1
,
8
,
6
,
0
,
Math
.
PI
*
2
,
0
,
Math
.
PI
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Sphere
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Sphere
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -139,7 +125,7 @@ Menubar.Add = function ( editor ) {
...
@@ -139,7 +125,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
IcosahedronGeometry
(
1
,
0
);
var
geometry
=
new
THREE
.
IcosahedronGeometry
(
1
,
0
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Icosahedron
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Icosahedron
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -155,7 +141,7 @@ Menubar.Add = function ( editor ) {
...
@@ -155,7 +141,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
TorusBufferGeometry
(
1
,
0.4
,
8
,
6
,
Math
.
PI
*
2
);
var
geometry
=
new
THREE
.
TorusBufferGeometry
(
1
,
0.4
,
8
,
6
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Torus
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Torus
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -171,7 +157,7 @@ Menubar.Add = function ( editor ) {
...
@@ -171,7 +157,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
TorusKnotBufferGeometry
(
1
,
0.4
,
64
,
8
,
2
,
3
);
var
geometry
=
new
THREE
.
TorusKnotBufferGeometry
(
1
,
0.4
,
64
,
8
,
2
,
3
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
TorusKnot
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
TorusKnot
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -198,7 +184,7 @@ Menubar.Add = function ( editor ) {
...
@@ -198,7 +184,7 @@ Menubar.Add = function ( editor ) {
var geometry = new THREE.TeapotBufferGeometry( size, segments, bottom, lid, body, fitLid, blinnScale );
var geometry = new THREE.TeapotBufferGeometry( size, segments, bottom, lid, body, fitLid, blinnScale );
var mesh = new THREE.Mesh( geometry, material );
var mesh = new THREE.Mesh( geometry, material );
mesh.name = 'Teapot
' + ( ++ meshCount )
;
mesh.name = 'Teapot
'
;
editor.addObject( mesh );
editor.addObject( mesh );
editor.select( mesh );
editor.select( mesh );
...
@@ -230,7 +216,7 @@ Menubar.Add = function ( editor ) {
...
@@ -230,7 +216,7 @@ Menubar.Add = function ( editor ) {
var
geometry
=
new
THREE
.
LatheBufferGeometry
(
points
,
12
,
0
,
Math
.
PI
*
2
);
var
geometry
=
new
THREE
.
LatheBufferGeometry
(
points
,
12
,
0
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
(
{
side
:
THREE
.
DoubleSide
}
)
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
(
{
side
:
THREE
.
DoubleSide
}
)
);
mesh
.
name
=
'
Lathe
'
+
(
++
meshCount
)
;
mesh
.
name
=
'
Lathe
'
;
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
editor
.
execute
(
new
AddObjectCommand
(
mesh
)
);
...
@@ -245,7 +231,7 @@ Menubar.Add = function ( editor ) {
...
@@ -245,7 +231,7 @@ Menubar.Add = function ( editor ) {
option
.
onClick
(
function
()
{
option
.
onClick
(
function
()
{
var
sprite
=
new
THREE
.
Sprite
(
new
THREE
.
SpriteMaterial
()
);
var
sprite
=
new
THREE
.
Sprite
(
new
THREE
.
SpriteMaterial
()
);
sprite
.
name
=
'
Sprite
'
+
(
++
meshCount
)
;
sprite
.
name
=
'
Sprite
'
;
editor
.
execute
(
new
AddObjectCommand
(
sprite
)
);
editor
.
execute
(
new
AddObjectCommand
(
sprite
)
);
...
@@ -268,7 +254,7 @@ Menubar.Add = function ( editor ) {
...
@@ -268,7 +254,7 @@ Menubar.Add = function ( editor ) {
var
distance
=
0
;
var
distance
=
0
;
var
light
=
new
THREE
.
PointLight
(
color
,
intensity
,
distance
);
var
light
=
new
THREE
.
PointLight
(
color
,
intensity
,
distance
);
light
.
name
=
'
PointLight
'
+
(
++
lightCount
)
;
light
.
name
=
'
PointLight
'
;
editor
.
execute
(
new
AddObjectCommand
(
light
)
);
editor
.
execute
(
new
AddObjectCommand
(
light
)
);
...
@@ -289,8 +275,8 @@ Menubar.Add = function ( editor ) {
...
@@ -289,8 +275,8 @@ Menubar.Add = function ( editor ) {
var
penumbra
=
0
;
var
penumbra
=
0
;
var
light
=
new
THREE
.
SpotLight
(
color
,
intensity
,
distance
,
angle
,
penumbra
);
var
light
=
new
THREE
.
SpotLight
(
color
,
intensity
,
distance
,
angle
,
penumbra
);
light
.
name
=
'
SpotLight
'
+
(
++
lightCount
)
;
light
.
name
=
'
SpotLight
'
;
light
.
target
.
name
=
'
SpotLight
'
+
(
lightCount
)
+
'
Target
'
;
light
.
target
.
name
=
'
SpotLight Target
'
;
light
.
position
.
set
(
5
,
10
,
7.5
);
light
.
position
.
set
(
5
,
10
,
7.5
);
...
@@ -310,8 +296,8 @@ Menubar.Add = function ( editor ) {
...
@@ -310,8 +296,8 @@ Menubar.Add = function ( editor ) {
var
intensity
=
1
;
var
intensity
=
1
;
var
light
=
new
THREE
.
DirectionalLight
(
color
,
intensity
);
var
light
=
new
THREE
.
DirectionalLight
(
color
,
intensity
);
light
.
name
=
'
DirectionalLight
'
+
(
++
lightCount
)
;
light
.
name
=
'
DirectionalLight
'
;
light
.
target
.
name
=
'
DirectionalLight
'
+
(
lightCount
)
+
'
Target
'
;
light
.
target
.
name
=
'
DirectionalLight Target
'
;
light
.
position
.
set
(
5
,
10
,
7.5
);
light
.
position
.
set
(
5
,
10
,
7.5
);
...
@@ -332,7 +318,7 @@ Menubar.Add = function ( editor ) {
...
@@ -332,7 +318,7 @@ Menubar.Add = function ( editor ) {
var
intensity
=
1
;
var
intensity
=
1
;
var
light
=
new
THREE
.
HemisphereLight
(
skyColor
,
groundColor
,
intensity
);
var
light
=
new
THREE
.
HemisphereLight
(
skyColor
,
groundColor
,
intensity
);
light
.
name
=
'
HemisphereLight
'
+
(
++
lightCount
)
;
light
.
name
=
'
HemisphereLight
'
;
light
.
position
.
set
(
0
,
10
,
0
);
light
.
position
.
set
(
0
,
10
,
0
);
...
@@ -351,7 +337,7 @@ Menubar.Add = function ( editor ) {
...
@@ -351,7 +337,7 @@ Menubar.Add = function ( editor ) {
var
color
=
0x222222
;
var
color
=
0x222222
;
var
light
=
new
THREE
.
AmbientLight
(
color
);
var
light
=
new
THREE
.
AmbientLight
(
color
);
light
.
name
=
'
AmbientLight
'
+
(
++
lightCount
)
;
light
.
name
=
'
AmbientLight
'
;
editor
.
execute
(
new
AddObjectCommand
(
light
)
);
editor
.
execute
(
new
AddObjectCommand
(
light
)
);
...
@@ -370,7 +356,7 @@ Menubar.Add = function ( editor ) {
...
@@ -370,7 +356,7 @@ Menubar.Add = function ( editor ) {
option
.
onClick
(
function
()
{
option
.
onClick
(
function
()
{
var
camera
=
new
THREE
.
PerspectiveCamera
(
50
,
1
,
1
,
10000
);
var
camera
=
new
THREE
.
PerspectiveCamera
(
50
,
1
,
1
,
10000
);
camera
.
name
=
'
PerspectiveCamera
'
+
(
++
cameraCount
)
;
camera
.
name
=
'
PerspectiveCamera
'
;
editor
.
execute
(
new
AddObjectCommand
(
camera
)
);
editor
.
execute
(
new
AddObjectCommand
(
camera
)
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录