Changeset 19916
- Timestamp:
- 12/28/15 22:12:25 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/webgl.js
r19915 r19916 122 122 } //}}} 123 123 function recalculateModelMatrix(node) { //{{{ 124 //TODO: move to 0,0,0, rotate,move back to normal space, then apply transform 124 125 var modelMatrix = mat4.create(); 125 126 … … 128 129 mat4.multiply(modelMatrix, scaleMatrix, modelMatrix); 129 130 131 var translationMatrix = mat4.create(); 132 mat4.translate(translationMatrix, translationMatrix, node["translation"]); //relative translation 133 mat4.multiply(modelMatrix, translationMatrix, modelMatrix); 134 130 135 var zRotationMatrix = mat4.create(); 131 136 mat4.rotate(zRotationMatrix, zRotationMatrix, node["rotation"][2] * Math.PI/180.0, [0.0, 0.0, 1.0]); … … 137 142 mat4.rotate(xRotationMatrix, xRotationMatrix, node["rotation"][0] * Math.PI/180.0, [1.0, 0.0, 0.0]); 138 143 mat4.multiply(modelMatrix, xRotationMatrix, modelMatrix); 139 140 var translationMatrix = mat4.create();141 mat4.translate(translationMatrix, translationMatrix, node["translation"]); //relative translation142 mat4.multiply(modelMatrix, translationMatrix, modelMatrix);143 144 144 145 return modelMatrix;
Note:
See TracChangeset
for help on using the changeset viewer.