Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
5a3dd1fa
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,发现更多精彩内容 >>
提交
5a3dd1fa
编写于
12月 13, 2016
作者:
S
sunag
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x to z
上级
5500d56a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
26 deletion
+26
-26
examples/js/loaders/sea3d/SEA3DLegacy.js
examples/js/loaders/sea3d/SEA3DLegacy.js
+26
-26
未找到文件。
examples/js/loaders/sea3d/SEA3DLegacy.js
浏览文件 @
5a3dd1fa
...
...
@@ -41,11 +41,11 @@ THREE.SEA3D.prototype.isLegacy = function ( sea ) {
};
THREE
.
SEA3D
.
prototype
.
flip
X
Vec3
=
function
(
v
)
{
THREE
.
SEA3D
.
prototype
.
flipVec3
=
function
(
v
)
{
if
(
!
v
)
return
;
var
i
=
0
;
// z
var
i
=
2
;
while
(
i
<
v
.
length
)
{
...
...
@@ -133,7 +133,7 @@ THREE.SEA3D.prototype.compressJoints = function ( sea ) {
};
THREE
.
SEA3D
.
prototype
.
flip
YZIndex
=
function
(
v
)
{
THREE
.
SEA3D
.
prototype
.
flip
Indexes
=
function
(
v
)
{
var
i
=
1
;
// y >-< z
...
...
@@ -151,17 +151,17 @@ THREE.SEA3D.prototype.flipYZIndex = function ( v ) {
};
THREE
.
SEA3D
.
prototype
.
flip
MatrixBone
=
function
()
{
THREE
.
SEA3D
.
prototype
.
flip
BoneMatrix
=
function
()
{
var
zero
=
new
THREE
.
Vector3
();
return
function
(
mtx
)
{
var
pos
=
THREE
.
SEA3D
.
VECBUF
.
setFromMatrixPosition
(
mtx
);
pos
.
x
=
-
pos
.
x
;
pos
.
z
=
-
pos
.
z
;
mtx
.
setPosition
(
zero
);
mtx
.
multiplyMatrices
(
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
X
(
THREE
.
Math
.
degToRad
(
180
)
),
mtx
);
mtx
.
multiplyMatrices
(
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
Z
(
THREE
.
Math
.
degToRad
(
180
)
),
mtx
);
mtx
.
setPosition
(
pos
);
return
mtx
;
...
...
@@ -170,7 +170,7 @@ THREE.SEA3D.prototype.flipMatrixBone = function () {
}();
THREE
.
SEA3D
.
prototype
.
flip
MatrixScale
=
function
()
{
THREE
.
SEA3D
.
prototype
.
flip
ScaleMatrix
=
function
()
{
var
pos
=
new
THREE
.
Vector3
();
var
qua
=
new
THREE
.
Quaternion
();
...
...
@@ -182,13 +182,13 @@ THREE.SEA3D.prototype.flipMatrixScale = function () {
local
.
decompose
(
pos
,
qua
,
slc
);
slc
.
x
=
-
slc
.
x
;
slc
.
z
=
-
slc
.
z
;
local
.
compose
(
pos
,
qua
,
slc
);
if
(
rotate
)
{
local
.
multiplyMatrices
(
local
,
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
X
(
THREE
.
Math
.
degToRad
(
180
)
)
);
local
.
multiplyMatrices
(
local
,
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
Z
(
THREE
.
Math
.
degToRad
(
180
)
)
);
}
...
...
@@ -196,7 +196,7 @@ THREE.SEA3D.prototype.flipMatrixScale = function () {
parent
=
parent
.
clone
();
this
.
flip
MatrixScale
(
parent
,
parentRotate
);
this
.
flip
ScaleMatrix
(
parent
,
parentRotate
);
local
.
multiplyMatrices
(
parent
.
getInverse
(
parent
),
local
);
...
...
@@ -265,17 +265,17 @@ THREE.SEA3D.prototype.flipDefaultAnimation = function () {
if
(
relative
)
{
buf1
.
identity
();
parent
=
this
.
flip
MatrixScale
(
buf2
.
copy
(
obj3d
.
matrixWorld
)
);
parent
=
this
.
flip
ScaleMatrix
(
buf2
.
copy
(
obj3d
.
matrixWorld
)
);
}
else
{
if
(
obj3d
.
parent
)
{
parent
=
this
.
flip
MatrixScale
(
buf2
.
copy
(
obj3d
.
parent
.
matrixWorld
)
);
parent
=
this
.
flip
ScaleMatrix
(
buf2
.
copy
(
obj3d
.
parent
.
matrixWorld
)
);
}
this
.
flip
MatrixScale
(
buf1
.
copy
(
obj3d
.
matrix
),
false
,
parent
);
this
.
flip
ScaleMatrix
(
buf1
.
copy
(
obj3d
.
matrix
),
false
,
parent
);
}
...
...
@@ -333,7 +333,7 @@ THREE.SEA3D.prototype.flipDefaultAnimation = function () {
buf1
.
compose
(
pos
,
qua
,
slc
);
this
.
flip
MatrixScale
(
buf1
,
false
,
buf2
);
this
.
flip
ScaleMatrix
(
buf1
,
false
,
buf2
);
buf1
.
decompose
(
to_pos
,
to_qua
,
to_slc
);
...
...
@@ -449,7 +449,7 @@ THREE.SEA3D.prototype.updateTransform = function () {
if
(
sea
.
transform
)
buf1
.
elements
.
set
(
sea
.
transform
);
else
buf1
.
makeTranslation
(
sea
.
position
.
x
,
sea
.
position
.
y
,
sea
.
position
.
z
);
this
.
flip
MatrixScale
(
this
.
flip
ScaleMatrix
(
buf1
,
false
,
obj3d
.
parent
?
obj3d
.
parent
.
matrixWorld
:
identity
,
obj3d
.
parent
instanceof
THREE
.
Bone
...
...
@@ -502,7 +502,7 @@ THREE.SEA3D.prototype.readSkeleton = function () {
// convert to three.js order
if
(
isLegacy
)
this
.
flip
MatrixBone
(
mtx_local
);
if
(
isLegacy
)
this
.
flip
BoneMatrix
(
mtx_local
);
if
(
bone
.
parentIndex
>
-
1
)
{
...
...
@@ -513,7 +513,7 @@ THREE.SEA3D.prototype.readSkeleton = function () {
// convert parent to three.js order
if
(
isLegacy
)
this
.
flip
MatrixBone
(
mtx_parent
);
if
(
isLegacy
)
this
.
flip
BoneMatrix
(
mtx_parent
);
// to local
...
...
@@ -603,11 +603,11 @@ THREE.SEA3D.prototype.readSkeletonAnimationLegacy = function () {
// convert to three.js matrix
this
.
flip
MatrixBone
(
mtx_global
);
this
.
flip
BoneMatrix
(
mtx_global
);
// flip parent inverse
this
.
flip
MatrixBone
(
mtx_parent
);
this
.
flip
BoneMatrix
(
mtx_parent
);
// to local
...
...
@@ -617,7 +617,7 @@ THREE.SEA3D.prototype.readSkeletonAnimationLegacy = function () {
}
else
{
this
.
flip
MatrixBone
(
mtx_local
);
this
.
flip
BoneMatrix
(
mtx_local
);
}
...
...
@@ -658,8 +658,8 @@ THREE.SEA3D.prototype.readVertexAnimation = function ( sea ) {
var
frame
=
sea
.
frame
[
i
];
this
.
flip
X
Vec3
(
frame
.
vertex
);
this
.
flip
X
Vec3
(
frame
.
normal
);
this
.
flipVec3
(
frame
.
vertex
);
this
.
flipVec3
(
frame
.
normal
);
}
...
...
@@ -673,10 +673,10 @@ THREE.SEA3D.prototype.readGeometryBuffer = function ( sea ) {
if
(
this
.
isLegacy
(
sea
)
)
{
this
.
flip
XVec3
(
sea
.
vertex
);
this
.
flip
XVec3
(
sea
.
normal
);
this
.
flip
Vec3
(
sea
.
vertex
,
true
);
this
.
flip
Vec3
(
sea
.
normal
,
true
);
this
.
flip
YZIndex
(
sea
.
indexes
);
this
.
flip
Indexes
(
sea
.
indexes
);
if
(
sea
.
jointPerVertex
>
4
)
this
.
compressJoints
(
sea
);
else
if
(
sea
.
jointPerVertex
<
4
)
this
.
expandJoints
(
sea
);
...
...
@@ -691,7 +691,7 @@ THREE.SEA3D.prototype.readLines = function ( sea ) {
if
(
this
.
isLegacy
(
sea
)
)
{
this
.
flip
X
Vec3
(
sea
.
vertex
);
this
.
flipVec3
(
sea
.
vertex
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录