O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required