Rendering
Methods of rendering
Representing 3D model as 2D image
Projection (rasterization) and ray tracing. Rasterization projects the vertices of the object
onto the pixels of the image. Ray tracing computes rays from each pixel to the object.
checking linearly dependence
Check span R^3
Gauss elimination if a = b = c then linearly independent.
if you can find any combo with the vectors that equal to zero
If stuck use determinant
if determinant = zero it does not span R3 and linearly dependent
determinant != 0 , it does span r3
vector length?
sqaure root of (v1^2 + v2^2 + …)
normalize a vector
v * 1/length of v
Dot product
Cosine angle between two products???
vector v and vector w
v1w1 + v2w2 + v3w3
Cos 0 = v .w/ ||v|| ||w||
Orthogonal vectors?
Two vectors are orthogonal if they are perpendicular to each other ( dot product is zero
Cross product ( vector v cross product vector w)
What does it give
v2w3 - v3w2
v3w1 - v1w3
v1w2 - v2w1
gives a vector perpendicular to both v and w
OrthoNormaal Basis
Orthonormal if it consists of only unit vectors and each pair of vectors is orthogonal
π(π₯, π¦) > 0 β the point is βaboveβ or βoutsideβ the curve
(depends on the curve shape),
β’ π π₯, π¦ < 0 β the point is βbelowβ or
βinsideβ the curve (depends on the curve
shape).
β’ π π₯, π¦ = 0 β the point is βonβ the curve,
Implicit equation for 2D circle of radius r and oround origin is
F(x,y) = x^2 + y^2 - r^2 = 0
With centre c =
f(x,y) = (x-Cx)^2 + (y-Cy)^2 + (z-Cz)^2 - r^2 = 0
Implicit Representation of Lines
π΄π₯ + π΅π¦ + πΆ = 0
implicit representation of
line passing through a point π0 = (π₯0, π¦0)
in the vector form???
n Β· (π β π0) = 0
n = [-a, 1] (vector imagine it being vertical)
p = [x,y]
p0 = [x0,y0]
Implicit representation of planes
aπ₯ + ππ¦ + ππ§ + π = 0
equation of a plane with normal vector n = (a,b,c) through point p0 = (x0,y0,z0) is
n Β· (π β π0) = 0
variable p = (x,y,z) for any point in the plane
How can plane be described using 3 non collinear points
let p1, p2, p3 be (xi,yi,zi)
we can describe the plane passing through p1,p2,p3 using
n Β· (π β π0) = 0
where normal vector is given by cross product
n = (p2-p1) x (p3-p1)
p0 can be any of the points p1,p2,p3
What is color
attribute of an object that is caused by the light being reflected or emmited by them
8 bits to represent each color so 2^8 possible values
How is RGB represented
In hexadecimal e.g abcf24
R = ab
G = cf
B = 24
What is decimal for R G and B for abcf24
R = 10 * 16 + 11 = 171
G = 12 * 16 + 15 = 204
B = 2 * 16 + 4 = 36
How does eye work with light
light enter eye hit retina. Cornea focus light on retina. Iris control amount of light entering eye
Retina has millions of photoreceptors what are these types
Rods- for low light
Cones- for percieving color
3 types for 3 values
RGB and CMY color space
RGB model (0,0,0) black (255,255,255) white
CMY - subtraactive as new colors brings result closer to black
How to convert RGB to CMY
take RGB vector and subtact it from vector (1,1,1)
parametric representation of a
line through the points π0 and π1
x = x0 + t(x1-x0)
y= y0 + t(y1-y0)
Vector form
p(t) = p0 + t(p1-p0)
Find intersection point of line and plane
first combine
βͺ the parametric representation of the line, and
βͺ the implicit equation of plane.
look in book