Results 1 to 3 of 3

Thread: Sprites, Etc.

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2003
    Location
    Conneaut, Ohio USA
    Posts
    13

    Sprites, Etc.

    To add 2D sprites to a program, you could make a rectangle with the texture of the character, right? Well, how do you get rid of that background in the image of the character, leaving only the character?

    Do you need some sort of mask?

    Could someone explain how to do this? Plus, I'm still a little crappy on how to do bitmap textures...I read some of NeHe's tutorials, and some other ones, but I'm still kinda lost.

    I still don't really understand how exactly OpenGL and Win32 work. Does everyone actually remember all that crap you need to set up the window, or do they just usually copy and paste it?

    From what I understand,(please correct me if I'm wrong) but OpenGL is a library you can use to 'tap' into your comp's GDI with a Rendering Context, via some sorta of Device Context?

    Anywho, do you know where I could possibly find some OpenGL tutorials that even a total idiot would understand? I've done C++ for a little while, and I know how to make DOS apps and such, and I'm comfortable with the rules and regs of the language for the most part, but this whole OpenGL thing confuses me a little.(mainly the setting up of the window, I guess)
    -Krak

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Sprites, Etc.

    It is called an alpha mask, in whick area's on the mask are made transparent.

    Nehe has a very good tutor on it, lesson 32 show's you how to do just what you have asked.

    If you are lost you need to start at lesson 1 and work your way up.

    Back to the Alpha mask, I use Paint Shop pro to create my texture with a Alpha channel.

    I sure there maybe other programs that will let you do this, but paint shop pro I know does.

    Just bring in the image you want to create a mask from and use the mask tool, then save the alpha mask. I use TGA format since it supports alpha mask, else you would have to create two BMP files, one the image file and the other the mask file.

    You may want to look at using GLUT library to create your window, very easy to use and understand.
    I have sample programs using GLUT on my website.
    www.angelfire.com/linux/nexusone/

    Originally posted by Krak:
    To add 2D sprites to a program, you could make a rectangle with the texture of the character, right? Well, how do you get rid of that background in the image of the character, leaving only the character?

    Do you need some sort of mask?

    Could someone explain how to do this? Plus, I'm still a little crappy on how to do bitmap textures...I read some of NeHe's tutorials, and some other ones, but I'm still kinda lost.

    I still don't really understand how exactly OpenGL and Win32 work. Does everyone actually remember all that crap you need to set up the window, or do they just usually copy and paste it?

    From what I understand,(please correct me if I'm wrong) but OpenGL is a library you can use to 'tap' into your comp's GDI with a Rendering Context, via some sorta of Device Context?

    Anywho, do you know where I could possibly find some OpenGL tutorials that even a total idiot would understand? I've done C++ for a little while, and I know how to make DOS apps and such, and I'm comfortable with the rules and regs of the language for the most part, but this whole OpenGL thing confuses me a little.(mainly the setting up of the window, I guess)


  3. #3
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    477

    Re: Sprites, Etc.

    Check on my Website, I've a little example for displaying a sprite.
    www.slug-production.be.tf

Similar Threads

  1. Sprites
    By johnnyp05 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-11-2005, 06:36 AM
  2. Sprites
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-12-2002, 12:26 PM
  3. Sprites, what are they?
    By lobstah in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 09-07-2001, 12:12 PM
  4. Sprites
    By in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 04-29-2001, 11:04 AM
  5. Sprites
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-17-2000, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean