FT800 Series Programmer Guide
Version 2.1
Document Reference No.: BRT_000030 Clearance No.: BRT#037
227
Copyright © Bridgetek Limited
5.45
CMD_ROTATE - apply a rotation to the current matrix
C prototype
void cmd_rotate( int32_t a );
Parameters
a
Clockwise rotation angle, in units of 1/65536 of a circle
Command layout
+0
CMD_ROTATE(0xffffff29)
+4
a
Examples
To rotate the bitmap clockwise by 10 degrees with respect to the top left of the
bitmap:
cmd(BEGIN(BITMAPS));
cmd_loadidentity();
cmd_rotate(10 * 65536 / 360);
cmd_setmatrix();
cmd(VERTEX2II(68, 28, 0, 0));
To rotate the bitmap counter clockwise by 33 degrees wrt top left of the bitmap:
cmd(BEGIN(BITMAPS));
cmd_loadidentity();
cmd_rotate(-33 * 65536 / 360);
cmd_setmatrix();
cmd(VERTEX2II(68, 28, 0, 0));