Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5eb7b3a4
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,发现更多精彩内容 >>
提交
5eb7b3a4
编写于
7月 27, 2015
作者:
J
Jean Carlo Deconto
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sea3d revision 2
上级
8e02a5c8
变更
9
展开全部
显示空白变更内容
内联
并排
Showing
9 changed file
with
729 addition
and
429 deletion
+729
-429
examples/index.html
examples/index.html
+1
-0
examples/js/loaders/sea3d/SEA3DLoader.js
examples/js/loaders/sea3d/SEA3DLoader.js
+409
-351
examples/models/sea3d/sound.sea
examples/models/sea3d/sound.sea
+0
-0
examples/webgl_loader_sea3d.html
examples/webgl_loader_sea3d.html
+14
-16
examples/webgl_loader_sea3d_hierarchy.html
examples/webgl_loader_sea3d_hierarchy.html
+12
-14
examples/webgl_loader_sea3d_keyframe.html
examples/webgl_loader_sea3d_keyframe.html
+15
-18
examples/webgl_loader_sea3d_morph.html
examples/webgl_loader_sea3d_morph.html
+207
-0
examples/webgl_loader_sea3d_skinning.html
examples/webgl_loader_sea3d_skinning.html
+16
-17
examples/webgl_loader_sea3d_sound.html
examples/webgl_loader_sea3d_sound.html
+55
-13
未找到文件。
examples/index.html
浏览文件 @
5eb7b3a4
...
...
@@ -266,6 +266,7 @@
"
webgl_loader_sea3d
"
,
"
webgl_loader_sea3d_hierarchy
"
,
"
webgl_loader_sea3d_keyframe
"
,
"
webgl_loader_sea3d_morph
"
,
"
webgl_loader_sea3d_skinning
"
,
"
webgl_loader_sea3d_sound
"
,
"
webgl_loader_scene
"
,
...
...
examples/js/loaders/sea3d/SEA3DLoader.js
浏览文件 @
5eb7b3a4
此差异已折叠。
点击以展开。
examples/models/sea3d/sound.sea
浏览文件 @
5eb7b3a4
无法预览此类型文件
examples/webgl_loader_sea3d.html
浏览文件 @
5eb7b3a4
...
...
@@ -33,7 +33,7 @@
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/controls/
Trackball
Controls.js"
></script>
<script
src=
"js/controls/
Orbit
Controls.js"
></script>
<script
src=
"js/postprocessing/EffectComposer.js"
></script>
<script
src=
"js/postprocessing/RenderPass.js"
></script>
...
...
@@ -101,13 +101,10 @@
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2
000
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
10
000
);
camera
.
position
.
set
(
1000
,
-
300
,
1000
);
controls
=
new
THREE
.
TrackballControls
(
camera
,
document
);
controls
.
noZoom
=
true
;
controls
.
noPan
=
true
;
controls
.
dynamicDampingFactor
=
0.05
;
controls
=
new
THREE
.
OrbitControls
(
camera
);
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
...
...
@@ -164,28 +161,29 @@
//
var
clock
=
new
THREE
.
Clock
();
function
animate
()
{
var
delta
=
clock
.
getDelta
();
requestAnimationFrame
(
animate
);
// update Three.JS+SEA3D animation
THREE
.
SEA3D
.
AnimationHandler
.
update
(
delta
);
controls
.
update
();
render
();
render
(
delta
);
stats
.
update
();
}
var
clock
=
new
THREE
.
Clock
();
function
render
()
{
var
delta
=
clock
.
getDelta
();
THREE
.
AnimationHandler
.
update
(
delta
);
function
render
(
dlt
)
{
//renderer.render( scene, camera );
composer
.
render
(
d
elta
);
composer
.
render
(
d
lt
);
}
...
...
examples/webgl_loader_sea3d_hierarchy.html
浏览文件 @
5eb7b3a4
...
...
@@ -33,7 +33,7 @@
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/controls/
Trackball
Controls.js"
></script>
<script
src=
"js/controls/
Orbit
Controls.js"
></script>
<script
src=
"js/postprocessing/EffectComposer.js"
></script>
<script
src=
"js/postprocessing/RenderPass.js"
></script>
...
...
@@ -113,7 +113,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2000
);
camera
.
position
.
set
(
1000
,
-
300
,
1000
);
controls
=
new
THREE
.
TrackballControls
(
camera
,
document
);
controls
=
new
THREE
.
OrbitControls
(
camera
);
controls
.
noZoom
=
true
;
controls
.
noPan
=
true
;
controls
.
dynamicDampingFactor
=
0.05
;
...
...
@@ -169,31 +169,29 @@
//
var
clock
=
new
THREE
.
Clock
();
function
animate
()
{
var
delta
=
clock
.
getDelta
();
requestAnimationFrame
(
animate
);
// update Three.JS+SEA3D animation
THREE
.
SEA3D
.
AnimationHandler
.
update
(
delta
);
controls
.
update
();
render
();
render
(
delta
);
stats
.
update
();
}
var
clock
=
new
THREE
.
Clock
();
function
render
()
{
var
delta
=
clock
.
getDelta
();
THREE
.
AnimationHandler
.
update
(
delta
);
// SEA3D Keyframe Update
SEA3D
.
AnimationHandler
.
update
(
delta
);
function
render
(
dlt
)
{
//renderer.render( scene, camera );
composer
.
render
(
d
elta
);
composer
.
render
(
d
lt
);
}
...
...
examples/webgl_loader_sea3d_keyframe.html
浏览文件 @
5eb7b3a4
...
...
@@ -34,7 +34,7 @@
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/controls/
Trackball
Controls.js"
></script>
<script
src=
"js/controls/
Orbit
Controls.js"
></script>
<script
src=
"js/postprocessing/EffectComposer.js"
></script>
<script
src=
"js/postprocessing/RenderPass.js"
></script>
...
...
@@ -148,10 +148,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2000
);
camera
.
position
.
set
(
1000
,
-
300
,
1000
);
controls
=
new
THREE
.
TrackballControls
(
camera
,
document
);
controls
.
noZoom
=
true
;
controls
.
noPan
=
true
;
controls
.
dynamicDampingFactor
=
0.05
;
controls
=
new
THREE
.
OrbitControls
(
camera
);
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
...
...
@@ -279,31 +276,31 @@
}
}
//
var
clock
=
new
THREE
.
Clock
();
function
animate
()
{
var
delta
=
clock
.
getDelta
();
requestAnimationFrame
(
animate
);
// update Three.JS+SEA3D animation
THREE
.
SEA3D
.
AnimationHandler
.
update
(
delta
);
controls
.
update
();
render
();
render
(
delta
);
stats
.
update
();
}
var
clock
=
new
THREE
.
Clock
();
function
render
()
{
var
delta
=
clock
.
getDelta
();
THREE
.
AnimationHandler
.
update
(
delta
);
// SEA3D Keyframe Update
SEA3D
.
AnimationHandler
.
update
(
delta
);
function
render
(
dlt
)
{
//renderer.render( scene, camera );
composer
.
render
(
d
elta
);
composer
.
render
(
d
lt
);
}
...
...
examples/webgl_loader_sea3d_morph.html
0 → 100644
浏览文件 @
5eb7b3a4
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - sea3d / morph
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
body
{
font-family
:
Monospace
;
background-color
:
#000
;
margin
:
0px
;
overflow
:
hidden
;
}
#info
{
color
:
#fff
;
position
:
absolute
;
top
:
10px
;
width
:
100%
;
text-align
:
center
;
z-index
:
100
;
display
:
block
;
}
a
{
color
:
white
}
</style>
</head>
<body>
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
>
three.js
</a>
- model by
<a
href=
"https://github.com/sunag/sea3d"
style=
"color:#FFFFF"
target=
"_blank"
>
sea3d
</a>
</div>
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/controls/OrbitControls.js"
></script>
<script
src=
"js/postprocessing/EffectComposer.js"
></script>
<script
src=
"js/postprocessing/RenderPass.js"
></script>
<script
src=
"js/postprocessing/ShaderPass.js"
></script>
<script
src=
"js/postprocessing/MaskPass.js"
></script>
<script
src=
"js/shaders/CopyShader.js"
></script>
<script
src=
"js/shaders/ColorCorrectionShader.js"
></script>
<script
src=
"js/shaders/VignetteShader.js"
></script>
<script
src=
"js/loaders/sea3d/SEA3D.js"
></script>
<script
src=
"js/loaders/sea3d/SEA3DLZMA.js"
></script>
<script
src=
"js/loaders/sea3d/SEA3DLoader.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/libs/stats.min.js"
></script>
<script>
if
(
!
Detector
.
webgl
)
Detector
.
addGetWebGLMessage
();
var
container
,
stats
;
var
camera
,
scene
,
renderer
,
composer
,
controls
,
teapot
;
var
loader
;
// Initialize Three.JS
init
();
//
// SEA3D Loader
//
loader
=
new
THREE
.
SEA3D
(
{
autoPlay
:
true
,
// Auto play animations
container
:
scene
,
// Container to add models
parser
:
THREE
.
SEA3D
.
DEFAULT
,
// Auto choose THREE.BufferGeometry and THREE.Geometry
multiplier
:
1
// Light multiplier
}
);
loader
.
onComplete
=
function
(
e
)
{
// Get the first camera from 3ds Max
// use loader.get... to get others objects
var
cam
=
loader
.
cameras
[
0
];
camera
.
position
.
copy
(
cam
.
position
);
camera
.
rotation
.
copy
(
cam
.
rotation
);
// get mesh
teapot
=
loader
.
getMesh
(
"
Teapot01
"
);
// events
window
.
addEventListener
(
'
mousemove
'
,
onMouseMove
,
false
);
animate
();
};
loader
.
load
(
'
./models/sea3d/morph.sea
'
);
//
function
init
()
{
scene
=
new
THREE
.
Scene
();
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2000
);
camera
.
position
.
set
(
1000
,
-
300
,
1000
);
controls
=
new
THREE
.
OrbitControls
(
camera
);
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
setClearColor
(
0x333333
,
1
);
container
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
container
.
appendChild
(
stats
.
domElement
);
// post-processing
composer
=
new
THREE
.
EffectComposer
(
renderer
);
var
renderPass
=
new
THREE
.
RenderPass
(
scene
,
camera
);
var
copyPass
=
new
THREE
.
ShaderPass
(
THREE
.
CopyShader
);
composer
.
addPass
(
renderPass
);
var
vh
=
1.4
,
vl
=
1.2
;
var
colorCorrectionPass
=
new
THREE
.
ShaderPass
(
THREE
.
ColorCorrectionShader
);
colorCorrectionPass
.
uniforms
[
"
powRGB
"
].
value
=
new
THREE
.
Vector3
(
vh
,
vh
,
vh
);
colorCorrectionPass
.
uniforms
[
"
mulRGB
"
].
value
=
new
THREE
.
Vector3
(
vl
,
vl
,
vl
);
composer
.
addPass
(
colorCorrectionPass
);
var
vignettePass
=
new
THREE
.
ShaderPass
(
THREE
.
VignetteShader
);
vignettePass
.
uniforms
[
"
darkness
"
].
value
=
1.0
;
composer
.
addPass
(
vignettePass
);
composer
.
addPass
(
copyPass
);
copyPass
.
renderToScreen
=
true
;
// extra lights
scene
.
add
(
new
THREE
.
AmbientLight
(
0x333333
)
);
// events
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onMouseMove
(
e
)
{
var
mouseX
=
e
.
clientX
,
mouseY
=
e
.
clientY
;
// change morph weight: 0 at 1
// names from modifier Morph of 3ds Max
teapot
.
setWeight
(
"
OldTeapot
"
,
mouseX
/
window
.
innerWidth
);
teapot
.
setWeight
(
"
Sphere
"
,
mouseY
/
window
.
innerHeight
);
}
function
onWindowResize
()
{
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
//
var
clock
=
new
THREE
.
Clock
();
function
animate
()
{
var
delta
=
clock
.
getDelta
();
requestAnimationFrame
(
animate
);
controls
.
update
();
render
(
delta
);
stats
.
update
();
}
function
render
(
dlt
)
{
//renderer.render( scene, camera );
composer
.
render
(
dlt
);
}
</script>
</body>
</html>
examples/webgl_loader_sea3d_skinning.html
浏览文件 @
5eb7b3a4
...
...
@@ -35,7 +35,7 @@
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/controls/
Trackball
Controls.js"
></script>
<script
src=
"js/controls/
Orbit
Controls.js"
></script>
<script
src=
"js/postprocessing/EffectComposer.js"
></script>
<script
src=
"js/postprocessing/RenderPass.js"
></script>
...
...
@@ -90,6 +90,7 @@
// get meshes
player
=
loader
.
getMesh
(
"
Player
"
);
hat
=
loader
.
getMesh
(
"
Hat
"
);
// events
...
...
@@ -115,10 +116,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2000
);
camera
.
position
.
set
(
1000
,
-
300
,
1000
);
controls
=
new
THREE
.
TrackballControls
(
camera
,
document
);
controls
.
noZoom
=
true
;
controls
.
noPan
=
true
;
controls
.
dynamicDampingFactor
=
0.05
;
controls
=
new
THREE
.
OrbitControls
(
camera
);
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
...
...
@@ -195,28 +193,29 @@
//
var
clock
=
new
THREE
.
Clock
();
function
animate
()
{
var
delta
=
clock
.
getDelta
();
requestAnimationFrame
(
animate
);
// update Three.JS+SEA3D animation
THREE
.
SEA3D
.
AnimationHandler
.
update
(
delta
);
controls
.
update
();
render
();
render
(
delta
);
stats
.
update
();
}
var
clock
=
new
THREE
.
Clock
();
function
render
()
{
var
delta
=
clock
.
getDelta
();
THREE
.
AnimationHandler
.
update
(
delta
);
function
render
(
dlt
)
{
//renderer.render( scene, camera );
composer
.
render
(
d
elta
);
composer
.
render
(
d
lt
);
}
...
...
examples/webgl_loader_sea3d_sound.html
浏览文件 @
5eb7b3a4
...
...
@@ -103,7 +103,7 @@
if
(
!
Detector
.
webgl
)
Detector
.
addGetWebGLMessage
();
var
container
,
stats
;
var
container
,
raycaster
,
stats
;
var
camera
,
scene
,
renderer
,
composer
,
controls
,
velocity
;
var
blocker
,
instructions
;
...
...
@@ -112,6 +112,8 @@
initKeyDown
var
loader
;
var
audioListener
,
soundFilter
;
var
soundArea
,
collisionArea
;
// Initialize Three.JS
...
...
@@ -134,6 +136,16 @@
loader
.
onComplete
=
function
(
e
)
{
audioListener
=
loader
.
audioListener
;
soundFilter
=
audioListener
.
context
.
createBiquadFilter
();
soundFilter
.
type
=
'
lowpass
'
;
soundFilter
.
Q
.
value
=
10
;
soundFilter
.
frequency
.
value
=
440
;
soundArea
=
loader
.
getSound3D
(
"
Point002
"
);
collisionArea
=
loader
.
getMesh
(
"
Torus003
"
);
animate
();
};
...
...
@@ -302,6 +314,8 @@
function
init
()
{
raycaster
=
new
THREE
.
Raycaster
();
scene
=
new
THREE
.
Scene
();
velocity
=
new
THREE
.
Vector3
();
...
...
@@ -387,12 +401,50 @@
}
var
clock
=
new
THREE
.
Clock
();
var
audioPos
=
new
THREE
.
Vector3
();
var
audioRot
=
new
THREE
.
Euler
();
function
updateSoundFilter
(
collision
,
sound3d
)
{
// difference position between sound and listener
var
difPos
=
new
THREE
.
Vector3
().
setFromMatrixPosition
(
sound3d
.
matrixWorld
).
sub
(
audioPos
);
var
length
=
difPos
.
length
();
// pick a vector from camera to sound
raycaster
.
set
(
audioPos
,
difPos
.
normalize
()
);
// intersecting sound1
if
(
length
>
50
&&
raycaster
.
intersectObjects
(
[
collision
]
).
length
)
{
if
(
sound3d
.
getFilter
()
!==
soundFilter
)
sound3d
.
setFilter
(
soundFilter
);
}
else
if
(
sound3d
.
getFilter
()
!==
undefined
)
{
sound3d
.
setFilter
();
}
}
//
function
animate
()
{
var
delta
=
clock
.
getDelta
();
animateCamera
(
delta
);
// Sound3D Spatial Transform Update
loader
.
audioListener
.
position
.
copy
(
audioPos
.
setFromMatrixPosition
(
camera
.
matrixWorld
)
);
loader
.
audioListener
.
rotation
.
copy
(
audioRot
.
setFromRotationMatrix
(
camera
.
matrixWorld
)
);
// Update sound filter from raycaster intersecting
updateSoundFilter
(
collisionArea
,
soundArea
);
// SEA3D Keyframe Update
SEA3D
.
AnimationHandler
.
update
(
delta
);
render
(
delta
);
stats
.
update
();
...
...
@@ -401,18 +453,8 @@
}
var
clock
=
new
THREE
.
Clock
();
function
render
(
delta
)
{
THREE
.
AnimationHandler
.
update
(
delta
);
// SEA3D Keyframe Update
SEA3D
.
AnimationHandler
.
update
(
delta
);
// Sound Update
THREE
.
Sound3D
.
update
(
camera
);
//renderer.render( scene, camera );
composer
.
render
(
delta
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录