Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0824e113
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,发现更多精彩内容 >>
提交
0824e113
编写于
1月 01, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Editor: Removed editable setting.
上级
794dfc49
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
11 addition
and
63 deletion
+11
-63
editor/examples/arkanoid.app.json
editor/examples/arkanoid.app.json
+1
-2
editor/examples/camera.app.json
editor/examples/camera.app.json
+1
-2
editor/examples/particles.app.json
editor/examples/particles.app.json
+1
-2
editor/examples/pong.app.json
editor/examples/pong.app.json
+0
-1
editor/js/Config.js
editor/js/Config.js
+0
-1
editor/js/Editor.js
editor/js/Editor.js
+0
-1
editor/js/Sidebar.Project.js
editor/js/Sidebar.Project.js
+0
-14
editor/js/libs/app.js
editor/js/libs/app.js
+0
-2
editor/js/libs/app/index.html
editor/js/libs/app/index.html
+8
-38
未找到文件。
editor/examples/arkanoid.app.json
浏览文件 @
0824e113
...
...
@@ -4,7 +4,6 @@
},
"project"
:
{
"shadows"
:
true
,
"editable"
:
true
,
"vr"
:
false
},
"camera"
:
{
...
...
@@ -205,4 +204,4 @@
"source"
:
"var ball = this.getObjectByName( 'Ball' );
\n\n
var direction = new THREE.Vector3();
\n
direction.x = Math.random() - 0.5;
\n
direction.z = - 0.5;
\n
direction.normalize();
\n\n
var speed = new THREE.Vector3();
\n\n
//
\n\n
var group = new THREE.Group();
\n
this.add( group );
\n\n
var paddle = this.getObjectByName( 'Paddle' );
\n
paddle.material.visible = false;
\n
group.add( paddle );
\n\n
var brick = this.getObjectByName( 'Brick' );
\n\n
for ( var j = 0; j < 8; j ++ ) {
\n\n\t
var material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );
\n\n\t
for ( var i = 0; i < 12; i ++ ) {
\n\t\t\n\t\t
var object = brick.clone();
\n\t\t
object.position.x = i * 22 - 120;
\n\t\t
object.position.z = j * 14 - 120;
\n\t\t
group.add( object );
\n\n\t\t
var cylinder = object.getObjectByName( 'Cylinder' );
\n\t\t
cylinder.material = material;
\n\n\t
}
\n\t\n
}
\n\n
brick.visible = false;
\n
brick.material.visible = false;
\n\n
//
\n\n
var raycaster = new THREE.Raycaster();
\n\n
function update( event ) {
\n\t\n\t
if ( ball.position.x < - 150 || ball.position.x > 150 ) direction.x = - direction.x;
\n\t
if ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;
\n\n\t
ball.position.x = Math.max( - 150, Math.min( 150, ball.position.x ) );
\n\t
ball.position.z = Math.max( - 200, Math.min( 200, ball.position.z ) );
\n\t\n\t
ball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );
\n\t\n\t
raycaster.set( ball.position, direction );
\n\t\n\t
var intersections = raycaster.intersectObjects( group.children );
\n\t\n\t
if ( intersections.length > 0 ) {
\n\t\n\t\t
var intersection = intersections[ 0 ];
\n\t\t\n\t\t
if ( intersection.distance < 5 ) {
\n\t\t\t\n\t\t\t
if ( intersection.object !== paddle ) {
\n\n\t\t\t\t
group.remove( intersection.object );
\n\t\t\t\t\n\t\t\t
}
\n\t\t\t\n\t\t\t
direction.reflect( intersection.face.normal );
\n\t\t\t\n\t\t
}
\n\t\t\n\t
}
\n\n
}"
}]
}
}
\ No newline at end of file
}
editor/examples/camera.app.json
浏览文件 @
0824e113
...
...
@@ -4,7 +4,6 @@
},
"project"
:
{
"shadows"
:
true
,
"editable"
:
true
,
"vr"
:
false
},
"camera"
:
{
...
...
@@ -187,4 +186,4 @@
"source"
:
"function update( event ) {
\n\n\t
var time = event.time * 0.001;
\n\n\t
this.position.x = Math.sin( time ) * 400;
\n\t
this.position.z = Math.cos( time ) * 400;
\n\t
this.lookAt( scene.position );
\n\n
}"
}]
}
}
\ No newline at end of file
}
editor/examples/particles.app.json
浏览文件 @
0824e113
...
...
@@ -4,7 +4,6 @@
},
"project"
:
{
"shadows"
:
true
,
"editable"
:
true
,
"vr"
:
false
},
"camera"
:
{
...
...
@@ -97,4 +96,4 @@
"source"
:
"var original = this.getObjectByName( 'Particle' );
\n\n
var particles = [];
\n\n
for ( var i = 0; i < 100; i ++ ) {
\n\n\t
var particle = original.clone();
\n\t
particle.userData.velocity = new THREE.Vector3();
\n\t
this.add( particle );
\n\n\t
particles.push( particle );
\n\n
}
\n\n
function update( event ) {
\n\t\n\t
var particle = particles.shift();
\n\t
particles.push( particle );
\n\t\t\n\t
var velocity = particle.userData.velocity;
\n\t
velocity.x = Math.random() - 0.5;
\n\t
velocity.y = Math.random() + 1;
\n\t
velocity.z = Math.random() - 0.5;
\n\n\t
for ( var i = 0; i < particles.length; i ++ ) {
\n\n\t\t
var particle = particles[ i ];
\n\n\t\t
var velocity = particle.userData.velocity;
\n\n\t\t
velocity.y -= 0.098;
\n\n\t\t
particle.position.add( velocity );
\n\n\t\t
if ( particle.position.y < 0 ) {
\n\n\t\t\t
particle.position.y = 0;
\n\n\t\t\t
velocity.y = - velocity.y;
\n\t\t\t
velocity.multiplyScalar( 0.6 );
\n\n\t\t
}
\n\n\t
}
\n\n
}"
}]
}
}
\ No newline at end of file
}
editor/examples/pong.app.json
浏览文件 @
0824e113
...
...
@@ -4,7 +4,6 @@
},
"project"
:
{
"shadows"
:
false
,
"editable"
:
false
,
"vr"
:
false
},
"camera"
:
{
...
...
editor/js/Config.js
浏览文件 @
0824e113
...
...
@@ -13,7 +13,6 @@ var Config = function ( name ) {
'
project/renderer/gammaInput
'
:
false
,
'
project/renderer/gammaOutput
'
:
false
,
'
project/renderer/shadows
'
:
true
,
'
project/editable
'
:
false
,
'
project/vr
'
:
false
,
'
settings/history
'
:
false
...
...
editor/js/Editor.js
浏览文件 @
0824e113
...
...
@@ -500,7 +500,6 @@ Editor.prototype = {
gammaInput
:
this
.
config
.
getKey
(
'
project/renderer/gammaInput
'
),
gammaOutput
:
this
.
config
.
getKey
(
'
project/renderer/gammaOutput
'
),
shadows
:
this
.
config
.
getKey
(
'
project/renderer/shadows
'
),
editable
:
this
.
config
.
getKey
(
'
project/editable
'
),
vr
:
this
.
config
.
getKey
(
'
project/vr
'
)
},
camera
:
this
.
camera
.
toJSON
(),
...
...
editor/js/Sidebar.Project.js
浏览文件 @
0824e113
...
...
@@ -101,20 +101,6 @@ Sidebar.Project = function ( editor ) {
container
.
add
(
rendererPropertiesRow
);
// Editable
var
editableRow
=
new
UI
.
Row
();
var
editable
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/editable
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/editable
'
,
this
.
getValue
()
);
}
);
editableRow
.
add
(
new
UI
.
Text
(
'
Editable
'
).
setWidth
(
'
90px
'
)
);
editableRow
.
add
(
editable
);
container
.
add
(
editableRow
);
// VR
var
vrRow
=
new
UI
.
Row
();
...
...
editor/js/libs/app.js
浏览文件 @
0824e113
...
...
@@ -6,8 +6,6 @@ var APP = {
Player
:
function
()
{
var
scope
=
this
;
var
loader
=
new
THREE
.
ObjectLoader
();
var
camera
,
scene
,
renderer
;
...
...
editor/js/libs/app/index.html
浏览文件 @
0824e113
...
...
@@ -6,26 +6,13 @@
<meta
name=
"generator"
content=
"Three.js Editor"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
body
{
font-family
:
Helvetica
,
Arial
,
sans-serif
;
font-size
:
12px
;
background-color
:
#000
;
margin
:
0px
;
overflow
:
hidden
;
}
#edit
{
position
:
absolute
;
bottom
:
20px
;
right
:
20px
;
padding
:
8px
;
color
:
#555
;
background-color
:
#fff
;
opacity
:
0.5
;
}
#edit
:hover
{
cursor
:
pointer
;
opacity
:
1
;
}
body
{
font-family
:
Helvetica
,
Arial
,
sans-serif
;
font-size
:
12px
;
background-color
:
#000
;
margin
:
0px
;
overflow
:
hidden
;
}
</style>
</head>
<body
ontouchstart=
""
>
...
...
@@ -37,30 +24,13 @@
var
loader
=
new
THREE
.
FileLoader
();
loader
.
load
(
'
app.json
'
,
function
(
text
)
{
var
json
=
JSON
.
parse
(
text
);
var
player
=
new
APP
.
Player
();
player
.
load
(
json
);
player
.
load
(
JSON
.
parse
(
text
)
);
player
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
player
.
play
();
document
.
body
.
appendChild
(
player
.
dom
);
if
(
json
.
project
.
editable
===
true
)
{
var
button
=
document
.
createElement
(
'
div
'
);
button
.
id
=
'
edit
'
;
button
.
textContent
=
'
EDIT
'
;
button
.
addEventListener
(
'
click
'
,
function
(
event
)
{
var
url
=
location
.
href
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
window
.
open
(
'
http://threejs.org/editor/#file=
'
+
url
+
'
/app.json
'
);
},
false
);
document
.
body
.
appendChild
(
button
);
}
window
.
addEventListener
(
'
resize
'
,
function
()
{
player
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录