cocoa2d-x camera类中  setEyeXYZ(0,0,0.1);setCenterXYZ(0,0,0);setUpXYZ(0,1,0);对应gluLookAt(eyex,eyey,eyez,centerx,centery,centerz,upx,upy,upz);。

要移动相机,并不会发生错乱 需要把观察点和被观察点的做相同的移动

 

即在 touchMove事件中 计算出偏移量 x,y   

    cx-=x;
    cy-=y;
    this->getCamera()->setEyeXYZ(cx,cy,0.1);
    this->getCamera()->setCenterXYZ(cx,cy,0);
实现相机的移动

 

相关文章:

  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2021-08-24
  • 2021-11-08
  • 2021-08-16
  • 2022-12-23
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-04-20
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案