1

Where would you use a vector projection in game development. I know that it projects one vector to another, but I don't know where would I use that.

Regards

4

1 回答 1

2

Here are a few examples:

Vector projection is common in computer graphics, which many games depend on.

In 3D games, during the rendering process the renderer has access to the 3D coordinates of every vertex of every mesh in the game world. These vertices need to be mapped onto a 2D rectangle that's the same shape as your screen. A projection matrix coincidentally called the Projection Matrix does this.

Sometimes projection matrices are used make objects cast shadows onto the surfaces of other objects.

Or suppose you're making a homing missile with a 60-degree field of view. You could say that the missile sees the world through a circular screen, and it loses track of its target if its target goes off the screen. You could use a projection matrix to map the 3D position of the target onto the homing missile's screen, and then decide whether the missile can see the target.

于 2013-03-10T22:59:08.643 回答