terrysworkstations

Members
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

101 Neutral

About terrysworkstations

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Bone offsets Matrix

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

    I solved it. Thx
  3. Textures in Directx 11

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

    I still cannot get it to work even after the steps above. BTW, im using blender.
  5. 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.
  6. 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?
  7. 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
  8. 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; } }
  9. Precision Problems with bouding sphere

    Alright, I got to work. thx
  10. 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;
  11. Bounding Sphere for collision Detection

    Alright _Silence_,MarcusASeth, got it to collide right. Thx
  12. 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
  13. Particle system

    Alright KburtHard84,Zao, I seem to get it working now. Thx
  14. Particle system

    Im trying to do some particle like system of a disc like shape. More of a cube shape comes out though. Vertex vertices[1500]; for (unsigned int i = 0; i < 1500; ++i) { vertices[i].Color = (const float*)&Colors::Red; vertices[i].Pos.x = GenSpherePointCorrect().x; vertices[i].Pos.y = GenSpherePointCorrect().y; vertices[i].Pos.z = GenSpherePointCorrect().z; } s GenSpherePointCorrect() { float r = IvSqrt(rng.RandomFloat()); float theta = kTwoPI*rng.RandomFloat(); float sintheta, costheta; IvSinCos(theta, sintheta, costheta); Vector3 randomPos(2.0f*r*costheta, 2.0f*r*sintheta, 0.0f); return randomPos; }
  15. Ray casting Picking

    Ive converted some code from opengl and need someone to look over the code to see if there are any mistakes. Im in Directx 11 with a LH coordinate system. GetPickRay( float sx, float sy, float fov, float width, float height ) { float d = 1.0f/IvTan(fov*kPI/360.0f); float aspect = width/height; Vector3 viewPoint( 2.0f*aspect*sx/width - aspect, -2.0f*sy/height + 1.0f, d ); viewPoint = mViewToWorldMatrix.TransformPoint( viewPoint ); return viewPoint - mEyePoint; } OnMouseDown(WPARAM btnState, int x, int y) { mLastMousePos.x = x; mLastMousePos.y = y; Vector3 ray = GetPickRay( (float) x, (float) y, 45.0f,(float) mClientWidth,(float)mClientHeight ); // compute intersection with z=0 plane float t = -mEyePoint.z/ray.z; mClick = mEyePoint + t*ray; moveIT = XMMatrixTranslation(mClick.x,mClick.y,mClick.z); SetCapture(mhMainWnd); } Vector3 mUp(0.0f,1.0f,0.0f); Vector3 view = Vector3(0.0f,0.0f,0.0f) - mEyePoint; Vector3 right; Vector3 viewUp; view.Normalize(); right = view.Cross( mUp ); right.Normalize(); viewUp = right.Cross( view ); viewUp.Normalize(); Matrix33 rotate; //almost similar to a view matrix accept no negating eye point and dotting with uvw rotate.SetRows( right, viewUp, view ); mViewToWorldMatrix.Rotation(rotate); // set translation (eye position) mViewToWorldMatrix(0,3) = mEyePoint.x; mViewToWorldMatrix(1,3) = mEyePoint.y; mViewToWorldMatrix(2,3) = mEyePoint.z;