Git Product home page Git Product logo

icg_webgl_hw's Introduction

ICG_WebGL_HW

Demo code of Interactive Computer Graphics 2018 Fall (ICG)

Shading :

Transformations :

  • Rotation:
    function degToRad(degrees) {
        return degrees * Math.PI / 180;
    }
    // rotate on x-axis:
    mat4.rotate(mvMatrix, degToRad(teapotAngle), [1, 0, 0]);
    // // rotate on z-axis:
    // mat4.rotate(mvMatrix, degToRad(teapotAngle), [0, 0, 1]);
    // // rotate on both x and y-axis together:
    // mat4.rotate(mvMatrix, degToRad(teapotAngle), [1, 1, 0]);
  • Translation:
    // position of z decrease 40 
    mat4.translate(mvMatrix, [0, 0, -40]);
    // // position of x increase 10 and y decrease 20;
    // mat4.translate(mvMatrix, [10, -20, 0]);
  • Scaling:
    // // without scaling
    // mat4.scale(mvMatrix, [1, 1, 1])
    // scale x-axis double
    mat4.scale(mvMatrix, [2, 1, 1])
  • Shearing:

    var shearMatrix = mat4.create();
    mat4.identity(shearMatrix);
    // on X-axis
    shearMatrix[1] = 0.5
    // // on Y-axis
    // shearMatrix[4] = 0.5
    // // on Z-axis
    // shearMatrix[8] = 0.5
    mat4.multiply(mvMatrix, shearMatrix, mvMatrix);

icg_webgl_hw's People

Contributors

bigmoumou avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

henrykiselev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.