opengl高手这里看过来(关于gluLookAt)!!!!!!!!!!(50分)

  • 主题发起人 主题发起人 隐儿
  • 开始时间 开始时间

隐儿

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);

}
 
switch
{
case Key_*****;
default:CView::OnKeyDown;
}
u should be sure that your lookat position is <Strong>Right</Strong>.
 
接受答案了.
 
后退
顶部