Graphics Reference
In-Depth Information
class CTutorialDlg : public CDialog {
.
A: virtual BOOL OnInitDialog(); // MFC function to initialize the application
private :
B: CDrawHandler m _ MainView; // camera that renders the large view on the left
CDrawHandler m _ SmallView; // camera that renders the smaller view to the lower right
.
C: CCameraControl m _ CameraControl; // The Pop-up camera control
.
BOOL CTutorialDlg::OnInitDialog() {
D: if (!m _ MainView.Initialize( ... IDC _ GRFX _ PLACEHOLDER) ) ...
if (!m _ SmallView.Initialize(... IDC _ SMALLVIEW _ PLACEHOLDER) ) ...
E: m _ CameraControl.Create(IDD _ CAMERACONTROL _ DIALOG ...); // create the camera GUI control
m _ CameraControl.ShowWindow(SW _ HIDE); // initialy do not show the control
m _ CameraControl.SetCamera(&(m _ MainView.GetCamera())); // default to control main view camera
F: m _ MainView.GetCamera()...
. // initialize cameras and GUI controls
Source file.
TutorialDlg.h/cpp
files
in
the
Source Files
and
Header Files folders
of
the
void CTutorialDlg::OnTimer(UINT nIDEvent) {
G: m _ MainView.DrawGraphics(); // render for the main view
m _ SmallView.DrawGraphics(); // render for the small view
D3D _ TwoCamera project.
}
Listing 15.11. The CTutorialDlg class of Tutorial 15.2.
• The near/far planes bound the rendering computation and have no physical-
world analogy.
• The FOV describes the zoom on a telephoto lens, where in our case, the
exact same effect can be accomplished by physically moving the camera
position toward (or away from) the look-at position.
• The up vector anchors the sense of orientation for the observer and is rarely
altered.
In this way, when discussing interactive movement of the camera, we typically
pay attention to the camera and the look-at positions. This is not surprising, for
Search WWH ::




Custom Search