|
@@ -14,6 +14,7 @@ THREE.CanvasRenderer = function () {
|
|
_vector2 = new THREE.Vector2();
|
|
_vector2 = new THREE.Vector2();
|
|
|
|
|
|
this.domElement = _viewport;
|
|
this.domElement = _viewport;
|
|
|
|
+ this.autoClear = true;
|
|
|
|
|
|
this.setSize = function ( width, height ) {
|
|
this.setSize = function ( width, height ) {
|
|
|
|
|
|
@@ -26,6 +27,15 @@ THREE.CanvasRenderer = function () {
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ this.clear = function () {
|
|
|
|
+
|
|
|
|
+ _clearRect.inflate( 1 );
|
|
|
|
+ _clearRect.minSelf( _clipRect );
|
|
|
|
+ _context.clearRect( _clearRect.getX(), _clearRect.getY(), _clearRect.getWidth(), _clearRect.getHeight() );
|
|
|
|
+ _clearRect.empty();
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+
|
|
this.render = function ( scene, camera ) {
|
|
this.render = function ( scene, camera ) {
|
|
|
|
|
|
var i, j, element, pi2 = Math.PI * 2,
|
|
var i, j, element, pi2 = Math.PI * 2,
|
|
@@ -38,10 +48,7 @@ THREE.CanvasRenderer = function () {
|
|
bitmap, bitmap_width, bitmap_height,
|
|
bitmap, bitmap_width, bitmap_height,
|
|
size;
|
|
size;
|
|
|
|
|
|
- _clearRect.inflate( 1 );
|
|
|
|
- _clearRect.minSelf( _clipRect );
|
|
|
|
- _context.clearRect( _clearRect.getX(), _clearRect.getY(), _clearRect.getWidth(), _clearRect.getHeight() );
|
|
|
|
- _clearRect.empty();
|
|
|
|
|
|
+ this.autoClear && this.clear();
|
|
|
|
|
|
/*
|
|
/*
|
|
_context.fillStyle = 'rgba(255, 255, 0, 0.5)';
|
|
_context.fillStyle = 'rgba(255, 255, 0, 0.5)';
|