Results 1 to 2 of 2

Thread: Fast Way To Rotate In 2D

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    80

    Fast Way To Rotate In 2D

    I have been researching this topic for a while and i have found out a fast way to rotate.

    the usual way is to pass all the cor's to a simple

    Xt=X*cos(angle)+Y*Sin(Angle)
    Yt=Y*cos(angle)-X*sin(angle)

    ofcourse its very slow, and even if you precalc the sin cos tables

    a faster way is to rotate the edges and to complete it with Bresenham Line-Drawing Algorythm

    And the easiest way i have found is :

    lets say u want to rotate in 20 deg :

    Xinc=Cos(20*pi/180) ,Yinc=sin(20*pi/180)

    and for every line of the 2d pic u add the X and The Y

    and when u finish the line , u add the x and y the SINCOS of the angle+90

    to go forward


    i got about 500 frames Non Compile version

    even faster is not to draw the black points if your screen back is black
    Got It , Roger And Out

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width