两个LPDIRECT3DTEXTURE9的每像素碰撞?(Per Pixel Collision for two LPDIRECT3DTEXTURE9?)

编程入门 行业动态 更新时间:2024-10-21 11:30:57
两个LPDIRECT3DTEXTURE9的每像素碰撞?(Per Pixel Collision for two LPDIRECT3DTEXTURE9?)

我搜索过但没有发现任何与C ++代码和DX LPDIRECT3DTEXTURE9 ,我能找到的是其他引擎的每像素冲突,我需要原生的东西,现在我有一个边界框碰撞,按预期工作,但你知道当碰撞发生在两个alpha像素之间时,它也会将其报告为true,因此我需要增强它并按像素进行渲染。

所以目前我有两个Rects和两个LPDIRECT3DTEXTURE9 ,有了intersectRect函数我可以知道是否有碰撞,那么我需要进一步处理lockRect和pbits,但似乎我无法弄明白。

谢谢

I have searched and haven't found anything related to C++ code and DX LPDIRECT3DTEXTURE9, all i can find is per pixel collisions for other engines, i need something native , now i have a bounding box collisions which works as expected, but as you know when the collision happens between two alpha pixels it will also report it as true, so i need to enhance it and make it per pixel.

So currently i have two Rects and two LPDIRECT3DTEXTURE9, with intersectRect function i can know if there is a collision, then i need go further by dealing with lockRect and pbits but seems i cannot figure it out.

Thanks

最满意答案

没关系,我解决它,它与我描述的方式相同,锁定并循环在pbits上。

Never mind, i solve it, its the same way i described, lockrect and loop over pbits.

更多推荐

本文发布于:2023-08-07 03:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1460761.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:像素   两个   Collision   Pixel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!