Below is the code to rotate a triangle to specified angle but it can't.
what is the problem?
void draw_image(int ,int ,int,int,int,int);
case 'T' | 't':
case 'R' | 'r':
case 'S' | 's':
case 'e' | 'E':
void draw_image(int a,int b,int c,int d,int e,int f)
line(c, d, e, f);
line( a, b, e, f);
outtextxy(59,467,"T : Translate S : Scale R : Rotate E : Exit");
also i want to get input from user at the bottom of screen what shuold i do?
i dont know how much this will help, but....
i was running into a similar problem rotating a bitmap to point at the mouse cursor. i stressed over a solution and had people from all over trying to figure out how to do it.
then yesterday i was sitting at my computer programming, when it hit me... all of this stuff we were trying to do with vectors and whatever else, i was able to reduce to one line of code.
thats the rotation of the bitmap in radians. i didnt use graphics.h ( which i believe is the borland graphics library, correct me if im wrong ); mine was done in directx. but that one line of code was able to point the bitmap (which was always in the center of the screen) to the mouse pointer.
rotation = - atan2( mouse_y - (screen_height / 2),
mouse_x - (screen_width / 2) );