Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
e5e4ff79
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,发现更多精彩内容 >>
提交
e5e4ff79
编写于
4月 11, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed Vector3::setRotationFromMatrix
上级
bc520665
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
5 deletion
+29
-5
examples/webgl_sandbox.html
examples/webgl_sandbox.html
+9
-2
src/core/Matrix4.js
src/core/Matrix4.js
+15
-0
src/core/Vector3.js
src/core/Vector3.js
+3
-3
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+2
-0
未找到文件。
examples/webgl_sandbox.html
浏览文件 @
e5e4ff79
...
...
@@ -52,13 +52,13 @@
<script
type=
"text/javascript"
src=
"../src/core/UV.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Geometry.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Spline.js"
></script>
<script
type=
"text/javascript"
src=
"../src/animation/AnimationHandler.js"
></script>
<script
type=
"text/javascript"
src=
"../src/animation/Animation.js"
></script>
<script
type=
"text/javascript"
src=
"../src/core/Edge.js"
></script>
<script
type=
"text/javascript"
src=
"../src/cameras/Camera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/Light.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/AmbientLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/DirectionalLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/PointLight.js"
></script>
<script
type=
"text/javascript"
src=
"../src/lights/LensFlare.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Material.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/Mappings.js"
></script>
<script
type=
"text/javascript"
src=
"../src/materials/LineBasicMaterial.js"
></script>
...
...
@@ -84,6 +84,7 @@
<script
type=
"text/javascript"
src=
"../src/objects/Sound.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/LOD.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/ShadowVolume.js"
></script>
<script
type=
"text/javascript"
src=
"../src/objects/Sprite.js"
></script>
<script
type=
"text/javascript"
src=
"../src/scenes/Scene.js"
></script>
<script
type=
"text/javascript"
src=
"../src/scenes/Fog.js"
></script>
<script
type=
"text/javascript"
src=
"../src/scenes/FogExp2.js"
></script>
...
...
@@ -101,12 +102,15 @@
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableObject.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableParticle.js"
></script>
<script
type=
"text/javascript"
src=
"../src/renderers/renderables/RenderableLine.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/animation/AnimationHandler.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/animation/Animation.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/GeometryUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/ImageUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/SceneUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/ShaderUtils.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/QuakeCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/PathCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/cameras/FlyCamera.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Cube.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Cylinder.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/geometries/Icosahedron.js"
></script>
...
...
@@ -118,7 +122,10 @@
<script
type=
"text/javascript"
src=
"../src/extras/io/Loader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/io/JSONLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/io/BinaryLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/io/SceneLoader.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/objects/MarchingCubes.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/physics/Collisions.js"
></script>
<script
type=
"text/javascript"
src=
"../src/extras/physics/CollisionUtils.js"
></script>
<script
type=
"text/javascript"
src=
"js/RequestAnimationFrame.js"
></script>
<script
type=
"text/javascript"
src=
"js/Stats.js"
></script>
...
...
src/core/Matrix4.js
浏览文件 @
e5e4ff79
...
...
@@ -69,6 +69,21 @@ THREE.Matrix4.prototype = {
lookAt
:
function
(
eye
,
center
,
up
)
{
/*
var x = THREE.Matrix4.__v1, y = THREE.Matrix4.__v2, z = THREE.Matrix4.__v3;
z.sub( center, eye ).normalize();
x.cross( up, z ).normalize();
y.cross( z, x ).normalize();
this.n11 = x.x; this.n12 = x.y; this.n13 = x.z; this.n14 = - x.dot( eye );
this.n21 = y.x; this.n22 = y.y; this.n23 = y.z; this.n24 = - y.dot( eye );
this.n31 = z.x; this.n32 = z.y; this.n33 = z.z; this.n34 = - z.dot( eye );
this.n41 = 0; this.n42 = 0; this.n43 = 0; this.n44 = 1;
return this;
*/
var
x
=
THREE
.
Matrix4
.
__v1
,
y
=
THREE
.
Matrix4
.
__v2
,
z
=
THREE
.
Matrix4
.
__v3
;
z
.
sub
(
eye
,
center
).
normalize
();
...
...
src/core/Vector3.js
浏览文件 @
e5e4ff79
...
...
@@ -290,14 +290,14 @@ THREE.Vector3.prototype = {
setRotationFromMatrix
:
function
(
m
)
{
this
.
y
=
Math
.
asin
(
m
.
n13
);
var
cosY
=
Math
.
cos
(
this
.
y
);
this
.
y
=
Math
.
asin
(
m
.
n13
);
if
(
Math
.
abs
(
cosY
)
>
0.00001
)
{
this
.
x
=
Math
.
atan2
(
-
m
.
n23
/
cosY
,
m
.
n33
/
cosY
);
this
.
z
=
Math
.
atan2
(
-
m
.
n1
3
/
cosY
,
m
.
n11
/
cosY
);
this
.
z
=
Math
.
atan2
(
-
m
.
n1
2
/
cosY
,
m
.
n11
/
cosY
);
}
else
{
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
e5e4ff79
...
...
@@ -4538,6 +4538,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
else
{
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
texture
.
__webglTexture
);
// _gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image );
_gl
.
texSubImage2D
(
_gl
.
TEXTURE_2D
,
0
,
0
,
0
,
_gl
.
RGBA
,
_gl
.
UNSIGNED_BYTE
,
texture
.
image
);
}
...
...
@@ -4580,6 +4581,7 @@ THREE.WebGLRenderer = function ( parameters ) {
for
(
var
i
=
0
;
i
<
6
;
++
i
)
{
// _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, _gl.RGBA, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image[ i ] );
_gl
.
texSubImage2D
(
_gl
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
i
,
0
,
0
,
0
,
_gl
.
RGBA
,
_gl
.
UNSIGNED_BYTE
,
texture
.
image
[
i
]
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录