82 lines
2.8 KiB
C++
82 lines
2.8 KiB
C++
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
$SP,"<1>",1$
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
U0 RotateTank()
|
||
{
|
||
F64 é,è,ê;
|
||
CDC *dc=DCAlias;
|
||
DocClear;
|
||
DCAllocDepthBuf(dc);
|
||
dc->flags|=DCF_TRANSFORMATION;
|
||
SetWinHorz(TEXT_COLS/2-12,TEXT_COLS/2+12);
|
||
SetWinVert(TEXT_ROWS/2-12,TEXT_ROWS/2+12);
|
||
try {
|
||
while (!ScanChar) {
|
||
DCDepthBufRst(dc);
|
||
|
||
é=0.25*Sin(tT/10*2*ã)-ã/2;
|
||
è=0.4*Sin(tT/5*2*ã);
|
||
ê=0.25*Sin(tT/10*2*ã)+ã/2;
|
||
|
||
GrIdentEqu(dc->r);
|
||
GrRotYEqu(dc->r,ê);
|
||
GrRotXEqu(dc->r,è);
|
||
GrRotZEqu(dc->r,é);
|
||
GrSetRotMat(dc,dc->r);
|
||
|
||
dc->x=Fs->win_pixel_width/2;
|
||
dc->y=Fs->win_pixel_height/2;
|
||
//This offsets the image Z so that no parts are
|
||
//not drawn because they are in front of the screen.
|
||
dc->z=GR_Z_ALL;
|
||
|
||
SpritePlot3(dc,0,0,0,$IB,"<1>",1$);
|
||
WinMgrSync;
|
||
DCFill;
|
||
}
|
||
} catch
|
||
CatchAll;
|
||
|
||
DCFill;
|
||
DCDel(dc);
|
||
}
|
||
|
||
RotateTank;
|
||
|