隐
隐儿
Unregistered / Unconfirmed
GUEST, unregistred user!
偶毕业设计要求使用移动的摄像机.但偶用下列代码,却不能得到正确结果,Why?
void CDxfView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{case VK_DOWN:
k_down-=0.2;
gluLookAt(k_left, k_down,page, 0, 0, 0, 0, 1, 0);
case VK_UP:
k_down+=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_LEFT:
k_left-=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_RIGHT:
k_left+=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_PAGE_UP:
page-=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_PAGE_DOWN:
page+=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
}
// TODO: Add your message handler code here and/or call default
CView::OnKeyDown(nChar, nRepCnt, nFlags);
}
void CDxfView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{case VK_DOWN:
k_down-=0.2;
gluLookAt(k_left, k_down,page, 0, 0, 0, 0, 1, 0);
case VK_UP:
k_down+=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_LEFT:
k_left-=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_RIGHT:
k_left+=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_PAGE_UP:
page-=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
case VK_PAGE_DOWN:
page+=0.2;
gluLookAt(k_left, k_down, page, 0, 0, 0, 0, 1, 0);
}
// TODO: Add your message handler code here and/or call default
CView::OnKeyDown(nChar, nRepCnt, nFlags);
}