本文整理汇总了TypeScript中gl-matrix.mat3.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript mat3.create方法的具体用法?TypeScript mat3.create怎么用?TypeScript mat3.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gl-matrix.mat3
的用法示例。
在下文中一共展示了mat3.create方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createProjection
/**
* Creates Orthographic projection matrix
*
* @private
* @param {number} width
* @param {number} height
*/
private createProjection(width: number, height: number) {
this.mProjection = mat3.create();
this.mProjection[0] = 2 / width;
this.mProjection[4] = -2 / height;
this.mProjection[6] = -1;
this.mProjection[7] = 1;
/*
2 / width, 0, 0,
0, -2 / height, 0,
-1, 1, 1
*/
}
示例2: 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);
}
示例3:
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);
outVec2 = vec2.add(outVec2, vec2A, vec2B);
示例4:
lambertFragmentShaderEs300
} from '../shaders/Lambert.glsl';
import {
phongFragmentShaderEs100,
phongFragmentShaderEs300
} from '../shaders/Phong.glsl';
import { vertexShaderEs100, vertexShaderEs300 } from '../shaders/Vertex.glsl';
import ShaderParser from '../utils/ShaderParser';
import { capabilities } from './Capabilities';
import * as CONSTANTS from './Constants';
import * as GL from './GL';
import Program from './Program';
import UniformBuffers from './UniformBuffers';
let gl: WebGL2RenderingContext | WebGLRenderingContext;
const normalMatrix: mat3 = mat3.create();
const inversedModelViewMatrix: mat4 = mat4.create();
interface Options {
name?: string;
type?: string;
uniforms?: any;
fov?: number;
hookVertexPre?: string;
hookVertexMain?: string;
hookVertexEnd?: string;
hookFragmentPre?: string;
hookFragmentMain?: string;
hookFragmentEnd?: string;
vertexShader?: string;
fragmentShader?: string;
示例5: constructor
/**
* Creates an instance of BaseSprite.
*
*/
constructor() {
super();
this.mViewWorld = mat3.create();
}
示例6: constructor
/**
* Creates an instance of MovableObject.
*
*/
constructor() {
this.mTransformation = mat3.create();
this.mCachedInverse = mat3.create();
this.mVersion = 0;
}