Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Grenzenlose Grafik: 2D, 3D und Gamepad für alle Plattformen und Devices

Grenzenlose Grafik: 2D, 3D und Gamepad für alle Plattformen und Devices

Im Browser geht weitaus mehr als die meisten sich vorstellen können: Dank dem Canvas-Element, WebGL und der HTML5 Gamepad API machen attraktive 2D- und 3D-Visualisierungen und auch deren Steuerung mithilfe eines Gamepad selbst vor Mobilplattformen nicht halt. Dieser Talk zeigt die Grundlagen schneller, dynamische Grafiken und Animationen mit JavaScript anhand einiger Beispiele sowie deren Steuerung mithilfe eines handelsüblichen Gamepad.

Repository: https://github.com/thinktecture/2d-3d-gamepad

Christian Liebel

May 28, 2016
Tweet

More Decks by Christian Liebel

Other Decks in Programming

Transcript

  1. Grenzenlose Grafik 2D, 3D und Gamepad für alle Plattformen und

    Devices Christian Liebel Thinktecture AG
  2. Real Cross‐Platform The web is the platform HTML5, CSS3, JavaScript

    One codebase, maximum code sharing Works on virtually any platform
  3. < c a n v a s > Generating fast,

    dynamic graphics using JavaScript Plain bitmap for the web Drawing tools are provided by contexts Hi‐DPI support High performance, low energy consumption r e q u e s t A n i m a t i o n F r a m e
  4. Contexts c a n v a s . g e

    t C o n t e x t Provide tools to draw on the canvas 2D context: 2 d ﴾CanvasRenderingContext2D﴿ 3D context: w e b g l ﴾WebGLRenderingContext﴿
  5. d e v i c e P i x e

    l R a t i o Device pixels vs. CSS pixels “Retina” ﴾Hi‐DPI﴿ support w i n d o w . d e v i c e P i x e l R a t i o
  6. r e q u e s t A n i

    m a t i o n F r a m e Just in time ﴾matches screen refresh rate﴿ Does not execute when window is minimized or tab in the background Does not execute when browser is busy No stacking/queueing
  7. Proven Technology Based on OpenGL for Embedded Systems Blender &

    Unity can export to WebGL ANGLE ﴾Chrome/Firefox﴿: Rendering on Direct3D
  8. Structure Geometry: shape ﴾cube, sphere, …﴿ Material: color, texture, light

    reflection Mesh: 3D object ﴾geometry + material﴿
  9. HTML5 Gamepad API Polling Access to a set of connected

    gamepads Access to the gamepad’s button and axis states Gamepads appear as soon as the first button was pressed
  10. Summary Cross platform high‐performance graphic manipulation 2D & 3D Hardware

    acceleration Supported by all major browsers Touch‐enabled, gamepad‐enabled