3Д БУМ

3Д принтеры и всё что с ними связано

Vector Arithmetic

You can perform all sorts of math with vectors. You can add them, subtract them, multiply them by scalars (constant numbers) to change their magnitude, and much more. This comes into play in

^ ^ J

t/ = <3,4>

It/I = V 32 + 42 = 5

v=— = <0.6,0.8>

It/I

v = VO-62 + 0.82 = 1

Figure 1.16 Finding the magnitude of a vector and using it to convert the original vector to a normal vector. Here, v is a vector that needs to be reduced down to a unit vector. As you can see, the current magnitude of v is 5. To calculate the unit vector u from v you divide each component of v by the magnitude of v, in this case 5. You can check it out at the end by calculating the magnitude of u; it should be 1.

3D programming when you’re moving players or other objects around onscreen. You use vectors to do this because vectors can store both the magnitude and direction, both of which are needed before you can calculate the new position of a player or object. This section covers vector arithmetic. You will learn how to work with vectors and how to do all of the basic vector operations needed for graphics programming.

Для любых предложений по сайту: [email protected]