Click here to Skip to main content
15,886,101 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone

How do i access the TRANSFORMED pixel data for a texture, after it has been transformed by D3DXMatrixTransformation2D() and texture->SetTransform()?

I'm trying to do 2D pixel perfect collision detection and it's impossible if you can only access the untransformed pixel data using texture->LockRect().

Anybody got any ideas?
Posted
Comments
AndreFratelli 2-Jul-11 2:06am    
I don't really know D3D, only OpenGL. But still, why would you need to access the texture's data to detect collisions? I recently wrote a collision detection system, and I think you are taking the wrong approach here. Have you considered other options to "pixel" collision detection? Bound-boxes, Octrees, Triangle-triangle collisions..

Anyway, whenever you want something transformed, you better transform it in CPU (assuming you are not transforming ** everything ** in a mesh, instead of just whatever needs to be checked).

regards

1 solution

paint it on a memory dc and do GetPixel()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900