3D Basic Mathematics for Computer Graphics
3D Basic Mathematics for Computer Graphics
PATNA
Name – Akarsh
Srivastava RollNo –
BCA/15033/22 Course –
BCA – V
3D Basic Mathematics for Computer
Graphics
Introduction
Computer graphics, as a field, is founded on a rich
set of mathematical principles that allow for the
creation and manipulation of images, models, and
animations in 2D and 3D space. These principles
enable the rendering of virtual objects with realism,
providing the tools needed for games, movies,
simulations, and augmented reality experiences.
Without a solid mathematical foundation, developing
these systems becomes significantly more
challenging. This document aims to introduce the
basic mathematics required to understand and work
with 3D graphics, emphasizing vectors, matrices,
transformations, and lighting models.
P2(4,6,8)P_2(4, 6, 8)P2
(4,6,8), the vector P1P2→\
overrightarrow{P_1P_2}P1 P2 is
calculated as (4−1,6−2,8−3)=(3,4,5)(4-1, 6-2, 8-3)
= (3, 4,
5)(4−1,6−2,8−3)=(3,4,5).
Vectors can be manipulated in a variety of ways that
are crucial to 3D graphics. For instance, vectors can
be scaled by multiplying them by a scalar value. This
is useful when you want to increase or decrease the
(37.07,47.07,57.07)≈(0.42,0.57,0.71)\left( \frac{3}{7.07},
\frac{4}{7.07}, \frac{5}{7.07} \right) \approx (0.42, 0.57,
0.71)(7.073 ,7.074 ,7.075 )≈(0.42,0.57,0.71)
Dot Product and Cross Product
In vector algebra, two key operations are used extensively in
3D graphics: the dot product and the cross product. The dot
product of two vectors is a scalar quantity that reflects the
degree of alignment between them. If two vectors point in
the same direction, their dot product will be positive and at
its maximum value. If the vectors are perpendicular, the dot
product will be zero. If they point in opposite directions, the
dot product will be negative. The formula for the dot product
is:
Rz(θ)=(cosθ−sinθ0sinθcosθ0001)R_z(\theta) =
\begin{pmatrix} \cos\theta & -\sin\theta & 0 \\ \
sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \
end{pmatrix}Rz (θ)=
cosθsinθ0 −sinθcosθ0 001
Homogeneous Coordinates
Homogeneous coordinates are a mathematical trick
that allows us to handle translation, rotation, scaling,
and
framework. By adding a fourth coordinate www, we
perspective projection using the same matrix
1)(x,y,z,1), and a
vector is represented as (x,y,z,0)(x, y, z, 0)(x,y,z,0).
This fourth coordinate allows translation to be
represented as a matrix multiplication, just like
rotation and scaling. For instance, a translation
matrix in homogeneous coordinates looks like this: