Vector Mathematics

When determining how a particular triangle should be illuminated, WPF 3D must calculate an angle between two vectors. How does it do this?

The simple answer is that it probably uses the convenient Vector3D.AngleBetween static method, which returns the angle in degrees between its two Vector3D arguments. But I hope you're not satisfied with that answer! Even if you're not very curious about how to calculate an angle between two vectors, as you get deeper into 3D graphics programming, you should try to become more fluent with vector mathematics and at least know the basics of these concepts and calculations.

In this section, I'll be referring to vectors using boldface capital letters, like A and B. These vectors consist of X, Y, ...

Get 3D Programming for Windows® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.