|
-
Jan 4th, 2002, 12:59 AM
#1
Thread Starter
Member
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?
-
Jan 4th, 2002, 01:03 AM
#2
Good Ol' Platypus
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)
-
Mar 17th, 2002, 05:09 PM
#3
New Member
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
-
Mar 18th, 2002, 03:51 AM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|