Advertisement
anden3

TypeScript

Jan 13th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     initializeObjects(): void {
  2.         this.objects.push(<Object3D>new Cone(
  3.             gl, "textures/chessboard.png", 8, 2, 40,
  4.             (matrix: glm.mat4) => {
  5.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(-35, 0, -35));
  6.             }
  7.         ));
  8.  
  9.         this.objects.push(<Object3D>new Cone(
  10.             gl, "textures/chessboard.png", 8, 2, 40,
  11.             (matrix: glm.mat4) => {
  12.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(-35, 0, 35));
  13.             }
  14.         ));
  15.  
  16.         this.objects.push(<Object3D>new Cone(
  17.             gl, "textures/chessboard.png", 8, 2, 40,
  18.             (matrix: glm.mat4) => {
  19.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(35, 0, -35));
  20.             }
  21.         ));
  22.  
  23.         this.objects.push(<Object3D>new Cone(
  24.             gl, "textures/chessboard.png", 8, 2, 40,
  25.             (matrix: glm.mat4) => {
  26.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(35, 0, 35));
  27.             }
  28.         ));
  29.  
  30.         this.objects.push(<Object3D>new Plane(
  31.             gl, "textures/chessboard.png", 90, 90,
  32.             (matrix: glm.mat4) => {
  33.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(0, -20, 0));
  34.             }
  35.         ));
  36.  
  37.         this.objects.push(<Object3D>new Torus(
  38.             gl, "textures/chessboard.png", 10, 5,
  39.             (matrix: glm.mat4) => {
  40.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(-10, -5, -10));
  41.             }
  42.         ));
  43.  
  44.         this.objects.push(<Object3D>new Crescent(
  45.             gl, "textures/chessboard.png", 10, 15, 3, 2,
  46.             (matrix: glm.mat4) => {
  47.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(10, -20, -10));
  48.             }
  49.         ));
  50.  
  51.         this.objects.push(<Object3D>new Sphere(
  52.             gl, "textures/chessboard.png", 10,
  53.             (matrix: glm.mat4) => {
  54.                 glm.mat4.translate(matrix, matrix, glm.vec3.fromValues(0, -10, 20));
  55.             }
  56.         ));
  57.  
  58.         this.lightSphere = new Sphere(
  59.             gl, "textures/white.png", 1.5
  60.         );
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement