Post

 Resources 

Console


Heres some code Carl (6 replies, 0 views) (2000-Jul-24)
-
Heres the code, you might need to swap a couple of vertices around, but it should be OK. Obviously you don't want to do the Sin and Cos calculations every time, just do it once and store them in a variable. Infact this can be optimised alot because a lot of the math is repeated. Width and Height = The dimensions of the image. Angle = Angle rotated by. Position = coordinates of the center of the image. Vertex(0).X = -Width * Cos(Angle) - Height * Sin(Angle) + Position.X Vertex(0).Y = -Width * Sin(Angle) + Height * Cos(Angle) + Position.Y Vertex(1).X = Width * Cos(Angle) - Height * Sin(Angle) + Position.X Vertex(1).Y = Width * Sin(Angle) + Height * Cos(Angle) + Position.Y Vertex(2).X = Width * Cos(Angle) + Height * Sin(Angle) + Position.X Vertex(2).Y = Width * Sin(Angle) - Height * Cos(Angle) + Position.Y Vertex(3).X = -Width * Cos(Angle) + Height * Sin(Angle) + Position.X Vertex(3).Y = -Width * Sin(Angle) - Height * Cos(Angle) + Position.Y


-
Up One Level | Back to Forum

RE: Heres some code Stuart Zahn (5 replies) (2000-Jul-24)
RE: Heres some code Adam Hoult (4 replies) (2000-Jul-24)
RE: Heres some code Stuart Zahn (3 replies) (2000-Jul-24)
RE: Heres some code Stuart Zahn (2 replies) (2000-Jul-24)
RE: Heres some code Spaghetti (1 reply) (2000-Jul-31)
RE: Heres some code Stuart Zahn (0 replies) (2000-Jul-31)

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 51 visitors within the last 20 minutes
RSS News Feed