Jump to content

April 2017 »

S M T W T F S
      1
2345678
9101112131415
16171819202122
232425 26 272829
30      

Recent Entries

Recent Comments

Latest Visitors

- - - - -

A Look-At Camera in SlimDX and Direct3D 11


C# SlimDX Direct3D 11 Third-person camera
4: Adsense


Today, we are going to reprise our Camera class from the Camera Demo. In addition to the FPS-style camera that we have already implemented, we will create a Look-At camera, a camera that remains focused on a point and pans around its target. This camera will be similar to the very basic camera we implemented for our initial examples (see the Colored Cube Demo). While our FPS camera is ideal for first-person type views, the Look-At camera can be used for third-person views, or the “birds-eye” view common in city-builder and strategy games. As part of this process, we will abstract out the common functionality that all cameras will share from our FPS camera into an abstract base camera class.



The inspiration for this example come both from Mr. Luna’s Camera Demo (Chapter 14 of Frank Luna’s Introduction to 3D Game Programming with Direct3D 11.0), and the camera implemented in Chapter 5 of Carl Granberg’s Programming an RTS Game with Direct3D. You can download the full source for this example from my GitHub repository at https://github.com/ericrrichards/dx11.git under the CameraDemo project. To switch between the FPS and Look-At camera, use the F(ps) and L(ook-at) keys on your keyboard.


Posted Image


Read More...

Note: GameDev.net moderates comments.