Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
674071e7
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,发现更多精彩内容 >>
提交
674071e7
编写于
11月 20, 2016
作者:
S
sunag
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SEA3D + Open3DGC
上级
9a9c61b4
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
3072 addition
and
1 deletion
+3072
-1
examples/js/libs/o3dgc.js
examples/js/libs/o3dgc.js
+2913
-0
examples/js/loaders/sea3d/SEA3DGeometryGC.js
examples/js/loaders/sea3d/SEA3DGeometryGC.js
+154
-0
examples/models/sea3d/robot.o3dgc.tjs.sea
examples/models/sea3d/robot.o3dgc.tjs.sea
+0
-0
examples/webgl_loader_sea3d_hierarchy.html
examples/webgl_loader_sea3d_hierarchy.html
+5
-1
未找到文件。
examples/js/libs/o3dgc.js
0 → 100644
浏览文件 @
674071e7
此差异已折叠。
点击以展开。
examples/js/loaders/sea3d/SEA3DGeometryGC.js
0 → 100644
浏览文件 @
674071e7
/**
* SEA3D - o3dgc
* @author Sunag / http://www.sunag.com.br/
*/
'
use strict
'
;
//
// Lossy Compression
//
SEA3D
.
GeometryGC
=
function
(
name
,
data
,
sea3d
)
{
this
.
name
=
name
;
this
.
data
=
data
;
this
.
sea3d
=
sea3d
;
var
i
;
var
attrib
=
data
.
readUShort
();
var
uvIDs
=
[],
jointID
,
weightID
;
this
.
isBig
=
(
attrib
&
1
)
!=
0
;
data
.
readVInt
=
this
.
isBig
?
data
.
readUInt
:
data
.
readUShort
;
// Geometry Flags
// ..
// 1 isBig
// 2 groups
// 4 uv
// 8 tangent
// 16 colors
// 32 joints
// 64 morph
// 128 vertex-animation
// ..
if
(
attrib
&
2
)
{
this
.
groups
=
[];
var
numGroups
=
data
.
readUByte
(),
groupOffset
=
0
;
for
(
i
=
0
;
i
<
numGroups
;
i
++
)
{
var
groupLength
=
data
.
readVInt
()
*
3
;
this
.
groups
.
push
(
{
start
:
groupOffset
,
count
:
groupLength
,
}
);
groupOffset
+=
groupLength
;
}
}
else
{
this
.
groups
=
[];
}
if
(
attrib
&
4
)
{
this
.
uv
=
[];
var
uvCount
=
data
.
readUByte
();
for
(
i
=
0
;
i
<
uvCount
;
i
++
)
{
uvIDs
[
i
]
=
data
.
readUByte
();
}
}
if
(
attrib
&
32
)
{
jointID
=
data
.
readUByte
();
weightID
=
data
.
readUByte
();
}
var
size
=
data
.
readUInt
();
var
bytes
=
data
.
concat
(
data
.
position
,
size
);
var
bstream
=
new
o3dgc
.
BinaryStream
(
bytes
.
buffer
);
var
decoder
=
new
o3dgc
.
SC3DMCDecoder
();
var
ifs
=
new
o3dgc
.
IndexedFaceSet
();
decoder
.
DecodeHeader
(
ifs
,
bstream
);
var
numIndexes
=
ifs
.
GetNCoordIndex
();
var
numVertex
=
ifs
.
GetNCoord
();
if
(
!
this
.
groups
.
length
)
this
.
groups
.
push
(
{
start
:
0
,
count
:
numIndexes
*
3
}
);
this
.
indexes
=
this
.
isBig
?
new
Uint32Array
(
numIndexes
*
3
)
:
new
Uint16Array
(
numIndexes
*
3
);
this
.
vertex
=
new
Float32Array
(
numVertex
*
3
);
ifs
.
SetCoordIndex
(
this
.
indexes
);
ifs
.
SetCoord
(
this
.
vertex
);
if
(
ifs
.
GetNNormal
()
>
0
)
{
this
.
normal
=
new
Float32Array
(
numVertex
*
3
);
ifs
.
SetNormal
(
this
.
normal
);
}
for
(
i
=
0
;
i
<
uvIDs
.
length
;
i
++
)
{
this
.
uv
[
i
]
=
new
Float32Array
(
numVertex
*
2
);
ifs
.
SetFloatAttribute
(
uvIDs
[
i
],
this
.
uv
[
i
]
);
}
if
(
jointID
!==
undefined
)
{
this
.
jointPerVertex
=
ifs
.
GetIntAttributeDim
(
jointID
);
this
.
joint
=
new
Uint16Array
(
numVertex
*
this
.
jointPerVertex
);
this
.
weight
=
new
Float32Array
(
numVertex
*
this
.
jointPerVertex
);
ifs
.
SetIntAttribute
(
jointID
,
this
.
joint
);
ifs
.
SetFloatAttribute
(
weightID
,
this
.
weight
);
}
// decode mesh
decoder
.
DecodePlayload
(
ifs
,
bstream
);
};
SEA3D
.
GeometryGC
.
prototype
.
type
=
"
s3D
"
;
//
// Extension
//
THREE
.
SEA3D
.
EXTENSIONS_LOADER
.
push
(
{
setTypeRead
:
function
()
{
this
.
file
.
addClass
(
SEA3D
.
GeometryGC
,
true
);
this
.
file
.
typeRead
[
SEA3D
.
GeometryGC
.
prototype
.
type
]
=
this
.
readGeometryBuffer
;
}
}
);
examples/models/sea3d/robot.o3dgc.tjs.sea
0 → 100644
浏览文件 @
674071e7
文件已添加
examples/webgl_loader_sea3d_hierarchy.html
浏览文件 @
674071e7
...
...
@@ -46,6 +46,9 @@
<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/libs/o3dgc.js"
></script>
<script
src=
"js/loaders/sea3d/SEA3DGeometryGC.js"
></script>
<script
src=
"js/Detector.js"
></script>
<script
src=
"js/libs/stats.min.js"
></script>
...
...
@@ -99,7 +102,8 @@
};
loader
.
load
(
'
./models/sea3d/robot.tjs.sea
'
);
// Open3DGC - Export by SEA3D Studio
loader
.
load
(
'
./models/sea3d/robot.o3dgc.tjs.sea
'
);
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录