Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
6766cfc1
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,发现更多精彩内容 >>
提交
6766cfc1
编写于
9月 02, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7088 from tschw/EditorMisc
Editor update
上级
b7818a43
ebcc8cf8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
141 addition
and
2 deletion
+141
-2
editor/index.html
editor/index.html
+2
-0
editor/js/Loader.js
editor/js/Loader.js
+6
-0
editor/js/Menubar.Add.js
editor/js/Menubar.Add.js
+28
-0
editor/js/Sidebar.Geometry.TeapotBufferGeometry.js
editor/js/Sidebar.Geometry.TeapotBufferGeometry.js
+103
-0
editor/js/Sidebar.Material.js
editor/js/Sidebar.Material.js
+2
-2
未找到文件。
editor/index.html
浏览文件 @
6766cfc1
...
...
@@ -112,6 +112,8 @@
<script
src=
"js/Sidebar.Geometry.SphereGeometry.js"
></script>
<script
src=
"js/Sidebar.Geometry.TorusGeometry.js"
></script>
<script
src=
"js/Sidebar.Geometry.TorusKnotGeometry.js"
></script>
<script
src=
"../examples/js/geometries/TeapotBufferGeometry.js"
></script>
<script
src=
"js/Sidebar.Geometry.TeapotBufferGeometry.js"
></script>
<script
src=
"js/Sidebar.Material.js"
></script>
<script
src=
"js/Sidebar.Script.js"
></script>
<script
src=
"js/Toolbar.js"
></script>
...
...
editor/js/Loader.js
浏览文件 @
6766cfc1
...
...
@@ -7,6 +7,8 @@ var Loader = function ( editor ) {
var
scope
=
this
;
var
signals
=
editor
.
signals
;
this
.
texturePath
=
''
;
this
.
loadFile
=
function
(
file
)
{
var
filename
=
file
.
name
;
...
...
@@ -386,6 +388,8 @@ var Loader = function ( editor ) {
}
else
if
(
data
.
metadata
.
type
.
toLowerCase
()
===
'
geometry
'
)
{
var
loader
=
new
THREE
.
JSONLoader
();
loader
.
setTexturePath
(
scope
.
texturePath
);
var
result
=
loader
.
parse
(
data
);
var
geometry
=
result
.
geometry
;
...
...
@@ -432,6 +436,8 @@ var Loader = function ( editor ) {
}
else
if
(
data
.
metadata
.
type
.
toLowerCase
()
===
'
object
'
)
{
var
loader
=
new
THREE
.
ObjectLoader
();
loader
.
setTexturePath
(
scope
.
texturePath
);
var
result
=
loader
.
parse
(
data
);
if
(
result
instanceof
THREE
.
Scene
)
{
...
...
editor/js/Menubar.Add.js
浏览文件 @
6766cfc1
...
...
@@ -236,6 +236,34 @@ Menubar.Add = function ( editor ) {
}
);
options
.
add
(
option
);
// Teapot
var
option
=
new
UI
.
Panel
();
option
.
setClass
(
'
option
'
);
option
.
setTextContent
(
'
Teapot
'
);
option
.
onClick
(
function
()
{
var
size
=
50
;
var
segments
=
10
;
var
bottom
=
true
;
var
lid
=
true
;
var
body
=
true
;
var
fitLid
=
false
;
var
blinnScale
=
true
;
var
material
=
new
THREE
.
MeshPhongMaterial
();
material
.
side
=
2
;
var
geometry
=
new
THREE
.
TeapotBufferGeometry
(
size
,
segments
,
bottom
,
lid
,
body
,
fitLid
,
blinnScale
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
name
=
'
Teapot
'
+
(
++
meshCount
);
editor
.
addObject
(
mesh
);
editor
.
select
(
mesh
);
}
);
options
.
add
(
option
);
// Sprite
var
option
=
new
UI
.
Panel
();
...
...
editor/js/Sidebar.Geometry.TeapotBufferGeometry.js
0 → 100644
浏览文件 @
6766cfc1
/**
* @author tschw
*/
Sidebar
.
Geometry
.
TeapotBufferGeometry
=
function
(
signals
,
object
)
{
var
container
=
new
UI
.
Panel
();
var
parameters
=
object
.
geometry
.
parameters
;
// size
var
sizeRow
=
new
UI
.
Panel
();
var
size
=
new
UI
.
Number
(
parameters
.
size
).
onChange
(
update
);
sizeRow
.
add
(
new
UI
.
Text
(
'
Size
'
).
setWidth
(
'
90px
'
)
);
sizeRow
.
add
(
size
);
container
.
add
(
sizeRow
);
// segments
var
segmentsRow
=
new
UI
.
Panel
();
var
segments
=
new
UI
.
Integer
(
parameters
.
segments
).
setRange
(
1
,
Infinity
).
onChange
(
update
);
segmentsRow
.
add
(
new
UI
.
Text
(
'
Segments
'
).
setWidth
(
'
90px
'
)
);
segmentsRow
.
add
(
segments
);
container
.
add
(
segmentsRow
);
// bottom
var
bottomRow
=
new
UI
.
Panel
();
var
bottom
=
new
UI
.
Checkbox
(
parameters
.
bottom
).
onChange
(
update
);
bottomRow
.
add
(
new
UI
.
Text
(
'
Bottom
'
).
setWidth
(
'
90px
'
)
);
bottomRow
.
add
(
bottom
);
container
.
add
(
bottomRow
);
// lid
var
lidRow
=
new
UI
.
Panel
();
var
lid
=
new
UI
.
Checkbox
(
parameters
.
lid
).
onChange
(
update
);
lidRow
.
add
(
new
UI
.
Text
(
'
Lid
'
).
setWidth
(
'
90px
'
)
);
lidRow
.
add
(
lid
);
container
.
add
(
lidRow
);
// body
var
bodyRow
=
new
UI
.
Panel
();
var
body
=
new
UI
.
Checkbox
(
parameters
.
body
).
onChange
(
update
);
bodyRow
.
add
(
new
UI
.
Text
(
'
Body
'
).
setWidth
(
'
90px
'
)
);
bodyRow
.
add
(
body
);
container
.
add
(
bodyRow
);
// fitted lid
var
fitLidRow
=
new
UI
.
Panel
();
var
fitLid
=
new
UI
.
Checkbox
(
parameters
.
fitLid
).
onChange
(
update
);
fitLidRow
.
add
(
new
UI
.
Text
(
'
Fitted Lid
'
).
setWidth
(
'
90px
'
)
);
fitLidRow
.
add
(
fitLid
);
container
.
add
(
fitLidRow
);
// blinn-sized
var
blinnRow
=
new
UI
.
Panel
();
var
blinn
=
new
UI
.
Checkbox
(
parameters
.
blinn
).
onChange
(
update
);
blinnRow
.
add
(
new
UI
.
Text
(
'
Blinn-scaled
'
).
setWidth
(
'
90px
'
)
);
blinnRow
.
add
(
blinn
);
container
.
add
(
blinnRow
);
function
update
()
{
object
.
geometry
.
dispose
();
object
.
geometry
=
new
THREE
.
TeapotBufferGeometry
(
size
.
getValue
(),
segments
.
getValue
(),
bottom
.
getValue
(),
lid
.
getValue
(),
body
.
getValue
(),
fitLid
.
getValue
(),
blinn
.
getValue
()
);
object
.
geometry
.
computeBoundingSphere
();
signals
.
geometryChanged
.
dispatch
(
object
);
}
return
container
;
}
editor/js/Sidebar.Material.js
浏览文件 @
6766cfc1
...
...
@@ -551,7 +551,7 @@ Sidebar.Material = function ( editor ) {
if
(
objectHasUvs
)
{
material
.
lightMap
=
specular
MapEnabled
?
materialLightMap
.
getValue
()
:
null
;
material
.
lightMap
=
light
MapEnabled
?
materialLightMap
.
getValue
()
:
null
;
material
.
needsUpdate
=
true
;
}
else
{
...
...
@@ -683,7 +683,7 @@ Sidebar.Material = function ( editor ) {
};
function
refreshUi
(
resetTextureSelectors
)
{
function
refreshUi
(
resetTextureSelectors
)
{
var
material
=
currentObject
.
material
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录