Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
45076157
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,发现更多精彩内容 >>
提交
45076157
编写于
3月 19, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed remaining Matrix4 .translate() and .rotateByAxis() dependencies. Fixes #3185.
上级
aeb11351
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
49 deletion
+29
-49
docs/api/math/Matrix4.html
docs/api/math/Matrix4.html
+0
-25
examples/js/effects/OculusRiftEffect.js
examples/js/effects/OculusRiftEffect.js
+6
-7
examples/js/loaders/ColladaLoader.js
examples/js/loaders/ColladaLoader.js
+22
-16
src/math/Matrix4.js
src/math/Matrix4.js
+1
-1
未找到文件。
docs/api/math/Matrix4.html
浏览文件 @
45076157
...
...
@@ -206,31 +206,6 @@
Copies the rotation component of the supplied matrix *m* into this matrix rotation component.
</div>
<h3>
.rotateByAxis( [page:Vector3 axis], [page:Float angle] ) [page:Matrix4]
</h3>
<div>
Rotates this matrix around the supplied *axis* by *angle*.
</div>
<h3>
.rotateX( [page:Float angle] ) [page:Matrix4]
</h3>
<div>
Rotates this matrix around the *x* axis by *angle*.
</div>
<h3>
.rotateY( [page:Float angle] ) [page:Matrix4]
</h3>
<div>
Rotates this matrix around the *y* axis by *angle*.
</div>
<h3>
.rotateZ( [page:Float angle] ) [page:Matrix4]
</h3>
<div>
Rotates this matrix around the *z* axis by *angle*.
</div>
<h3>
.translate( [page:Vector3 v] ) [page:Matrix4]
</h3>
<div>
Translates this matrix by vector *v*.
</div>
<h3>
.makeTranslation( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]
</h3>
<div>
Sets this matrix as translation transform.
...
...
examples/js/effects/OculusRiftEffect.js
浏览文件 @
45076157
...
...
@@ -19,7 +19,6 @@ THREE.OculusRiftEffect = function ( renderer ) {
var
_pCamera
=
new
THREE
.
PerspectiveCamera
();
_pCamera
.
matrixAutoUpdate
=
false
;
_pCamera
.
target
=
new
THREE
.
Vector3
();
var
_scene
=
new
THREE
.
Scene
();
...
...
@@ -27,6 +26,8 @@ THREE.OculusRiftEffect = function ( renderer ) {
_oCamera
.
position
.
z
=
1
;
_scene
.
add
(
_oCamera
);
var
_offset
=
new
THREE
.
Matrix4
();
// pre-render hooks
this
.
preLeftRender
=
function
()
{};
this
.
preRightRender
=
function
()
{};
...
...
@@ -99,9 +100,8 @@ THREE.OculusRiftEffect = function ( renderer ) {
// Render left
this
.
preLeftRender
();
var
offset
=
new
THREE
.
Vector3
(
-
this
.
separation
,
0
,
0
);
_pCamera
.
matrix
.
copy
(
camera
.
matrix
);
_pCamera
.
matrix
.
translate
(
offset
);
_offset
.
elements
[
12
]
=
-
this
.
separation
;
// set x offset
_pCamera
.
matrix
.
copy
(
camera
.
matrix
).
multiply
(
_offset
);
_pCamera
.
matrixWorldNeedsUpdate
=
true
;
renderer
.
setViewport
(
0
,
0
,
_width
,
_height
);
...
...
@@ -111,9 +111,8 @@ THREE.OculusRiftEffect = function ( renderer ) {
// Render right
this
.
preRightRender
();
offset
.
set
(
this
.
separation
,
0
,
0
);
_pCamera
.
matrix
.
copy
(
camera
.
matrix
);
_pCamera
.
matrix
.
translate
(
offset
);
_offset
.
elements
[
12
]
=
this
.
separation
;
// set x offset
_pCamera
.
matrix
.
copy
(
camera
.
matrix
).
multiply
(
_offset
);
_pCamera
.
matrixWorldNeedsUpdate
=
true
;
renderer
.
setViewport
(
_width
,
0
,
_width
,
_height
);
...
...
examples/js/loaders/ColladaLoader.js
浏览文件 @
45076157
...
...
@@ -1945,37 +1945,43 @@ THREE.ColladaLoader = function () {
};
Transform
.
prototype
.
apply
=
function
(
matrix
)
{
Transform
.
prototype
.
apply
=
function
()
{
switch
(
this
.
type
)
{
var
m1
=
new
THREE
.
Matrix4
();
case
'
matrix
'
:
return
function
(
matrix
)
{
matrix
.
multiply
(
this
.
obj
);
switch
(
this
.
type
)
{
break
;
case
'
matrix
'
:
case
'
translate
'
:
matrix
.
multiply
(
this
.
obj
);
matrix
.
translate
(
this
.
obj
)
;
break
;
break
;
case
'
translate
'
:
case
'
rotate
'
:
matrix
.
multiply
(
m1
.
makeTranslation
(
this
.
obj
.
x
,
this
.
obj
.
y
,
this
.
obj
.
z
)
);
matrix
.
rotateByAxis
(
this
.
obj
,
this
.
angle
)
;
break
;
break
;
case
'
rotate
'
:
case
'
scale
'
:
matrix
.
multiply
(
m1
.
makeRotationAxis
(
this
.
obj
,
this
.
angle
)
);
matrix
.
scale
(
this
.
obj
)
;
break
;
break
;
case
'
scale
'
:
}
matrix
.
scale
(
this
.
obj
);
};
break
;
}
};
}();
Transform
.
prototype
.
update
=
function
(
data
,
member
)
{
...
...
src/math/Matrix4.js
浏览文件 @
45076157
...
...
@@ -597,7 +597,7 @@ THREE.Matrix4.prototype = {
},
extractRotation
:
function
()
{
extractRotation
:
function
()
{
var
v1
=
new
THREE
.
Vector3
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录