Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
77af9c0c
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
77af9c0c
编写于
10月 07, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implemented @jeromeetienne's webgl voxelpainter changes.
上级
869927a8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
20 deletion
+10
-20
examples/webgl_interactive_voxelpainter.html
examples/webgl_interactive_voxelpainter.html
+10
-20
未找到文件。
examples/webgl_interactive_voxelpainter.html
浏览文件 @
77af9c0c
...
...
@@ -22,7 +22,7 @@
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/RequestAnimationFrame.js"
></script>
<script
src=
"js/Stats.js"
></script>
<link
href=
"js/gui/gui.css"
media=
"screen"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"js/gui/gui.min.js"
></script>
...
...
@@ -44,7 +44,7 @@
var
gui
,
voxelConfig
=
{
orthographicProjection
:
false
};
init
();
animate
();
...
...
@@ -58,12 +58,12 @@
info
.
style
.
top
=
'
10px
'
;
info
.
style
.
width
=
'
100%
'
;
info
.
style
.
textAlign
=
'
center
'
;
info
.
innerHTML
=
'
<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - voxel painter - webgl<br
/
><strong>click</strong>: add voxel, <strong>control + click</strong>: remove voxel, <strong>shift + click</strong>: rotate, <a href="javascript:save();return false;">save .png</a>
'
;
info
.
innerHTML
=
'
<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - voxel painter - webgl<br><strong>click</strong>: add voxel, <strong>control + click</strong>: remove voxel, <strong>shift + click</strong>: rotate, <a href="javascript:save();return false;">save .png</a>
'
;
container
.
appendChild
(
info
);
camera
=
new
THREE
.
CombinedCamera
(
window
.
innerWidth
,
window
.
innerHeight
,
45
,
1
,
10000
,
-
2000
,
10000
);
camera
.
position
.
y
=
800
;
cameraTarget
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
scene
=
new
THREE
.
Scene
();
...
...
@@ -99,20 +99,10 @@
scene
.
add
(
ambientLight
);
var
directionalLight
=
new
THREE
.
DirectionalLight
(
0xffffff
);
directionalLight
.
position
.
x
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
y
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
z
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
normalize
();
scene
.
add
(
directionalLight
);
var
directionalLight
=
new
THREE
.
DirectionalLight
(
0x808080
);
directionalLight
.
position
.
x
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
y
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
z
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
normalize
();
directionalLight
.
position
.
set
(
1
,
0.75
,
0.5
).
normalize
();
scene
.
add
(
directionalLight
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
,
preserveDrawingBuffer
:
true
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
...
...
@@ -126,11 +116,11 @@
document
.
addEventListener
(
'
mousedown
'
,
onDocumentMouseDown
,
false
);
document
.
addEventListener
(
'
keydown
'
,
onDocumentKeyDown
,
false
);
document
.
addEventListener
(
'
keyup
'
,
onDocumentKeyUp
,
false
);
// add GUI
gui
=
new
GUI
();
gui
.
add
(
voxelConfig
,
'
orthographicProjection
'
).
onChange
(
function
(){
if
(
voxelConfig
.
orthographicProjection
)
{
camera
.
toOrthographic
();
camera
.
position
.
x
=
1000
;
...
...
@@ -141,9 +131,9 @@
camera
.
toPerspective
();
camera
.
position
.
y
=
800
;
}
});
}
function
getRealIntersector
(
intersects
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录