0% found this document useful (0 votes)
7 views20 pages

Computer Graphics

The document discusses the use of quaternions in computer graphics for representing rotations and orientations in 3D space, highlighting their advantages over Euler angles. It also covers the mathematical operations involving quaternions, such as multiplication and inversion, and their applications in robotics and animation. Additionally, it introduces Bézier and B-spline curves, explaining their significance in modeling smooth curves and addressing limitations of Bézier curves.

Uploaded by

KALEESWARI K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views20 pages

Computer Graphics

The document discusses the use of quaternions in computer graphics for representing rotations and orientations in 3D space, highlighting their advantages over Euler angles. It also covers the mathematical operations involving quaternions, such as multiplication and inversion, and their applications in robotics and animation. Additionally, it introduces Bézier and B-spline curves, explaining their significance in modeling smooth curves and addressing limitations of Bézier curves.

Uploaded by

KALEESWARI K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Mathematics for

Computer Graphics
Quaternion
In Computer graphics, quaternion are used to
represent rotations and orientations in 3D
space.
It was made up of a scalar part and three
imaginary parts
They are simpler to compose than Euler angles
It was mostly used to represent the orientation
of a robot in robotics.
Representation: q= [s+xi+yj+zk]
Multiplying Quaternion:
Inverse Quaternion
q^(-1) = [s-xi –yj – zk] / |q|^2
Step1:Convert the point P(x,y,z) to quaternion
P
Step2:Define axis of rotation as a unit vector u
 
Step3:Define
cos sin the transforming quaternion q:by
2 2
q=[ , u] q 1
 
Step4:Define
cos
2 inverse
 sin
2 of the quaternion
q^-1 = [ , u]
Step5:Compute p’= qpq^-1
Step6:Unpack (x’ , y’ , z’)
Consider the point P(0,1,1) which is to be rotated 90
deg about y-axis.
Soln: The axis of rotation is [j]
Now, q = [cos 45, sin45[0,1,0]]
= [cos45, [0,sin45,0]]
1
= [cos45, -sin45[0,1,0]/|q|^2
q
= [cos45, [0,-sin45,0]]
q p = [cos45,[0,sin45,0]].[0,[0,1,1]]
= [-sin45,[sin45,cos45,cos45]
qpq^-1 = [0,[2sin45cos45, 1, cos45cos45-
sin45sin45]]
= [0,[1,1,0]] = p’
Geogebra:
Roll, Pitch and Yaw Quaternion
Quaternions in Matrix form
There is a direct relationship between
quaternions and matrices
 M 11 M 12 M 13 
M M 22 M 23 
 21
 M 31 M 32 M 33 
Where M11 = 1 – 2(y^2+z^2)
M12 = 2(xy-sz) M23 = 2(yz – sx)
M13 = 2(xz+sy) M31 = 2(2(yz – sy)
M21 = 2(xy+sz) M32 = 2(yz+sx)
M22 = 1 – 2(x^2+z^2) M33 = 1 –
2(x^2+y^2)
A quaternion can be used to rotate a vertex or
position a virtual camera.
If unit quaternions are used, the associated matrix
is orthogonal.
i.e) its transpose is equivalent to rotating the
frames of reference in the opposite direction
Frames of reference
By multiplying a quaternion representing a rotation
with a vector in one frame of reference, you can
obtain the corresponding vector in a different
frame.
Application:
This concept is widely used in fields like robotics,
computer graphics, and aerospace engineering
where precise orientation tracking and
manipulation of objects in 3D space are crucial.
Transforming Vectors
Problems
Calculate the area of a regular polygon
Calculate the area of any polygon
Calculate the dihedral angle of a
Dodecahedron
Calculate the area of a triangle using vectors
Calculate the angle between two straight
lines
Find the position of a point Reflected in a line
Bezier Curves
A Bézier curve is a mathematically described
curve used in computer graphics and
animation.
In vector images, they are used to model
smooth curves that can be scaled indefinitely.
The curve is defined by a set of control points
with a minimum of two.
Example:
Applications:
vector graphics,
animation,
font design,
computer-aided design (CAD), where precise
control over curved shapes is needed.
3D modeling
Data Visualization
B Spline Curve
B-spline curve is a piecewise polynomial
function with specific properties that
determine the polynomial degree/order.
The idea behind using a B-spline curve is to
determine a unique polynomial
representation of a set of data, whether
that data be structural points in 3D space or a
set of data on a graph
Concept of B-spline curve came to resolve the
disadvantages having by Bezier curve,
Both curves are parametric in nature.
In Bezier curve we face a problem, when we
change any of the control point respective
location the whole curve shape gets change.
But here in B-spline curve, the only a specific
segment of the curve-shape gets changes or
affected by the changing of the corresponding
location of the control points.
THANK YOU

You might also like