I am trying to create a program that renders vector graphics where sprites are an array that consists of alternating angles and radii. One such array looks like this
double v[] = {170,10,180,15,190,10};
That is a V shape
the function I have for drawing these is having some issues but here's the code:
Code:
double v[] = {170,10,180,15,190,10};
That is a V shape
the function I have for drawing these is having some issues but here's the code:
Code:
void draw(float x, float y, int angle)
{
tmp = 0;
while(tmp < (sizeof(v)/2) - 2)
{
int linex1 = floor(x + ((-(v[tmp + 1])) * cos(((v[tmp]) - angle) * (M_PI / 180))));
int liney1 = floor(x + ((-(v[tmp + 1])) * sin(((v[tmp]) - angle) * (M_PI / 180))));
int linex2 = floor(x + ((-(v[tmp + 3])) * cos(((v[tmp + 2]) - angle) * (M_PI / 180))));
int liney2 = floor(x + ((-(v[tmp + 3])) * sin(((v[tmp + 2]) - angle) * (M_PI / 180))));
gfx_SetColor(0xFF);
gfx_Line(linex1,liney1,linex2,liney2);
tmp = tmp + 2;
}
}