16. - Colors, like the
screen dimensions,
are based on
percentages rather
than absolute
values.
- If you come from
a graphic design
background, you
need to convert
your 255 scale to
percentages.
18. Rosetta Stone
- Had the same text in
Greek, demotic, and
hieroglyphics. Was
used to translate
hieroglyphics
- Going to do similar
thing, but with math
algorithms, plain
English, and code
27. Triangles
A shape with three sides where the
angles add up to 180 degrees
Everything in our world comes back
to triangles
The most stable shape
Foundation of 3D graphics
34. So What Can We Do
Knowing This?
Change the direction a character is
moving in
Check to see if the user is hitting a
target area on the screen
Draw shapes and filters in specific
configurations
37. What is Linear
Algebra?
Linear Algebra allows you to
perform an action on many values
at the same time.
This action must be consistent
across all values, such as multiplying
every value by two.
38. What is Linear
Algebra?
Values are placed in an object
called a matrix and the actions
performed on the values are called
transforms
Linear algebra is optimized for
parallel mathematical operations.
39. Data Types
vec2, vec3, vec4: 2D, 3D, and 4D
floating point vector objects.
vec2: (x, y)
vec3: (x, y, z)
vec4: (r, g, b, a)
40. Data Types
mat2, mat3, mat4: 2, 3, and 4
element matrices.
mat2: Holds a 2 X 2 number matrix
mat3: Holds a 3 X 3 number matrix,
used for 2D linear algebra
mat4: Holds a 4 X 4 number matrix,
used for 3D linear algebra
46. Affine, Wha?? :(
A transform is any function that
alters the size, position, or rotation
of an object on your screen.
Four types: Identity, Translate,
Rotation, and Scale.
For a transform to be affine, the
lines in your shape must be parallel.
49. new point x = a * x
+ c * y + tx;
new point y = b * x
+ d * y + ty;
50. How Does This
Work?
For each point in your shape, the
computer uses this calculation to
figure out where the point should
be.
If you have a rectangle, this gets
run four times: One for each point
in your shape.