Professional Documents
Culture Documents
Ian Parberry
University of North Texas
Chapter 1 Notes
Word Cloud
Chapter 1 Notes
1D Mathematics
Chapter 1 Notes
Introduction
3D math is all about measuring locations, distances, and angles precisely and mathematically in 3D space. The most frequently used framework to perform such calculations using a computer is called the Cartesian coordinate system.
Chapter 1 Notes
Ren Descartes
Cartesian mathematics was invented by (and is named after) French philosopher, physicist, physiologist, and mathematician Ren Descartes, 1596 - 1650. Descartes is famous not just for inventing Cartesian mathematics, which at the time was a stunning unification of algebra and geometry. He is also well-known for making a pretty good stab of answering the question How do I know something is true?, a question that has kept generations of philosophers happily employed.
Chapter 1 Notes 3D Math Primer for Graphics & Game Dev 6
1D Mathematics
We assume that you already know about the natural numbers, the integers, the rational numbers, and the real numbers. On a computer you have to make do with shorts, ints, floats, and doubles. These have limited precision. We assume that you have a basic understanding about how numbers are represented on a computer. Remember the First Law of Computer Graphics: If it looks right, it is right.
Chapter 1 Notes 3D Math Primer for Graphics & Game Dev 8
Section 1.2:
2D Cartesian Space
Chapter 1 Notes
Chapter 1 Notes
10
Chapter 1 Notes
11
2D Coordinate Spaces
All that really matters are the numbers. The abstract version of this is called a 2D Cartesian coordinate space.
Chapter 1 Notes
12
Chapter 1 Notes
13
Axes
In the figure on the previous slide, the horizontal axis is called the x-axis, with positive x pointing to the right, and the vertical axis is the y-axis, with positive y pointing up. This is the customary orientation for the axes in a diagram.
Chapter 1 Notes
14
Screen Space
But it doesnt have to be this way. Its only a convention. In screen space, for example, +y points down. Screen space is how you measure on a computer screen, with the origin at the top left corner.
Chapter 1 Notes
15
Axis Orientation
There are 8 possible ways of orienting the Cartesian axes.
Chapter 1 Notes
16
Locating Points in 2D
Point (x,y) is located x units across and y units up from the origin.
Chapter 1 Notes
17
Axis Equivalence in 2D
These 8 alternatives can be obtained by rotating the map around 2 axes (any 2 will do). Surprisingly, this is not true of 3D coordinate space, as we will see later.
Chapter 1 Notes
18
Examples
Chapter 1 Notes
19
Section 1.3:
3D Cartesian Space
Chapter 1 Notes
20
3D Cartesian Space
Chapter 1 Notes
21
Locating Points in 3D
Point (x,y,z) is located x units along the x-axis, y units along the y-axis, and z units along the zaxis from the origin.
Chapter 1 Notes
22
Axis Equivalence in 3D
Recall that in 2D the alternatives for axis orientation can be obtained by rotating the map around 2 axes. As we said, this is not true of 3D coordinate space.
Chapter 1 Notes
23
Visualizing 3D Space
The usual convention is that the x-axis is horizontal and positive is right, and that the yaxis is vertical and positive is up The z-axis is depth, but should the positive direction go forwards into the screen or backwards out from the screen?
Chapter 1 Notes
24
Left-handed Coordinates
+z goes into screen Use your left hand Thumb is +x Index finger is +y Second finger is +z
Chapter 1 Notes
25
Right-handed Coordinates
+ z goes out from screen Use your right hand Thumb is +x Index finger is +y Second finger is +z (Same fingers, different hand)
Chapter 1 Notes 3D Math Primer for Graphics & Game Dev 26
Changing Conventions
To swap between left and right-handed coordinate systems, negate the z. Graphics books usually use left-handed. Linear algebra books usually use right-handed. Well use left-handed.
Chapter 1 Notes
27
Positive Rotation
Use your left hand for a left-handed coordinate space, and your right hand for a right-handed coordinate space. Point your thumb in the positive direction of the axis of rotation (which may not be one of the principal axes). Your fingers curl in the direction of positive rotation.
Chapter 1 Notes 3D Math Primer for Graphics & Game Dev 28
Positive Rotation
Chapter 1 Notes
29
Our Convention
For the remainder of these lecture notes, as in the book, we will use a left-handed coordinate system.
Chapter 1 Notes
30
Section 1.4:
Chapter 1 Notes
31
Chapter 1 Notes
32
Angles
An angle measures an amount of rotation in the plane. Variables for angles are often given the Greek letter . The most important units of measure are degrees () and radians (rad). Humans usually measure angles using degrees. One degree measures 1/360th of a revolution, so 360 is a complete revolution. Mathematicians, prefer to measure angles in radians, which is a unit of measure based on the properties of a circle. When we specify the angle between two rays in radians, we are actually measuring the length of the intercepted arc of a unit circle, as shown in the figure on the next slide.
Chapter 1 Notes 3D Math Primer for Graphics & Game Dev 33
Radians
Chapter 1 Notes
34
Trig Functions
Consider the angle between the +x axis and a ray to the point (x,y) in this diagram.
Chapter 1 Notes
36
Chapter 1 Notes
38
Chapter 1 Notes
40
Chapter 1 Notes
41
Chapter 1 Notes
42
Alternative Forms
Some old horse Caught another horse Taking oats away Some old hippy Caught another hippy Tripping on acid
Chapter 1 Notes 3D Math Primer for Graphics & Game Dev 43
Chapter 1 Notes
44
Pythagorean Identities
These identities can be derived by applying the Pythagorean theorem to the unit circle. sin2 + cos2 = 1 1 + tan2 = sec2 1 + cot2 = csc2
Chapter 1 Notes
46
Chapter 1 Notes
47
Chapter 1 Notes
48
Law of Sines
Chapter 1 Notes
49
Law of Cosines
Chapter 1 Notes
50
Vectors
Chapter 1 Notes
51