Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
罐装雪花
threejsdemo
提交
397a3932
T
threejsdemo
项目概览
罐装雪花
/
threejsdemo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
threejsdemo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
397a3932
编写于
12月 03, 2019
作者:
X
xiao149
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增在线演示地址
新增在线演示地址
上级
424dd88e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
17 deletion
+22
-17
3DProject.html
3DProject.html
+2
-14
3DVideo.html
3DVideo.html
+1
-1
README.md
README.md
+2
-1
ThreeJs/Modules.js
ThreeJs/Modules.js
+17
-1
video/video.mp4
video/video.mp4
+0
-0
video/videoPlane.mp4
video/videoPlane.mp4
+0
-0
未找到文件。
3DProject.html
浏览文件 @
397a3932
...
...
@@ -49,7 +49,7 @@
<div
id=
"label"
></div>
<div
id=
"container"
></div>
<video
id=
"video"
autoplay
loop
muted
>
<source
src=
"./video.mp4"
>
<source
src=
"./video
/videoPlane
.mp4"
>
</video>
<script>
...
...
@@ -302,19 +302,6 @@
createWindow
(
100
,
100
,
2
,
0
,
900
,
90
,
700
,
"
窗户
"
);
createWindow
(
100
,
100
,
2
,
0
,
-
200
,
90
,
700
,
"
窗户
"
);
createWindow
(
100
,
100
,
2
,
0
,
200
,
90
,
700
,
"
窗户
"
);
var
planeGeometry
=
new
THREE
.
PlaneGeometry
(
200
,
100
);
var
material
=
new
THREE
.
MeshPhongMaterial
();
material
.
side
=
THREE
.
DoubleSide
;
var
video
=
document
.
getElementById
(
'
video
'
);
var
texture
=
new
THREE
.
VideoTexture
(
video
);
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
magFilter
=
THREE
.
LinearFilter
;
texture
.
format
=
THREE
.
RGBFormat
;
material
.
map
=
texture
;
var
mesh
=
new
THREE
.
Mesh
(
planeGeometry
,
material
);
mesh
.
position
.
set
(
0
,
60
,
-
690
);
scene
.
add
(
mesh
);
}
// 初始化轨迹球控件
...
...
@@ -450,6 +437,7 @@
initMat
();
initScene
();
addSkybox
(
10000
,
scene
);
addVideoPlane
(
0
,
60
,
-
690
,
200
,
100
,
scene
,
'
video
'
);
initCamera
();
initRenderer
();
initContent
();
...
...
3DVideo.html
浏览文件 @
397a3932
...
...
@@ -27,7 +27,7 @@
</head>
<body>
<video
id=
"my-video"
class=
"video-js"
controls
preload=
"auto"
autoplay
loop
data-setup=
"{}"
crossorigin=
"anonymous"
>
<source
src=
"./video/
movie
.mp4"
/>
<source
src=
"./video/
video
.mp4"
/>
</video>
</body>
</html>
README.md
浏览文件 @
397a3932
# ThreeJsDemo
ThreeJs示例代码
在线演示地址:
http://www.yuyaowujin.top/3DProject.html
ThreeJs/Modules.js
浏览文件 @
397a3932
...
...
@@ -218,8 +218,24 @@ function addRollPlane(scene) {
}
//endregion
//region 放置视频面板
function
addVideoPlane
(
x
,
y
,
z
,
width
,
length
,
scene
,
videoId
)
{
var
planeGeometry
=
new
THREE
.
PlaneGeometry
(
width
,
length
);
var
material
=
new
THREE
.
MeshPhongMaterial
();
material
.
side
=
THREE
.
DoubleSide
;
var
video
=
document
.
getElementById
(
videoId
);
var
texture
=
new
THREE
.
VideoTexture
(
video
);
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
magFilter
=
THREE
.
LinearFilter
;
texture
.
format
=
THREE
.
RGBFormat
;
material
.
map
=
texture
;
var
mesh
=
new
THREE
.
Mesh
(
planeGeometry
,
material
);
mesh
.
position
.
set
(
x
,
y
,
z
);
scene
.
add
(
mesh
);
}
//endregion
//region 矩形区域
/** */
function
addPlane
(
x
,
z
,
width
,
length
,
scene
)
{
var
lineWidth
=
8
var
geometry
=
new
THREE
.
PlaneGeometry
(
lineWidth
,
length
);
...
...
video/
movie
.mp4
→
video/
video
.mp4
浏览文件 @
397a3932
文件已移动
video/videoPlane.mp4
0 → 100644
浏览文件 @
397a3932
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录