提交 74e70f13 编写于 作者: M Mr.doob

- Removed unneded updateMatrix in Camera

- Simplified lookAt in Matrix4
- Added cross() in Vector3
上级 368e6a19
......@@ -5,7 +5,9 @@ three.js
[![Flattr this](http://api.flattr.com/button/button-compact-static-100x17.png)](http://flattr.com/thing/287/three-js)
This project is work in progress. Before using it in a project be aware that the syntax may change from revision to revision without being backwards compatible. Currently there is no documentation, feel free to use the demos as a reference and/or read the source code. The engine can render using <canvas> and <svg> so far. WebGL renderer coming soon.
The aim of this project is to create a 3D engine with a very low level of abstraction (aka for dummies). Currently there is no documentation available but feel free to use the examples as a reference and/or read the source code. However, be aware that the syntax may change from revision to revision breaking compatibility.
The engine can render using <canvas> and <svg> by now and WebGL renderer will be available soon.
[More info...](http://mrdoob.com/blog/post/693)
......@@ -75,7 +77,7 @@ This code creates a camera, then creates a scene object, adds a bunch of random
</script>
If you are interested on messing with the actual library, instead of importing the three.js compressed file, you can include the original files in this order:
For creating a customised version of the library, including the source files in this order would be a good way to start:
<script type="text/javascript" src="js/three/Three.js"></script>
<script type="text/javascript" src="js/three/core/Color.js"></script>
......@@ -110,7 +112,7 @@ If you are interested on messing with the actual library, instead of importing t
### Change Log ###
2010 06 22 - **r10** (23.908 kb)
2010 06 22 - **r10** (23.959 kb)
* Changed Camera system. (Thx [Paul Brunt](http://github.com/supereggbert))
* Object3D.overdraw = true to enable CanvasRenderer screen space point expansion hack.
......
此差异已折叠。
......@@ -19,8 +19,6 @@ THREE.Camera = function ( fov, aspect, near, far ) {
};
this.updateMatrix();
this.toString = function () {
return 'THREE.Camera ( ' + this.position + ', ' + this.target.position + ' )';
......
......@@ -29,12 +29,10 @@ THREE.Matrix4 = function () {
z.sub( eye, center );
z.normalize();
x.copy( up );
x.crossSelf( z );
x.cross( up, z );
x.normalize();
y.copy( z );
y.crossSelf( x );
y.cross( z, x );
y.normalize();
y.negate();
......
......@@ -65,6 +65,14 @@ THREE.Vector3 = function ( x, y, z ) {
};
this.cross = function ( v1, v2 ) {
this.x = v1.y * v2.z - v1.z * v2.y;
this.y = v1.z * v2.x - v1.x * v2.z;
this.z = v1.x * v2.y - v1.y * v2.x;
};
this.crossSelf = function ( v ) {
var tx = this.x, ty = this.y, tz = this.z;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册