Results 1 to 4 of 4

Thread: Manual Rotation

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    55

    Manual Rotation

    anyone know a good site or article on doing rotation when bliting a direct draw surface to another?? or even a basic formula to get me started?

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I believe the formula is...

    For X: NewX = Cos(Rotation_Radian) * (Width / 2 - X)
    For Y: NewY = Sin(Rotation_Radian) * (Height / 2 - Y)

    I'm not too sure on that, and that method can also cause rotation holes, so be careful.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    15
    Pi = 3.14159265

    X = Radias * Sin((Angle * Pi) / Total Point in Circle E.g 360 for degrees

    Y = Radias * Cos((Angle * Pi) / Total Point in Circle E.g 360 for degrees


    Original PostionX = Original PositionX + X
    Origanal Position Y = Original Position Y - Y

    Hope it Help But it doesnt Rotate an image thats a different story!

    Ask if you need help on that but i cant be bothered to write it if i dont need to

    Bodwad
    Wahoo i know something or not as the case may be

  4. #4
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Originally posted by Sastraxi
    and that method can also cause rotation holes, so be careful.

    To get rid of the holes, do the opposite. Instead of copying every pixel from the source to the destination, loop trough the destination rectangle and get the source pixel. You might end up with the same pixel on two destination places, but that's what fills the holes

    I've got an URL on that technique too somewhere, although it is Delphi code the theory is the same for VB...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

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