Coder Social home page Coder Social logo

lehquan / mdn-model-view-projection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gregtatum/mdn-model-view-projection

0.0 0.0 0.0 207 KB

Understanding WebGL coordinate spaces

License: MIT License

JavaScript 48.15% CSS 0.35% HTML 51.50%

mdn-model-view-projection's Introduction

Model View Projection

Understanding WebGL coordinate spaces

This content kit explores how to take data within a WebGL project, and project it into the proper spaces to display it on the screen. It assumes a knowledge of basic matrix math using translation, scale, and rotation matrices. It explains the three core matrices that are typically used to represent a 3d object: the model, view and projection matrices.

Lesson JSFiddle Code Time Estimation
Clip Space JSFiddle 01-clip-space 15 min
Homogeneous Coordinates JSFiddle 02-homogeneous-coordinates 15 min
Model Matrix JSFiddle 03-model-transform 15 min
Divide by W JSFiddle 04-divide-by-w 15 min
Simple Projection JSFiddle 05-simple-projection 15 min
Perspective Matrix JSFiddle 06-perspective-matrix 15 min
View Matrix JSFiddle 07-view-matrix 15 min

Getting started (10 min)

The lessons can either be worked online from JSFiddle, or downloaded and explored locally. The content of the lessons is mixed in with the code. The script.js files contain most of the lesson, while the index.html contains the HTML and shader code. To download these files either grab the zip file or run git clone [email protected]:TatumCreative/mdn-model-view-projection.git from the command line.

Working locally checklist

  1. Verify that WebGL works on your machine.
  2. Download the lesson files to your machine.
  3. Open the lessons in the browser:
  • Either open the index.html files from the lessons in your browser
  • Or if you are serving files with a local webserver, make sure and serve them from the root directory of the content kit so that the shared js files can be correctly loaded in.

Working on JSFiddle checklist

  1. Verify that WebGL works on your machine.
  2. Visit the JSFiddle links

Lesson requirements

These lessons require a browser and device that support WebGL. The browsers that support these features are Firefox 4+, Google Chrome 9+, Opera 12+, Safari 5.1+ and Internet Explorer 11+. Be aware that not all devices support WebGL even if the browsers do. There are many tutorials available throughout the web on graphics programming, but this content kit specifically targets web developers. It's assumed that the audience is familiar with an intermediate level web development, markup, and JavaScript.

Updates and Correction

Submit an issue or a pull request for any corrections or updates. For a history of the updates visit the commit history.

mdn-model-view-projection's People

Contributors

gregtatum avatar

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.