Computer Graphics Geometric Objects and Transformations

Post on 30-Dec-2015

25 views 2 download

description

Computer Graphics Geometric Objects and Transformations. Identical vectors. Scalars, Points, and Vectors :. A scalar is a magnitude only. Ex: -3.5. - PowerPoint PPT Presentation

Transcript of Computer Graphics Geometric Objects and Transformations

Computer GraphicsGeometric Objects and Transformations

Scalars, Points, and Vectors:

A scalar is a magnitude only. Ex: -3.5

A vector is a magnitude and a direction. Vectors are represented pictorially as a DIRECTED LINE SEGMENT. The length of the vector represents its magnitude.

Identical vectors

Scalars, Points, and Vectors:

Two vectors are ADDED using the HEAD-TO-TAIL rule, and addition is commutative.

A vector is NOT ANCHORED in space. A POINT is anchored in space as the HEAD of a vector extending outward from the ORIGIN of the space.

Lines:

if P and Q are points in an affine space, the set of points of the form

R(t) =(1- t) P + t Q

form a line passing through P and Q.

Lines:

The parametric form of a line in space is given by:

P( ) = Q + v

Q is the anchor point

v is a vector that points in the direction of the line.

is a scalar that varies

P( ), a function of , is the set of all points along the line passing through Q and having the direction v.

( Note that this notation is slightly different than the text.)

Convexity:

An object is CONVEX if any point on a line segment between any two points in the object is also in the object.

The CONVEX HULL of an object is the smallest convex object which contains the original.

Dot and Cross Products:

The square of the magnitude of a vector v is given by

the dot product:

| v | = v v.2

v v = v v + v v + … + v v2 21 n. 1 n

v =v1

v2

vn

...

Dot and Cross Products:

The cosine of the angle between two vectors u and v is given by

cos 0 = |u | |v|

u v = u v + u v + … + u v2 21 n. 1 nv =

v1

v2

vn

...

.u v

Dot and Cross Products:

The angle between two vectors u and v can also be computed using the magnitude of the cross product

|sin 0| = |u | |v| |u x v|

v =v1

v2

v3

u =u1

u2

u3

u x v = u v - u v 3 22 3

u v - u v 1 33 1

u v - u v 2 11 2

Planes:

if P, Q and R are three points in an affine space, and they are not coliniear, then the plane defined by P, R and Q is:

F(s,t) = (1-s)((1- t) P + t Q)+ s R

A plane can also be described in terms of a point, P, and two non-parallel vectors, u and v

A = P + u + v

Planes:

The plane equation can also be given as follows:

(a,b,c) (x-x0,y-y0,z-z0) = 0

where n = (a,b,c) plane normal

T = (x,y,z) T represents any test point

P = (x0,y0,z0) a known point in the plane

.

Planes:

ax + by + cz + d = 0 ,where d = -(ax0 + by0 + cz0)

If we evaluate the left side for a given point T = (x,y,z) in 3D space and the result is

< 0, T lies beneath the plane

= 0, T lies on the plane

> 0, T lies above the plane

Planes:

A plane can also be described in terms of a point, P, and two non-parallel vectors, u and v

A = P + u + v

A vector, n, which is orthogonal to both u and v can be computed as

n = u x v n