Sign in to follow this  

How do I build/implement a bitmask?

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I keep getting stuck, getting half inspired, then getting stuck and leaving it again. My aim is to basically create a swept-area collision detection routine, as shown here. I'd be checking the entire grey + blue + dark blue area against the tiles with dark brown in them. I don't know the general gist of doing bitmasking in the first place, and these questions come to mind: 1. Can I create and store a 1-bit bitmap? Because I only want each pixel to have a yes/no value. 2. Can I do this in Direct3D, or do I need some other library? So far I've got pretty things that move and spin, using D3D. 3. If the surface is built from those 1-bit tiles, how do I pluck out a specific tile and prepare it for bitmask testing? 4. Can I create a dynamic bitmask on the fly? For example, the grey rectangle, or one tile-bounded piece of the grey rectange. I don't know how much sense those questions make, but thanks for any replies.

Share this post


Link to post
Share on other sites
Quote:
Original post by Defend
1. Can I create and store a 1-bit bitmap? Because I only want each pixel to have a yes/no value.
Yes, there are monochrome bitmaps.

Quote:
3. If the surface is built from those 1-bit tiles, how do I pluck out a specific tile and prepare it for bitmask testing?
You can't really, but if you put the tile, you should be able to calculate where that tile is.

Quote:
4. Can I create a dynamic bitmask on the fly? For example, the grey rectangle, or one tile-bounded piece of the grey rectange.
I've never used DirectX, so I can't tell you, look at the converting function and see if they dither.

Share this post


Link to post
Share on other sites

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this