Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
a8080659
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,发现更多精彩内容 >>
提交
a8080659
编写于
9月 10, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Rename DragControls example.
上级
81463ef1
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
10 addition
and
20 deletion
+10
-20
examples/files.js
examples/files.js
+1
-1
examples/misc_controls_drag.html
examples/misc_controls_drag.html
+9
-19
未找到文件。
examples/files.js
浏览文件 @
a8080659
...
@@ -52,7 +52,6 @@ var files = {
...
@@ -52,7 +52,6 @@ var files = {
"
webgl_interactive_cubes_gpu
"
,
"
webgl_interactive_cubes_gpu
"
,
"
webgl_interactive_instances_gpu
"
,
"
webgl_interactive_instances_gpu
"
,
"
webgl_interactive_cubes_ortho
"
,
"
webgl_interactive_cubes_ortho
"
,
"
webgl_interactive_draggablecubes
"
,
"
webgl_interactive_lines
"
,
"
webgl_interactive_lines
"
,
"
webgl_interactive_points
"
,
"
webgl_interactive_points
"
,
"
webgl_interactive_raycasting_points
"
,
"
webgl_interactive_raycasting_points
"
,
...
@@ -360,6 +359,7 @@ var files = {
...
@@ -360,6 +359,7 @@ var files = {
"
misc_animation_keys
"
,
"
misc_animation_keys
"
,
"
misc_boxselection
"
,
"
misc_boxselection
"
,
"
misc_controls_deviceorientation
"
,
"
misc_controls_deviceorientation
"
,
"
misc_controls_drag
"
,
"
misc_controls_fly
"
,
"
misc_controls_fly
"
,
"
misc_controls_map
"
,
"
misc_controls_map
"
,
"
misc_controls_orbit
"
,
"
misc_controls_orbit
"
,
...
...
examples/
webgl_interactive_draggablecubes
.html
→
examples/
misc_controls_drag
.html
浏览文件 @
a8080659
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<title>
three.js webgl - drag
gable cube
s
</title>
<title>
three.js webgl - drag
control
s
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"main.css"
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"main.css"
>
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<body>
<body>
<div
id=
"info"
>
<div
id=
"info"
>
<a
href=
"http
://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webgl - draggable cube
s
<a
href=
"http
s://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webgl - drag control
s
</div>
</div>
<script
type=
"module"
>
<script
type=
"module"
>
...
@@ -27,11 +27,10 @@
...
@@ -27,11 +27,10 @@
import
Stats
from
'
./jsm/libs/stats.module.js
'
;
import
Stats
from
'
./jsm/libs/stats.module.js
'
;
import
{
TrackballControls
}
from
'
./jsm/controls/TrackballControls.js
'
;
import
{
DragControls
}
from
'
./jsm/controls/DragControls.js
'
;
import
{
DragControls
}
from
'
./jsm/controls/DragControls.js
'
;
var
container
,
stats
;
var
container
,
stats
;
var
camera
,
controls
,
scene
,
renderer
;
var
camera
,
scene
,
renderer
;
var
objects
=
[];
var
objects
=
[];
init
();
init
();
...
@@ -98,24 +97,17 @@
...
@@ -98,24 +97,17 @@
container
.
appendChild
(
renderer
.
domElement
);
container
.
appendChild
(
renderer
.
domElement
);
controls
=
new
TrackballControls
(
camera
,
renderer
.
domElement
);
var
controls
=
new
DragControls
(
objects
,
camera
,
renderer
.
domElement
);
controls
.
rotateSpeed
=
1.0
;
controls
.
zoomSpeed
=
1.2
;
controls
.
panSpeed
=
0.8
;
controls
.
noZoom
=
false
;
controls
.
noPan
=
false
;
controls
.
staticMoving
=
true
;
controls
.
dynamicDampingFactor
=
0.3
;
var
dragControls
=
new
DragControls
(
objects
,
camera
,
renderer
.
domElement
);
controls
.
addEventListener
(
'
dragstart
'
,
function
(
event
)
{
dragControls
.
addEventListener
(
'
dragstart
'
,
function
()
{
controls
.
enabled
=
false
;
event
.
object
.
material
.
emissive
.
set
(
0xaaaaaa
)
;
}
);
}
);
dragControls
.
addEventListener
(
'
dragend
'
,
function
()
{
controls
.
enabled
=
true
;
controls
.
addEventListener
(
'
dragend
'
,
function
(
event
)
{
event
.
object
.
material
.
emissive
.
set
(
0x000000
);
}
);
}
);
...
@@ -150,8 +142,6 @@
...
@@ -150,8 +142,6 @@
function
render
()
{
function
render
()
{
controls
.
update
();
renderer
.
render
(
scene
,
camera
);
renderer
.
render
(
scene
,
camera
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录