Jump to content
  • Advertisement
Sign in to follow this  
Marmin

pixel-perfect c.d.

This topic is 4775 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

Advertisement
Create a collision mask for each texture with 1's and 0's and apply logic to see if two masks intersect. Do a rectangle test first though of course. Also if you can rotate the sprite this will not work and another method like polygon representation may be preferred.

Share this post


Link to post
Share on other sites
That does seem the fastest and most logical way to do. Accessing the pixels is very slow I guess.

Share this post


Link to post
Share on other sites
Why don't used D3DXMatrixOrthoOffCenterLH which takes the screen width and Height then you can position your Coord at normal 2D Coordinates and still be able to do rotation using The Matrix Transformation that D3D provides and stuff. Then you can use simple 2d bounding box equation for the collision.

Share this post


Link to post
Share on other sites
Also try to take a look at this library: BitMask. I'm sure you can do a little messing with it to get what you need. I've yet to use it yet, but I do know of a few libraries as well as projects it has been used for.

Share this post


Link to post
Share on other sites
Quote:
Original post by BornToCode
Why don't used D3DXMatrixOrthoOffCenterLH which takes the screen width and Height then you can position your Coord at normal 2D Coordinates and still be able to do rotation using The Matrix Transformation that D3D provides and stuff. Then you can use simple 2d bounding box equation for the collision.
I don't understand a heck regarding the whole D3DXMatrixOrthoOffCenterLH to be honest.
It gives a black screen, whatever I do. Do I have to set a camera matrix? I feel like smashing my screen right now: because the MSDN information is as usual wayto short.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!