Game Programming For T.Y. Computer Science Students
Game Programming For T.Y. Computer Science Students
PROGRAMMING
BY MRS AARTI PARDESHI
SYLLABUS
Unit I: Mathematics for Unit II: DirectX Pipeline and Unit III:
Computer Graphics, DirectX Programming: • Introduction to Rendering Engines:
Kickstart: • Introduction To DirectX 11: • Unity Engine: Multi-platform
• Cartesian Coordinate system: • Direct3D 11 Rendering Pipeline: publishing, VR + AR:
• Vectors: • Trigonometry: • Scripting:
• Transformations: • Interpolation: • XR: VR, AR, MR
• DirectX: • Curves:
• Analytic Geometry:
TEXT BOOK(S):
1)
MATHEMATICS FOR COMPUTER GRAPHICS, JOHN
VINCE, SPRINGER-VERLAG LONDON, 5TH EDITION
,2017
What is mathematics?
1. By building a system for counting using numbers, we have an amazing tool for
composing mathematical systems that help us measure quantity, structure, space and
change. Such systems have been applied to topics such as fluid dynamics, optimisation,
statistics, cryptography, game theory probability theory, and many more.
2. The concept of number, and the visual representation of number reveals all sorts of
patterns, that give rise to number systems, algebra, trigonometry, geometry, analytic
geometry and calculus.
3. The universe does not need any of these mathematical ideas to run its machinery, but
they are useful to understand and describe its operation.
Greek symbols:
α alpha ν nu
β beta ξ xi
γ gamma oo
δ delta π pi
ε epsilon ρ rho
ζ zeta σ sigma
η eta τ tau
θ theta υ upsilon
ι iota φ phi
κ kappa χ chi
λ lambda ψ psi
μ mu ω omega
some upper-case symbols:
Γ Gamma Σ Sigma
Δ Delta Υ Upsilon
Θ Theta Φ Phi
Λ Lambda Ψ Psi
Ξ Xi Ω Omega
Π Pi
Trigonometry
The word ‘trigonometry’ divides into three parts: ‘tri’, ‘gon’, ‘metry’, which means the measurement of
three-sided polygons, i.e. triangles. It is an ancient subject and is used across all branches of mathematics.
The measurement of angles is at the heart of trigonometry, and today two units of
angular measurement have survived into modern usage: degrees and radians.
Each degree divides into 60 min, and each minute divides into 60 s.
The radian of angular measure does not depend upon any arbitrary constant – it is the angle created by a
circular arc whose length is equal to the circle’s radius.
And because the perimeter of a circle is 2πr, 2π radians correspond to one complete rotation. As 360◦
correspond to 2π radians, 1 radian equals 180◦ /π, which is approximately 57.3◦. The following relationships
between radians and degrees are
consider the history of the word sine.
first defined the sine as the modern relationship between half an angle and half a chord,
while also defining the cosine, versine, and inverse sine.
Aryabhata (476–550 AD), collected and expanded upon the developments of the
Siddhantas in an important work called the Aryabhatiya.
The Siddhantas and the Aryabhatiya contain the earliest surviving tables of sine values
and versine (1 − cosine) values, in 3.75° intervals from 0° to 90°, to an accuracy of 4
decimal places.
They used the words jya for sine, kojya for cosine, utkrama-jya for versine, and otkram
jya for inverse sine. The words jya and kojya eventually became sine and cosine
respectively after a mistranslation described above.
The Trigonometric Ratios
sin cos tan
4.7 Compound Angles
The idea behind compound angles or double angle is to express sin, cos or tan of one angle
with two different angles. It is possible because sin, cos or tan are nothing but ratios of sides.
√ √
𝟐 𝟐 𝟐
𝑨 𝟏−𝑪𝑶𝑺 𝑨 𝟐 𝒃𝒄 − 𝒃 − 𝒄 +𝒂
𝐬𝐢𝐧 = ¿
𝟐 𝟐 𝟒 𝒃𝒄
√ √
𝟐
𝟐 (𝒃 ¿ ¿𝟐−𝟐𝒃𝒄+𝒄 )
𝟐 𝟐 𝟐
𝒃 +𝒄 − 𝒂
𝟏−
𝟐 𝒃𝒄 ¿ 𝒂− ¿
¿
𝟐
𝟒𝒃𝒄
√ √
𝟐 𝟐
𝟐 𝒃𝒄 − 𝒃 − 𝒄 +𝒂
𝟐 𝟐 𝟐 𝒂 −(𝒃−𝒄)
𝟐 𝒃𝒄
¿
¿ 𝟒 𝒃𝒄
𝟐
√ √𝟐 ( 𝑺− 𝒄 ) .𝟐(𝑺 − 𝒃)
𝟐 𝟐
𝒂 −(𝒃−𝒄)
¿ ¿
𝟒 𝒃𝒄 4 𝒃𝒄
¿
√(𝒂+ ( 𝒃−𝒄 ) )(𝒂− ( 𝒃−𝒄 ))
4 𝒃𝒄
¿
√( 𝑺− 𝒄 ) (𝑺 −𝒃)
𝒃𝒄
¿
√(𝒂+𝒃−𝒄 )(𝒂− 𝒃+𝒄)
𝟒𝒃𝒄
¿
√( 𝑺− 𝒃 ) (𝑺 −𝒄)
𝒃𝒄
√
sin ()
(𝟐𝑺 −𝒄 − 𝒄)(𝟐𝑺 −𝒃− 𝒃)
¿
4 𝒃𝒄
Prove that
(a + b+ c) 𝒃𝟐 +𝒄 𝟐 − 𝒂𝟐
𝒄𝒐𝒔 𝑨=
𝟐 𝒃𝒄
√ √
𝟐 𝟐 𝟐
𝑨 𝟏+𝑪𝑶𝑺 𝑨 𝟐 𝒃𝒄+𝒃 +𝒄 − 𝒂
𝒄𝒐𝒔 = ¿
𝟐 𝟐 𝟒𝒃𝒄
√ √
𝟐 𝟐
𝟐
𝒃 + 𝒄 −𝒂
𝟐 𝟐
(𝒃 ¿ ¿𝟐+𝟐 𝒃𝒄+𝒄 )−𝒂
𝟏+
𝟐 𝒃𝒄 ¿ ¿
¿
𝟐
𝟒 𝒃𝒄
√
𝟐 𝟐
√
𝟐
𝟐 𝒃𝒄 +𝒃 +𝒄 − 𝒂
𝟐 𝟐 (𝒃+𝒄) − 𝒂
¿
¿
𝟐 𝒃𝒄 𝟒 𝒃𝒄
𝟐
√ √
𝟐 𝟐
(𝒃+𝒄) − 𝒂 𝟒 𝑺(𝑺− 𝒂)
¿ ¿
𝟒 𝒃𝒄 𝟒𝒃𝒄
√ √
𝑺(𝑺 − 𝒂)
𝟐 𝟐
(𝟐𝑺 − 𝒂) − 𝒂
¿ ¿
𝟒𝒃𝒄 𝒃𝒄
¿
√(𝟐𝑺 − 𝒂+𝒂)(𝟐 𝑺− 𝒂− 𝒂)
4 𝒃𝒄
cos ()
¿
√( 𝟐 𝑺 ) 𝟐(𝑺− 𝒂)
4𝒃𝒄
Right fingers Left fingers
sin (0) = = 0 4 3 2 cos (0) = = 1
sin (30) =
60 45 30
cos (30) =
5
sin (45) = = 90 cos (45) =
1
sin (60) = 0 cos (60) =
sin (30) =
60 45 30
cos (30) =
5
sin (45) = = 90 cos (45) =
1
sin (60) = 0 cos (60) =