本文整理汇总了TypeScript中gl-matrix.mat2d.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript mat2d.create方法的具体用法?TypeScript mat2d.create怎么用?TypeScript mat2d.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gl-matrix.mat2d
的用法示例。
在下文中一共展示了mat2d.create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(){
this.verticalFlipMatrix = mat2d.create();
this.viewportToSquareMatrix = mat2d.create();
this.viewportFromSquareMatrix = mat2d.create();
this.mapToTileMatrix = mat2d.create();
this.mapFromTileMatrix = mat2d.create();
this.squareToMapMatrix = mat2d.create();
this.squareFromMapMatrix = mat2d.create();
this.clipToSquareMatrix = mat2d.create();
this.clipFromSquareMatrix = mat2d.create();
this.viewportToClipMatrix = mat2d.create();
this.mapToViewportMatrix = mat3.create();
mat2d.fromScaling(this.verticalFlipMatrix, [1, -1]);
mat2d.fromScaling(this.squareToMapMatrix, [1, 1]);
mat2d.invert(this.squareFromMapMatrix, this.squareToMapMatrix);
this.setMapSize(128);
}
示例2:
let mat2A = mat2.fromValues(1, 2, 3, 4);
let mat2B = mat2.fromValues(1, 2, 3, 4);
let mat2dA = mat2d.fromValues(1, 2, 3, 4, 5, 6);
let mat2dB = mat2d.fromValues(1, 2, 3, 4, 5, 6);
let mat3A = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9);
let mat3B = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9);
let mat4A = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let mat4B = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let quatA = quat.fromValues(1, 2, 3, 4);
let quatB = quat.fromValues(5, 6, 7, 8);
let outVec2 = vec2.create();
let outVec3 = vec3.create();
let outVec4 = vec4.create();
let outMat2 = mat2.create();
let outMat2d = mat2d.create();
let outMat3 = mat3.create();
let outMat4 = mat4.create();
let outQuat = quat.create();
let outMat2Null: mat2 | null;
let outMat2dNull: mat2d | null;
let outMat3Null: mat3 | null;
let outMat4Null: mat4 | null;
// vec2
outVec2 = vec2.create();
outVec2 = vec2.clone(vec2A);
outVec2 = vec2.fromValues(1, 2);
outVec2 = vec2.copy(outVec2, vec2A);
outVec2 = vec2.set(outVec2, 1, 2);