Dr_Doggy
Well-Known Member
yes, the mirror is example of another potential rotation axis , this structure will work for basic 90/180/270 degree rotations, more may be required depending on the level of complexity you want, how you want to issue rotation instruction, and how often you want to rotate.... by putting it here in charput, we are rotating per character...
Code:
void charput(int ch, int x, int y, int z, int simple_axis) //relies on pixel!
{
int x1, y1;
int disp;
int disp2;
for ( x1 = 0; x1 < 8; x1++) // eight rows
{
disp = cubefont[x1 + (ch * 8)]; //look data from fontmap,
for (y1 = 0; y1 < 8; y1++) // eight pixels
{
disp2 = disp & 1 << y1;
if (disp2 > 0)
{
if (simple_axis==1){ pixel(z, x + x1, y + y1, 0); // OR the pixel to the display buffer}
else if (simple_axis==2){ pixel(y + y1, z, x + x1, 0); // OR the pixel to the display buffer}
else if (simple_axis==3){ pixel(x + x1, y + y1, z, 0); // OR the pixel to the display buffer}
else if (simple_axis==4){ pixel(x + x1, y + y1, (7-z), 0); // OR the pixel to the display buffer}
}
}
}
}