4. What is canva? z?
"Added in HTML5, the HTML <canvas> element
can be used to draw graphics via scripting in
JavaScript. For example, it can be used to draw
graphs, make photo compositions, create
animations, or even do real-time video processing
or rendering.”
<canvas></canvas>
9. Why canvas?
Unlike SVG is much more convenient to deal with a large number of elements;
It has hardware acceleration
You can manipulate each pixel
You can apply image processing filters
There are a lot of libraries
10. Why not?
Loading the CPU and RAM;
Due to the limitations of the garbage collector, there is no way to clear the memory;
It is necessary to handle events with objects
Poor performance at high resolution
We have to draw in each element separately
24. SVG? (Schtirlitz V Gorode)
SVG is a language for describing two-dimensional graphics.
As a standalone format or when mixed with other XML, it
uses the XML syntax [XML10]. When mixed with HTML5, it
uses the HTML5 syntax [HTML]. …
SVG drawings can be interactive and dynamic. Animations
can be defined and triggered either declaratively (i.e., by
embedding SVG animation elements in SVG content) or via
scripting.
32. Path
<path d="M10 10 h 80 v 80 h -80 Z" fill="transparent" stroke="black"/>
The path will move to point (10,10) and then move horizontally 80 points to the right, then 80 points
down, then 80 points to the left, and then back to the start.
https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
48. What the heck is WebGL??
WebGL allows web content to use the API, based on OpenGL ES 2.0, for rendering three-dimensional
graphics without the use of plug-ins in the HTML canvas element in browsers that implement
support for it. WebGL programs consist of control code written in JavaScript code and special effects
(shader code) that runs on the GPU. WebGL elements can be mixed with other HTML elements, and
assembled with other parts of a web page or a web page background.
49. WebGL is context
var gl;
try {
gl = canvas.getContext("experimental-webgl");
} catch(e) {}
51. WebGL pros
Shows a promise of 3D with dramatically lowered friction. No client or plugin install necessary.
Royalty-free open standard shepherded by the Kronos consortium -http://www.khronos.org/
Uses HTML5's canvas element and so is part of a larger change taking place on the web rather than an isolated technology.
Browser makers Mozilla, Opera, Apple & Google are all onboard.
Transparent development of spec. Majority of discussion takes place atwww.khronos.org/webgl/public-mailing-list/
Gives access to the power of a computer's graphics hardware from within scripts on web pages.
52. Web GL cons
Not yet available beyond betaversions of Firefox, Opera, Safari and Chrome browsers. Later this year seems to be current
best guess for spec hitting v1.0. Seems that the remaining issues are related to getting security right. Good news is that
as soon as spec is signed of on then implementations should be ready to roll out.
Microsoft has not signed on. The way to get it to run in IE will likely by with the Chrome Frame plugin.
Depends on having OpenGL 2.0 drivers present which many computers will not have.http://code.google.com/p/anglepr...
is an open source project by Google to address this issue.
Despite recent improvements Javascript may still feel too slow or just plain unfamiliar to people used to writing rich 3D
applications.
Most developer libraries are still in an early stage. Partial list:http://www.khronos.org/webgl/wik...
57. Diff
One main difference is that a vertex shader can manipulate the
attributes of vertices. which are the corner points of your
polygons.
The fragment shader on the other hand takes care of how the
pixels between the vertices look. They are interpolated between
the defined vertices following specific rules.
62. WebGL libs
glMatrix JavaScript Matrix and Vector library for High Performance WebGL apps
Sylvester An open source library for manipulating vectors and matrices. Not optimized for WebGL
but extremely robust.
A little bit more https://www.khronos.org/webgl/wiki/User_Contributions#Frameworks