Jump to content
  • Advertisement

TheRocket

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

106 Neutral

About TheRocket

  • Rank
    Newbie
  1. TheRocket

    [D3D11] Scoring based on collision

    OK so my plan was to grab the x,y,z in projection space of where ball is when a AABB collision is detected. What i'm stuck on is how do I get those coordinates into something useful. If I unproject into the targets model space will that give me something I can then try to use? I tried it and it seems to give me garbage. Are there any articles on this? I found this thread http://groups.google.com/group/cocos2d-iphone-discuss/browse_thread/thread/f6e734e00d863f5e/41768952a1bcca0e?lnk=gst&q=image+mask&pli=1 which is basically what I want to do but i'm not sure why he is able to use the coordinates without performing any transformations. Thanks,
  2. TheRocket

    [D3D11] Scoring based on collision

    Ping Can anyone help me with this? Is there a better way of doing it?
  3. Hi all, I'm struggling to understand a way to implement a simple scoring system based of where the collision occurred. I currently have a ball (mesh sphere) hitting a target (sprite) using AABBs. The problems I'm trying to solve are: 1) How to avoid raising a collision for transparent sprites (i.e. my target is 256x256 and a majority of it is transparent) 2) How to detect where the ball hit the target and update the score accordingly (e.g. bullseye is worth more than outer edge) I thought I could solve both these problems by creating a hit map which is basically color coded to indicated score (bullseye is red, outer edge is blue) that I would check during a collision. I thought I could use this same procedure to check the alpha to see if I had a legitimate collision. I created a staging texture to hold my hit map but I don't think there is any way to transform the world-space coordinates of the collision into something useful that I can use to figure out what pixel in my hit map was hit. Was I on the right track and is there a way to figure out the right coordinates in my hit map, or is there another way of doing this? Thanks,
  4. Sure I've attached it. It's just a file that contains 2 pixels that was saved as A8R8G8B8 since I was playing around to figure out how the color information was being surfaced. Based on the DDSTextureLoader.cpp that they've provided it seems to be determining the DXGI_FORMAT based of the DDS_PIXELFormat. Here is the snippet of code that is returning the DXGI_FORMAT: static DXGI_FORMAT GetDXGIFormat( const DDS_PIXELFORMAT& ddpf ) { if (ddpf.flags & DDS_RGB) { // Note that sRGB formats are written using the "DX10" extended header switch (ddpf.RGBBitCount) { case 32: if (ISBITMASK(0x000000ff,0x0000ff00,0x00ff0000,0xff000000)) { return DXGI_FORMAT_R8G8B8A8_UNORM; } if (ISBITMASK(0x00ff0000,0x0000ff00,0x000000ff,0xff000000)) { return DXGI_FORMAT_B8G8R8A8_UNORM; } if (ISBITMASK(0x00ff0000,0x0000ff00,0x000000ff,0x00000000)) { return DXGI_FORMAT_B8G8R8X8_UNORM; } Here is the DDS_PIXELFORMAT for the attached .dds: ddpf = size: 32 flags: 65 fourCC: 0 RGBBitCount: 32 RBitMask: 16711680 GBitMask: 65280 BBitMask: 255 ABitMask: 4278190080 When I step through the code it's the second if that is returning the format. This is all a little over my head since i'm not really sure what it's even checking for. What I assume though is that because i'm using their code i'm at least guaranteed that the .dds I've attached will always come back with that format...please correct me if i'm wrong. Thanks,
  5. Hi all, I'm playing around with D3D11 for Windows 8 Metro and I'm loading a DDS into a staging ID3D11Resource that I map to a D3D11_MAPPED_SUBRESOURCE so I can access the color information. When I get the D3D11_TEXTURE2D_DESC it reports the Format as DXGI_FORMAT_B8G8R8A8_UNORM but when I created the DDS it was in A8R8G8B8. Can someone explain why it changes and if its guaranteed to always change consistently to B8G8R8A8? Thanks,
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!