提交 1b1fb7af 编写于 作者: M Mr.doob

* Code clean up (yuicompressor doesn't throw a single warning :D) and some reformating

* Minor fixes (Geometry normal calculation)
* Isolated Matrix3 code into `Matrix3.js`
* README and TODO updated
上级 79ab4bf2
.project
.pydevproject
......@@ -94,6 +94,7 @@ For creating a customised version of the library, including the source files in
<script type="text/javascript" src="js/three/core/Vector3.js"></script>
<script type="text/javascript" src="js/three/core/Vector4.js"></script>
<script type="text/javascript" src="js/three/core/Rectangle.js"></script>
<script type="text/javascript" src="js/three/core/Matrix3.js"></script>
<script type="text/javascript" src="js/three/core/Matrix4.js"></script>
<script type="text/javascript" src="js/three/core/Vertex.js"></script>
<script type="text/javascript" src="js/three/core/Face3.js"></script>
......@@ -110,15 +111,16 @@ For creating a customised version of the library, including the source files in
<script type="text/javascript" src="js/three/objects/Line.js"></script>
<script type="text/javascript" src="js/three/objects/Mesh.js"></script>
<script type="text/javascript" src="js/three/materials/LineColorMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshBitmapUVMappingMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshPhongMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshBitmapMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshColorFillMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshColorStrokeMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshFaceColorFillMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshFaceColorStrokeMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/MeshFaceMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/ParticleBitmapMaterial.js"></script>
<script type="text/javascript" src="js/three/materials/ParticleCircleMaterial.js"></script>
<script type="text/javascript" src="js/three/scenes/Scene.js"></script>
<script type="text/javascript" src="js/three/renderers/Projector.js"></script>
<script type="text/javascript" src="js/three/renderers/DOMRenderer.js"></script>
<script type="text/javascript" src="js/three/renderers/CanvasRenderer.js"></script>
<script type="text/javascript" src="js/three/renderers/SVGRenderer.js"></script>
<script type="text/javascript" src="js/three/renderers/WebGLRenderer.js"></script>
......@@ -132,11 +134,20 @@ For creating a customised version of the library, including the source files in
Thanks to the power of the internets (and github <3) these people have kindly helped out with the project.
[philogb](http://github.com/philogb), [supereggbert](http://github.com/supereggbert), [kikko](http://github.com/kikko), [kile](http://kile.stravaganza.org/), ...
([alteredq](http://github.com/alteredq)), [philogb](http://github.com/philogb), [supereggbert](http://github.com/supereggbert), [kikko](http://github.com/kikko), [kile](http://kile.stravaganza.org/), ...
### Change Log ###
2010 10 28 - **r25** (54.480 kb)
* `WebGLRenderer` now up to date with other renderers! ([alteredq](http://github.com/alteredq))
* .obj to .js python converter ([alteredq](http://github.com/alteredq))
* Blender 2.54 exporter
* Added `MeshFaceMaterial` (multipass per face)
* Reworked `CanvasRenderer` and `SVGRenderer` material handling
2010 10 06 - **r18** (44.420 kb)
* Added `PointLight`
......
......@@ -6,15 +6,9 @@ Examples
* DOMRenderer example
Materials
* MeshFaceMaterial? (Renderer would use face materials instead, MeshFaceColorFillFaceMaterial/MeshFaceColorStrokeMaterial wouldn't be needed?)
* MeshBitmapSphereMappingMaterial. http://en.wikipedia.org/wiki/Sphere_mapping
* MeshBitmapCubeMappingMaterial. http://en.wikipedia.org/wiki/Cube_mapping
* MeshBitmapMaterial? (Merge all MeshBitmap*Materials and have a mode parameter like... MeshBitmapMaterial.UV_MAPPING)
* MeshShaderMaterial for WebGLRenderer
* Add MeshBitmapUVMappingMaterial to WebGLRenderer
Renderers
* Add PointLight to WebGLRenderer
* WebGLRenderer support MeshBitmapUVMappingMaterial (look at alteredq branch)
* Double check DirectionalLight WebGLRenderer code (doesn't seem correct)
* FrustrumClipping near to Renderer (CanvasRenderer and SVGRenderer)
此差异已折叠。
此差异已折叠。
......@@ -23,6 +23,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -22,6 +22,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -49,6 +49,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -52,6 +52,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -52,6 +52,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -52,6 +52,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -21,6 +21,7 @@
<script type="text/javascript" src="../src/core/Vector3.js"></script>
<script type="text/javascript" src="../src/core/Vector4.js"></script>
<script type="text/javascript" src="../src/core/Rectangle.js"></script>
<script type="text/javascript" src="../src/core/Matrix3.js"></script>
<script type="text/javascript" src="../src/core/Matrix4.js"></script>
<script type="text/javascript" src="../src/core/Vertex.js"></script>
<script type="text/javascript" src="../src/core/Face3.js"></script>
......
......@@ -10,8 +10,8 @@ THREE.Face3 = function ( a, b, c, normal, material ) {
this.centroid = new THREE.Vector3();
this.normal = normal instanceof THREE.Vector3 ? normal : new THREE.Vector3();
this.vertexNormals = normal instanceof Array ? normal : [];
this.vertexNormals = normal instanceof Array ? normal : [];
this.material = material instanceof Array ? material : [ material ];
};
......
......@@ -11,7 +11,7 @@ THREE.Face4 = function ( a, b, c, d, normal, material ) {
this.centroid = new THREE.Vector3();
this.normal = normal instanceof THREE.Vector3 ? normal : new THREE.Vector3();
this.vertexNormals = normal instanceof Array ? normal : [];
this.vertexNormals = normal instanceof Array ? normal : [];
this.material = material instanceof Array ? material : [ material ];
......
......@@ -64,7 +64,7 @@ THREE.Geometry.prototype = {
for ( n = 0, nl = face.normal.length; n < nl; n++ ) {
cd.addSelf( face.vertexNormals[n] );
cb.addSelf( face.vertexNormals[n] );
}
......
THREE.Matrix3 = function () {
this.m = [];
};
THREE.Matrix3.prototype = {
transpose: function () {
var tmp;
tmp = this.m[1]; this.m[1] = this.m[3]; this.m[3] = tmp;
tmp = this.m[2]; this.m[2] = this.m[6]; this.m[6] = tmp;
tmp = this.m[5]; this.m[5] = this.m[7]; this.m[7] = tmp;
return this;
}
}
......@@ -55,7 +55,8 @@ THREE.Matrix4.prototype = {
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;
this.n41 = 0; this.n42 = 0; this.n43 = 0; this.
n44 = 1;
},
transform: function ( v ) {
......@@ -362,42 +363,36 @@ THREE.Matrix4.makeInvert = function ( m1 ) {
};
THREE.Matrix4.makeInvert3x3 = function ( m1 ) {
// input: THREE.Matrix4
// output: THREE.Matrix3
// ( based on http://code.google.com/p/webgl-mjs/ )
var m2 = new THREE.Matrix3();
var m = m1.flatten();
var a11 = m[10]*m[5]-m[6]*m[9],
a21 = -m[10]*m[1]+m[2]*m[9],
a31 = m[6]*m[1]-m[2]*m[5],
a12 = -m[10]*m[4]+m[6]*m[8],
a22 = m[10]*m[0]-m[2]*m[8],
a32 = -m[6]*m[0]+m[2]*m[4],
a13 = m[9]*m[4]-m[5]*m[8],
a23 = -m[9]*m[0]+m[1]*m[8],
a33 = m[5]*m[0]-m[1]*m[4];
var det = m[0]*(a11) + m[1]*(a12) + m[2]*(a13);
if (det == 0) // no inverse
throw "matrix not invertible";
var idet = 1.0 / det;
m2.m[0] = idet*a11;
m2.m[1] = idet*a21;
m2.m[2] = idet*a31;
m2.m[3] = idet*a12;
m2.m[4] = idet*a22;
m2.m[5] = idet*a32;
m2.m[6] = idet*a13;
m2.m[7] = idet*a23;
m2.m[8] = idet*a33;
return m2;
// input: THREE.Matrix4, output: THREE.Matrix3
// ( based on http://code.google.com/p/webgl-mjs/ )
var m = m1.flatten(),
m2 = new THREE.Matrix3(),
a11 = m[ 10 ] * m[ 5 ] - m[ 6 ] * m[ 9 ],
a21 = - m[ 10 ] * m[ 1 ] + m[ 2 ] * m[ 9 ],
a31 = m[ 6 ] * m[ 1 ] - m[ 2 ] * m[ 5 ],
a12 = - m[ 10 ] * m[ 4 ] + m[ 6 ] * m[ 8 ],
a22 = m[ 10 ] * m[ 0 ] - m[ 2 ] * m[ 8 ],
a32 = - m[ 6 ] * m[ 0 ] + m[ 2 ] * m[ 4 ],
a13 = m[ 9 ] * m[ 4 ] - m[ 5 ] * m[ 8 ],
a23 = - m[ 9 ] * m[ 0 ] + m[ 1 ] * m[ 8 ],
a33 = m[ 5 ] * m[ 0 ] - m[ 1 ] * m[ 4 ],
det = m[ 0 ] * ( a11 ) + m[ 1 ] * ( a12 ) + m[ 2 ] * ( a13 ),
idet;
// no inverse
if (det == 0) throw "matrix not invertible";
idet = 1.0 / det;
m2.m[ 0 ] = idet * a11; m2.m[ 1 ] = idet * a21; m2.m[ 2 ] = idet * a31;
m2.m[ 3 ] = idet * a12; m2.m[ 4 ] = idet * a22; m2.m[ 5 ] = idet * a32;
m2.m[ 6 ] = idet * a13; m2.m[ 7 ] = idet * a23; m2.m[ 8 ] = idet * a33;
return m2;
}
THREE.Matrix4.makeFrustum = function( left, right, bottom, top, near, far ) {
......@@ -454,25 +449,3 @@ THREE.Matrix4.makeOrtho = function( left, right, top, bottom, near, far ) {
return m;
};
THREE.Matrix3 = function () {
this.m = [];
};
THREE.Matrix3.prototype = {
transpose: function () {
var tmp;
tmp = this.m[1]; this.m[1] = this.m[3]; this.m[3] = tmp;
tmp = this.m[2]; this.m[2] = this.m[6]; this.m[6] = tmp;
tmp = this.m[5]; this.m[5] = this.m[7]; this.m[7] = tmp;
return this;
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ THREE.Vector4.prototype = {
this.y = y;
this.z = z;
this.w = w;
return this;
},
......
......@@ -14,81 +14,85 @@ THREE.Mesh = function ( geometry, material, normUVs ) {
this.overdraw = false;
this.materialFaceGroup = {};
this.sortFacesByMaterial();
if( normUVs ) this.normalizeUVs();
this.materialFaceGroup = {};
this.sortFacesByMaterial();
if( normUVs ) this.normalizeUVs();
this.geometry.computeBoundingBox();
this.geometry.computeBoundingBox();
};
THREE.Mesh.prototype = new THREE.Object3D();
THREE.Mesh.prototype.constructor = THREE.Mesh;
THREE.Mesh.prototype.sortFacesByMaterial = function () {
// TODO
// Should optimize by grouping faces with ColorFill / ColorStroke materials
// which could then use vertex color attributes instead of each being
// in its separate VBO
function materialHash( material ) {
var i, l, hash_array = [];
for ( i = 0, l = material.length; i<l; i++ ) {
if ( material[i] == undefined ) {
hash_array.push( "undefined" );
} else {
hash_array.push( material[i].toString() );
}
}
return hash_array.join("_");
}
var i, f, fl, face, material;
for ( f = 0, fl = this.geometry.faces.length; f < fl; f++ ) {
face = this.geometry.faces[ f ];
material = face.material;
hash = materialHash( material);
if ( this.materialFaceGroup[ hash ] == undefined ) {
this.materialFaceGroup[ hash ] = { 'faces': [], 'material': material };
}
this.materialFaceGroup[ hash ].faces.push( f );
}
// TODO
// Should optimize by grouping faces with ColorFill / ColorStroke materials
// which could then use vertex color attributes instead of each being
// in its separate VBO
var i, l, f, fl, face, material, hash_array;
function materialHash( material ) {
hash_array = [];
for ( i = 0, l = material.length; i < l; i++ ) {
if ( material[ i ] == undefined ) {
hash_array.push( "undefined" );
} else {
hash_array.push( material[ i ].toString() );
}
}
return hash_array.join("_");
}
for ( f = 0, fl = this.geometry.faces.length; f < fl; f++ ) {
face = this.geometry.faces[ f ];
material = face.material;
hash = materialHash( material);
if ( this.materialFaceGroup[ hash ] == undefined ) {
this.materialFaceGroup[ hash ] = { 'faces': [], 'material': material };
}
this.materialFaceGroup[ hash ].faces.push( f );
}
}
THREE.Mesh.prototype.normalizeUVs = function () {
var i,j;
for ( i = 0, l = this.geometry.uvs.length; i < l; i++ ) {
var uvs = this.geometry.uvs[i];
for ( j = 0, jl = uvs.length; j < jl; j++ ) {
// texture repeat
// (WebGL does this by default but canvas renderer needs to do it explicitly)
if( uvs[j].u != 1.0 ) uvs[j].u = uvs[j].u - Math.floor(uvs[j].u);
if( uvs[j].v != 1.0 ) uvs[j].v = uvs[j].v - Math.floor(uvs[j].v);
}
}
var i, il, j, jl, uvs;
for ( i = 0, il = this.geometry.uvs.length; i < il; i++ ) {
uvs = this.geometry.uvs[ i ];
for ( j = 0, jl = uvs.length; j < jl; j++ ) {
// texture repeat
// (WebGL does this by default but canvas renderer needs to do it explicitly)
if( uvs[ j ].u != 1.0 ) uvs[ j ].u = uvs[ j ].u - Math.floor( uvs[ j ].u );
if( uvs[ j ].v != 1.0 ) uvs[ j ].v = uvs[ j ].v - Math.floor( uvs[ j ].v );
}
}
}
......@@ -8,8 +8,8 @@ THREE.CanvasRenderer = function () {
_projector = new THREE.Projector(),
_canvas = document.createElement( 'canvas' ),
_canvasWidth, _canvasHeight, _canvasWidthHalf, _canvasHeightHalf,
_context = _canvas.getContext( '2d' ),
_width, _height, _widthHalf, _heightHalf,
_clipRect = new THREE.Rectangle(),
_clearRect = new THREE.Rectangle(),
_bboxRect = new THREE.Rectangle(),
......@@ -30,13 +30,13 @@ THREE.CanvasRenderer = function () {
this.setSize = function ( width, height ) {
_width = width; _height = height;
_widthHalf = _width / 2; _heightHalf = _height / 2;
_canvasWidth = width; _canvasHeight = height;
_canvasWidthHalf = _canvasWidth / 2; _canvasHeightHalf = _canvasHeight / 2;
_canvas.width = _width;
_canvas.height = _height;
_canvas.width = _canvasWidth;
_canvas.height = _canvasHeight;
_clipRect.set( - _widthHalf, - _heightHalf, _widthHalf, _heightHalf );
_clipRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf );
};
......@@ -47,7 +47,7 @@ THREE.CanvasRenderer = function () {
_clearRect.inflate( 1 );
_clearRect.minSelf( _clipRect );
_context.setTransform( 1, 0, 0, - 1, _widthHalf, _heightHalf );
_context.setTransform( 1, 0, 0, - 1, _canvasWidthHalf, _canvasHeightHalf );
_context.clearRect( _clearRect.getX(), _clearRect.getY(), _clearRect.getWidth(), _clearRect.getHeight() );
_clearRect.empty();
......@@ -58,9 +58,7 @@ THREE.CanvasRenderer = function () {
this.render = function ( scene, camera ) {
var e, el, element, m, ml, fm, fml, material,
v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y, v5x, v5y, v6x, v6y,
width, height, scaleX, scaleY, offsetX, offsetY,
bitmap, bitmapWidth, bitmapHeight;
v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y, v5x, v5y, v6x, v6y;
if ( this.autoClear ) {
......@@ -70,7 +68,7 @@ THREE.CanvasRenderer = function () {
_renderList = _projector.projectScene( scene, camera );
_context.setTransform( 1, 0, 0, - 1, _widthHalf, _heightHalf );
_context.setTransform( 1, 0, 0, - 1, _canvasWidthHalf, _canvasHeightHalf );
/* DEBUG
_context.fillStyle = 'rgba(0, 255, 255, 0.5)';
......@@ -93,7 +91,7 @@ THREE.CanvasRenderer = function () {
if ( element instanceof THREE.RenderableParticle ) {
v1x = element.x * _widthHalf; v1y = element.y * _heightHalf;
v1x = element.x * _canvasWidthHalf; v1y = element.y * _canvasHeightHalf;
for ( m = 0, ml = element.material.length; m < ml; m++ ) {
......@@ -105,8 +103,8 @@ THREE.CanvasRenderer = function () {
} else if ( element instanceof THREE.RenderableLine ) {
v1x = element.v1.x * _widthHalf; v1y = element.v1.y * _heightHalf;
v2x = element.v2.x * _widthHalf; v2y = element.v2.y * _heightHalf;
v1x = element.v1.x * _canvasWidthHalf; v1y = element.v1.y * _canvasHeightHalf;
v2x = element.v2.x * _canvasWidthHalf; v2y = element.v2.y * _canvasHeightHalf;
_bboxRect.addPoint( v1x, v1y );
_bboxRect.addPoint( v2x, v2y );
......@@ -132,9 +130,9 @@ THREE.CanvasRenderer = function () {
} else if ( element instanceof THREE.RenderableFace3 ) {
element.v1.x *= _widthHalf; element.v1.y *= _heightHalf;
element.v2.x *= _widthHalf; element.v2.y *= _heightHalf;
element.v3.x *= _widthHalf; element.v3.y *= _heightHalf;
element.v1.x *= _canvasWidthHalf; element.v1.y *= _canvasHeightHalf;
element.v2.x *= _canvasWidthHalf; element.v2.y *= _canvasHeightHalf;
element.v3.x *= _canvasWidthHalf; element.v3.y *= _canvasHeightHalf;
if ( element.overdraw ) {
......@@ -186,10 +184,10 @@ THREE.CanvasRenderer = function () {
} else if ( element instanceof THREE.RenderableFace4 ) {
element.v1.x *= _widthHalf; element.v1.y *= _heightHalf;
element.v2.x *= _widthHalf; element.v2.y *= _heightHalf;
element.v3.x *= _widthHalf; element.v3.y *= _heightHalf;
element.v4.x *= _widthHalf; element.v4.y *= _heightHalf;
element.v1.x *= _canvasWidthHalf; element.v1.y *= _canvasHeightHalf;
element.v2.x *= _canvasWidthHalf; element.v2.y *= _canvasHeightHalf;
element.v3.x *= _canvasWidthHalf; element.v3.y *= _canvasHeightHalf;
element.v4.x *= _canvasWidthHalf; element.v4.y *= _canvasHeightHalf;
v5.copy( element.v2 ); v6.copy( element.v4 );
......@@ -366,6 +364,9 @@ THREE.CanvasRenderer = function () {
}
function renderParticle ( v1x, v1y, element, material, scene ) {
var width, height, scaleX, scaleY, offsetX, offsetY,
bitmap, bitmapWidth, bitmapHeight;
if ( material instanceof THREE.ParticleCircleMaterial ) {
......@@ -384,8 +385,8 @@ THREE.CanvasRenderer = function () {
}
width = element.scale.x * _widthHalf;
height = element.scale.y * _heightHalf;
width = element.scale.x * _canvasWidthHalf;
height = element.scale.y * _canvasHeightHalf;
_bboxRect.set( v1x - width, v1y - height, v1x + width, v1y + height );
......@@ -415,8 +416,8 @@ THREE.CanvasRenderer = function () {
bitmapWidth = bitmap.width / 2;
bitmapHeight = bitmap.height / 2;
scaleX = element.scale.x * _widthHalf;
scaleY = element.scale.y * _heightHalf;
scaleX = element.scale.x * _canvasWidthHalf;
scaleY = element.scale.y * _canvasHeightHalf;
width = scaleX * bitmapWidth;
height = scaleY * bitmapHeight;
......@@ -493,6 +494,8 @@ THREE.CanvasRenderer = function () {
function renderFace3( v1x, v1y, v2x, v2y, v3x, v3y, element, material, scene ) {
var bitmap, bitmapWidth, bitmapHeight;
if ( material instanceof THREE.MeshColorFillMaterial ) {
if ( _enableLighting ) {
......@@ -593,6 +596,8 @@ THREE.CanvasRenderer = function () {
function renderFace4 ( v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y, v5x, v5y, v6x, v6y, element, material, scene ) {
var bitmap, bitmapWidth, bitmapHeight;
if ( material instanceof THREE.MeshColorFillMaterial ) {
if ( _enableLighting ) {
......
......@@ -62,8 +62,7 @@ THREE.SVGRenderer = function () {
this.render = function ( scene, camera ) {
var e, el, m, ml, fm, fml, element, material,
v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y,
size;
v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y;
if ( this.autoClear ) {
......@@ -101,11 +100,11 @@ THREE.SVGRenderer = function () {
}
} else if ( element instanceof THREE.RenderableLine ) {
}/* else if ( element instanceof THREE.RenderableLine ) {
} else if ( element instanceof THREE.RenderableFace3 ) {
}*/ else if ( element instanceof THREE.RenderableFace3 ) {
v1x = element.v1.x * _widthHalf; v1y = element.v1.y * -_heightHalf;
v2x = element.v2.x * _widthHalf; v2y = element.v2.y * -_heightHalf;
......@@ -318,11 +317,13 @@ THREE.SVGRenderer = function () {
}
/*
function renderLine ( ) {
}
*/
function renderFace3 ( v1x, v1y, v2x, v2y, v3x, v3y, element, material, scene ) {
......
此差异已折叠。
......@@ -12,6 +12,7 @@ files.append('core/Vector2.js')
files.append('core/Vector3.js')
files.append('core/Vector4.js')
files.append('core/Rectangle.js')
files.append('core/Matrix3.js')
files.append('core/Matrix4.js')
files.append('core/Vertex.js')
files.append('core/Face3.js')
......
......@@ -12,6 +12,7 @@ files.append('core/Vector2.js')
files.append('core/Vector3.js')
files.append('core/Vector4.js')
files.append('core/Rectangle.js')
files.append('core/Matrix3.js')
files.append('core/Matrix4.js')
files.append('core/Vertex.js')
files.append('core/Face3.js')
......
......@@ -12,6 +12,7 @@ files.append('core/Vector2.js')
files.append('core/Vector3.js')
files.append('core/Vector4.js')
files.append('core/Rectangle.js')
files.append('core/Matrix3.js')
files.append('core/Matrix4.js')
files.append('core/Vertex.js')
files.append('core/Face3.js')
......
......@@ -12,6 +12,7 @@ files.append('core/Vector2.js')
files.append('core/Vector3.js')
files.append('core/Vector4.js')
files.append('core/Rectangle.js')
files.append('core/Matrix3.js')
files.append('core/Matrix4.js')
files.append('core/Vertex.js')
files.append('core/Face3.js')
......
......@@ -12,6 +12,7 @@ files.append('core/Vector2.js')
files.append('core/Vector3.js')
files.append('core/Vector4.js')
files.append('core/Rectangle.js')
files.append('core/Matrix3.js')
files.append('core/Matrix4.js')
files.append('core/Vertex.js')
files.append('core/Face3.js')
......
......@@ -12,6 +12,7 @@ files.append('core/Vector2.js')
files.append('core/Vector3.js')
files.append('core/Vector4.js')
files.append('core/Rectangle.js')
files.append('core/Matrix3.js')
files.append('core/Matrix4.js')
files.append('core/Vertex.js')
files.append('core/Face3.js')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册