• Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About terrysworkstations

  • Rank

Personal Information

  • Interests
  1. Shader Resource Binding

    Hello, I am trying to set some shader values in a cbuffer. Im not getting any response or values. My code is: cbuffer MatrixBuffer : register(b0) { float4 test; }; ------------------------------------------------- #pragma pack(push,1) struct CB_GBUFFER_UNPACK { D3DXVECTOR4 test; }; #pragma pack(pop) ------------------------------------------------- D3D11_BUFFER_DESC cbDesc; ZeroMemory( &cbDesc, sizeof(cbDesc) ); cbDesc.Usage = D3D11_USAGE_DYNAMIC; cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; cbDesc.ByteWidth = sizeof( CB_GBUFFER_UNPACK ); device->CreateBuffer( &cbDesc, NULL, &m_pGBufferUnpackCB ); D3D11_MAPPED_SUBRESOURCE MappedResource; ic->Map( m_pGBufferUnpackCB, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ); CB_GBUFFER_UNPACK* pGBufferUnpackCB = ( CB_GBUFFER_UNPACK* )MappedResource.pData; pGBufferUnpackCB->test.x = 10.0f; pGBufferUnpackCB->test.y = 10.0f; pGBufferUnpackCB->test.z = 10.0f; pGBufferUnpackCB->test.w = 0.0f; ic->Unmap( m_pGBufferUnpackCB, 0 ); ic->PSSetConstantBuffers( 0, 1, &m_pGBufferUnpackCB ); What is wrong?
  2. Assimp Object

    Ok seem to get the distortion working now. No stretching. Is there a way to invert indices on assimp?
  3. Assimp Object

    I switched to Assimp for loading models in directx 11. The image seems to strectch and stuff for some reason.In the picture , the tail like gets real big and the front of the image gets smaller when it gets closer to the camera than it should be. Does anyone know why this Is happening. Also I can see through the fish on certain angles. Does this have to do with left/right handed coordinate systems?
  4. Bone offsets Matrix

    Trying to get Bone Offsets. I have blend weights and indices. How can I get bone offsets.
  5. Have to rotate 180 and flip horizontal to work

    I solved it. Thx
  6. Textures in Directx 11

    Alright h8cplusplusGuru, got it. thx
  7. Textures in Directx 11

    I still cannot get it to work even after the steps above. BTW, im using blender.
  8. Textures in Directx 11

    I use the regular image now(not rotated or flipped), and negated the x. Did not work though. I negated the y uv and almost works accept as seen, the text is backwards.
  9. Textures in Directx 11

    Im in DirectX 11 using the D3DX11CreateShaderResourceViewFromFile for textures. I have to rotate texture file 180 and flip horizontal in Mspaint for the texture to fit on the object. SO when I have a .obj object with text, it will be backwards like in the image. I have to rotate and flip with all objects that have textures.Does anyone know how to fix the issue?
  10. Im downloading .obj to put in a game. I have to rotate and flip the texture for it to look right on the object! So when there is text on the object, it will be backwards. Im in Blender. How can I fix this issue? Im in directx 11 also
  11. System memory copy of vertices/mesh

    I needed a system memory copy of the vertices for AABB Collision so I can update there min/max because I only have static vertices access. How can I do this. Im in directx 11. c++. As my object translates, I need to calculale the new AABB min/max and I cant get to the vertices. void IvAABB::Set( const IvPoint3* points, unsigned int numPoints) { ASSERT( points); // compute minimal and maximal bounds mMinima.Set(points[0]); mMaxima.Set(points[0]); for (unsigned int i = 1; i < numPoints; ++i) { if (points[i].x < mMinima.x) mMinima.x = points[i].x; else if (points[i].x > mMaxima.x) mMaxima.x = points[i].x; if (points[i].y < mMinima.y) mMinima.y = points[i].y; else if (points[i].y > mMaxima.y) mMaxima.y = points[i].y; if (points[i].z < mMinima.z) mMinima.z = points[i].z; else if (points[i].z > mMaxima.z) mMaxima.z = points[i].z; } }
  12. Precision Problems with bouding sphere

    Alright, I got to work. thx
  13. Precision Problems with bouding sphere

    I tried to make two spheres with bounding sphere to detect collision so they stop when they collide. But it seems that im having a precision issue. They stey stuck together because of small decimal keeping it stuck. Is there a way around this? Since they are in a 3d space, adding or subtracting a little off seems impossible and expensive. How can I solve these precision issues? The code I used. oldleftright = leftright, oldupdown = updown; if(GetAsyncKeyState(VK_RIGHT)) leftright += 0.0001; if(GetAsyncKeyState(VK_LEFT)) leftright -= 0.0001; if(GetAsyncKeyState(VK_DOWN)) updown -= 0.0001; if(GetAsyncKeyState(VK_UP)) updown += 0.0001; collide = test.Intersect(test2); if (collide) { leftright = oldleftright; updown = oldupdown; } collide = false;
  14. Bounding Sphere for collision Detection

    Alright _Silence_,MarcusASeth, got it to collide right. Thx
  15. Bounding Sphere for collision Detection

    I want to know the steps so I can create a bounding sphere on a object so when I get close, it will collide and will not intersect the object. I think my main question is..Will I get the distance of the radius and the center of my object to detect this? Second, do I run this function below on all the vertices of the object? I just need the steps. The code snippet I got is: void IvBoundingSphere::Set( const IvVector3* points, unsigned int numPoints ) { ASSERT( points ); // compute minimal and maximal bounds IvVector3 min(points[0]), max(points[0]); unsigned int i; for ( i = 1; i < numPoints; ++i ) { if (points[i].x < min.x) min.x = points[i].x; else if (points[i].x > max.x ) max.x = points[i].x; if (points[i].y < min.y) min.y = points[i].y; else if (points[i].y > max.y ) max.y = points[i].y; if (points[i].z < min.z) min.z = points[i].z; else if (points[i].z > max.z ) max.z = points[i].z; } // compute center and radius mCenter = 0.5f*(min + max); float maxDistance = ::DistanceSquared( mCenter, points[0] ); for ( i = 1; i < numPoints; ++i ) { float dist = ::DistanceSquared( mCenter, points[i] ); if (dist > maxDistance) maxDistance = dist; } mRadius = ::IvSqrt( maxDistance ); } Just need a basic idea on how to do this. Thank you