Thread: Bitmap Rotation System Questions

  1. #1
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195

    Bitmap Rotation System Questions

    Tell me if this will work:

    Ok so for the game i am making i have a sprite class, within the class i have the two bitmaps. The first bitmap is just the legs of my sprite guy and the second bitmap is the upper body of my sprite guy, both bitmaps are the same size and have the same position. I set it up like this becouse i just want the upper body of my guy to rotate so i had to make the center of that bitmap at the waist. now i am thinking that i will first draw the first bitmap then rotate the DC with SetWorldTransform, tell me if this is the right thing to use, and draw the second bitmap with the same coordinates. Can i use the same corrdinates as i would normally with a not rotated DC? The amount of rotation will be determined by the last mouse position with the current one, so i can tell if they moved the mouse up or down and subtract or add to the angle accordingly. can some one also tell me what the best sin and cos functions will work for this the best. This is all Win32Api.

    Sorry if this question seems very spread out and sloppy but thanks for any replies.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I don't recommend using the API for this. Rotating bitmaps in the GDI is extremely slow as it was built for versatility, not speed.

    If you could get access to the DC and get a pointer to the actual surface that represents the DC, I'd advise creating your own polygon fill from texture functions and simply use a triangulated quad.

    But again using GDI you won't be able to do this and you probably will work more against the API than with in order to do what you want.

    I recommend OpenGL or Direct3D.

  3. #3
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    Thanks alot Bubba i have started learning DirectX so i guess i will just save this type of thing untill i get more into it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. camera rotation matrix
    By Vick jr in forum Game Programming
    Replies: 5
    Last Post: 05-26-2009, 08:16 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Loading a bitmap (Without using glaux)
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 03-16-2006, 09:43 AM
  4. Bitmap rotation
    By dwks in forum Game Programming
    Replies: 6
    Last Post: 01-11-2006, 01:24 AM
  5. system software....many questions
    By planet_abhi in forum Tech Board
    Replies: 4
    Last Post: 04-26-2003, 03:52 AM