當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript mat3.create方法代碼示例

本文整理匯總了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
     */
 }
開發者ID:MehdiZonjy,項目名稱:book-viewer,代碼行數:19,代碼來源:camera.ts

示例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);
  }
開發者ID:mariusGundersen,項目名稱:Ekkiog,代碼行數:20,代碼來源:Perspective.ts

示例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);
開發者ID:DenisCarriere,項目名稱:DefinitelyTyped,代碼行數:31,代碼來源:gl-matrix-tests.ts

示例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;
開發者ID:davidpaulrosser,項目名稱:leonardo,代碼行數:31,代碼來源:Material.ts

示例5: constructor

 /**
  * Creates an instance of BaseSprite.
  * 
  */
 constructor() {
     super();
     this.mViewWorld = mat3.create();
 }
開發者ID:MehdiZonjy,項目名稱:book-viewer,代碼行數:8,代碼來源:base-sprite.ts

示例6: constructor

 /**
  * Creates an instance of MovableObject.
  * 
  */
 constructor() {
     this.mTransformation = mat3.create();
     this.mCachedInverse = mat3.create();
     this.mVersion = 0;
 }
開發者ID:MehdiZonjy,項目名稱:book-viewer,代碼行數:9,代碼來源:movable-object.ts


注:本文中的gl-matrix.mat3.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。