Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

3d game programming

garwaingarwain Posts: 297Member
I've been toying with ideas for a game, and have got code in both VC++ and Delphi that generates a 3d world using OpenGL to display bitmaps and allow the player to walk around using the arrow keys. (soon going to add in the mouse as well)

Anyone have ideas on how to make sprites (have some critters to hack away at)? I was thinking about making them with 3D Studio Max, but i'm not sure yet. What have you seasoned 3d programmers done to solve the problem of making sprites walk around and do some action ie. swing a sword, lie down, stand up etc?

Any ideas are appreciated

Comments

  • gautamgautam Posts: 642Member
    Hey,
    You pack a set of bytes(4 bytes packing) into a character array and use glBitmap to make sprites, here below is an example of a smiley sprite.

    static GLubyte smiley[] = /* 16x16 smiley face */
    {
    0x03, 0xc0, 0, 0, /* **** */
    0x0f, 0xf0, 0, 0, /* ******** */
    0x1e, 0x78, 0, 0, /* **** **** */
    0x39, 0x9c, 0, 0, /* *** ** *** */
    0x77, 0xee, 0, 0, /* *** ****** *** */
    0x6f, 0xf6, 0, 0, /* ** ******** ** */
    0xff, 0xff, 0, 0, /* **************** */
    0xff, 0xff, 0, 0, /* **************** */
    0xff, 0xff, 0, 0, /* **************** */
    0xff, 0xff, 0, 0, /* **************** */
    0x73, 0xce, 0, 0, /* *** **** *** */
    0x73, 0xce, 0, 0, /* *** **** *** */
    0x3f, 0xfc, 0, 0, /* ************ */
    0x1f, 0xf8, 0, 0, /* ********** */
    0x0f, 0xf0, 0, 0, /* ******** */
    0x03, 0xc0, 0, 0 /* **** */
    };

    glBitmap(16, 16, 8, 8, 0, 0, smiley);

    (Unpacking is done from bottom to top, so make the array(the picture) upside down.


    : I've been toying with ideas for a game, and have got code in both VC++ and Delphi that generates a 3d world using OpenGL to display bitmaps and allow the player to walk around using the arrow keys. (soon going to add in the mouse as well)
    :
    : Anyone have ideas on how to make sprites (have some critters to hack away at)? I was thinking about making them with 3D Studio Max, but i'm not sure yet. What have you seasoned 3d programmers done to solve the problem of making sprites walk around and do some action ie. swing a sword, lie down, stand up etc?
    :
    : Any ideas are appreciated
    :


Sign In or Register to comment.