Commit 7d269741 authored by GoshaZotov's avatar GoshaZotov

add constant matrix into header class

parent ee908adf
...@@ -98,6 +98,11 @@ function Processor3D(width, height, left, right, bottom, top, chartSpace, charts ...@@ -98,6 +98,11 @@ function Processor3D(width, height, left, right, bottom, top, chartSpace, charts
this.orientationCatAx = null; this.orientationCatAx = null;
this.orientationValAx = null; this.orientationValAx = null;
this.matrixRotateOx = null;
this.matrixRotateOy = null;
this.matrixRotateAllAxis = null;
this.matrixShearXY = null;
} }
Processor3D.prototype.calaculate3DProperties = function(baseDepth, gapDepth, bIsCheck) Processor3D.prototype.calaculate3DProperties = function(baseDepth, gapDepth, bIsCheck)
...@@ -686,8 +691,11 @@ Processor3D.prototype.calculatePropertiesForPieCharts = function() ...@@ -686,8 +691,11 @@ Processor3D.prototype.calculatePropertiesForPieCharts = function()
//***functions for matrix transformation*** //***functions for matrix transformation***
Processor3D.prototype._shearXY = function() Processor3D.prototype._shearXY = function()
{ {
//TODO матрица перевёрнута if(null === this.matrixShearXY)
return [[1, 0, 0, 0], [0, 1, 0, 0], [Math.sin(-this.angleOy), Math.sin(this.angleOx), 0, 0], [0, 0, 0, 0]]; {
this.matrixShearXY = [[1, 0, 0, 0], [0, 1, 0, 0], [Math.sin(-this.angleOy), Math.sin(this.angleOx), 0, 0], [0, 0, 0, 0]];
}
return this.matrixShearXY;
}; };
Processor3D.prototype._getMatrixRotateAllAxis = function() Processor3D.prototype._getMatrixRotateAllAxis = function()
...@@ -702,18 +710,33 @@ Processor3D.prototype._getMatrixRotateAllAxis = function() ...@@ -702,18 +710,33 @@ Processor3D.prototype._getMatrixRotateAllAxis = function()
|-sinOy * cosOx sinOx cosOy * cosOx 0| |-sinOy * cosOx sinOx cosOy * cosOx 0|
|-sinOy 0 (cosOy + 1) 1|*/ |-sinOy 0 (cosOy + 1) 1|*/
if(null === this.matrixRotateAllAxis)
{
this.matrixRotateAllAxis = Point3D.prototype.multiplyMatrix(matrixRotateOY, matrixRotateOX);
}
return Point3D.prototype.multiplyMatrix(matrixRotateOY, matrixRotateOX); return this.matrixRotateAllAxis;
}; };
Processor3D.prototype._getMatrixRotateOx = function() Processor3D.prototype._getMatrixRotateOx = function()
{ {
return [[1, 0, 0, 0], [0, Math.cos(-this.angleOx), Math.sin(-this.angleOx), 0], [0, - Math.sin(-this.angleOx), Math.cos(-this.angleOx), 1], [0, 0, 0, 1]]; //todo посмотреть возможность заменить массивы на Float32Array
if(null === this.matrixRotateOx)
{
this.matrixRotateOx = [[1, 0, 0, 0], [0, Math.cos(-this.angleOx), Math.sin(-this.angleOx), 0], [0, - Math.sin(-this.angleOx), Math.cos(-this.angleOx), 1], [0, 0, 0, 1]];
}
return this.matrixRotateOx;
}; };
Processor3D.prototype._getMatrixRotateOy = function() Processor3D.prototype._getMatrixRotateOy = function()
{ {
return [[Math.cos(-this.angleOy), 0, -Math.sin(-this.angleOy), 0], [0, 1, 0, 0], [Math.sin(-this.angleOy), 0, Math.cos(-this.angleOy), 1], [0, 0, 0, 1]]; if(null === this.matrixRotateOy)
{
this.matrixRotateOy = [[Math.cos(-this.angleOy), 0, -Math.sin(-this.angleOy), 0], [0, 1, 0, 0], [Math.sin(-this.angleOy), 0, Math.cos(-this.angleOy), 1], [0, 0, 0, 1]];
}
return this.matrixRotateOy;
}; };
Processor3D.prototype._getMatrixRotateOz = function() Processor3D.prototype._getMatrixRotateOz = function()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment