本文整理汇总了C++中FnObject::Rotate方法的典型用法代码示例。如果您正苦于以下问题:C++ FnObject::Rotate方法的具体用法?C++ FnObject::Rotate怎么用?C++ FnObject::Rotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FnObject
的用法示例。
在下文中一共展示了FnObject::Rotate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PivotCam
/*------------------
pivot the camera
C.Wang 0329, 2004
-------------------*/
void PivotCam(int x, int y)
{
FnObject model;
if (x != oldX) {
model.ID(cID);
model.Rotate(Z_AXIS, (float) (x - oldX), GLOBAL);
oldX = x;
}
if (y != oldY) {
model.ID(cID);
model.Rotate(X_AXIS, (float) (y - oldY), GLOBAL);
oldY = y;
}
}
示例2: GameAI
//------------------------------------------------------------------------------------
// timer callback function which will be invoked by TheFly3D System every 1/30 second
// C.Wang 0308, 2004
//------------------------------------------------------------------------------------
void GameAI(int skip)
{
if (mmID != FAILED_ID) {
FnMedia md;
md.Object(mmID);
if (md.GetState() == MEDIA_STOPPED) {
// after playing, delete the media object
FyDeleteMediaPlayer(mmID);
mmID = FAILED_ID;
}
else {
return;
}
}
FnLight lgt;
lgt.Object(lID);
lgt.Rotate(Z_AXIS, 0.5f, GLOBAL);
FnObject model;
model.Object(nID);
model.Rotate(Z_AXIS, 3.0f, GLOBAL);
// render the scene
FnViewport vp;
vp.Object(vID);
vp.Render3D(cID, TRUE, TRUE);
// show frame rate
static char string[128];
if (frame == 0) {
FyTimerReset(0);
}
if (frame/10*10 == frame) {
float curTime;
curTime = FyTimerCheckTime(0);
sprintf(string, "Fps: %6.2f", frame/curTime);
}
frame += skip;
if (frame >= 1000) {
frame = 0;
}
FySwapBuffers();
}