# FireViper

Member

69

129 Neutral

• Rank
Member
1. ## Collision detection with Verlet integration

thanks for clearing everything up. I will check out the article.
2. ## Collision detection with Verlet integration

thanks for the reply serumas, I have a few questions. On the move function, is 'air' a float? Also, what does the 'satisfy_all_objects_constraints' function do?
3. ## Collision detection with Verlet integration

I recently read an article on Verlet integration ([url="http://lol.zoy.org/blog/2011/12/14/understanding-motion-in-games"]http://lol.zoy.org/b...motion-in-games[/url]) and wanted to apply it. It seems to work, but I'm not sure how to use it with my collision detection code. My update function looks something like this: [source lang="cpp"]void State::Update(float dt) { Vector accel = Vector(...) //get accelreation based on user input Vector oldVel = vel; vel += (accel) * dt; pos += (oldVel + vel) * 0.5 * dt; if( if_collision_is_enabled ) { Vector newpos = CollideWithWorld(pos,vel); //get new position //update velocity & position based on the new position vel = newpos - pos; pos = newpos; } }[/source] It seems to work, but the movement isnt as smooth as it is without collision. I assume I'm not updating the velocity and position correctly after the collision. Does anyone know a better way to do this?

thanks for the reply, I swapped the rows and its working.

6. ## player vs player collision

thanks for the reply oliii.I know there are a lot of articles on the net about sphere-to-sphere collision, but the part that confuses me is changing vector spaces. In this article, all points (basePoint, velocity, and the 3 triangle points) are scaled by eSpace before the collisionPoint is detected. When I test against a sphere, do I have to scale the sphere's position and radius as well?
7. ## player vs player collision

I've recently read the Improved Collision detection and Response article, and implemented player-vs-world collision system. I was wondering what is the best way to do play-vs-play collision? Since the "Collision Response" part of the algorithm only needs an intersectionPoint and intersectionDistance, I assume the only thing that needs to change is "Collision Detection" part. If one of the player is defined as a unit sphere(after being scaled by the Ellipsoid Vector Space) and the other player is an ellipsoid (assuming it doesn't have the same radii as the first player) what is the best way to determine if an intersection has occurred, and if so, find the intersection point?
8. ## Smooth skinning algorithm

ok, let me clarify a few things. Each Bone has: Parent - A pointer to its parent length - (float) the length of the bone Rotation/Position - (vector) The Rotation and Position Direction - (vector) Bone's Direction Transform - The Transformation Matrix InverseBind - The Inverse of Transform in the reference pose Start/End - The Start and End points of the bone This is the code I use to move a Bone. void bone::Set() { //Calculate Bone's Relative Matrix Transform = matrix4(); //Set Transform to its Identity Transform.SetRotation( Rotation ); //If parent exist if(Parent!=NULL) //Combine Relative Matrix with Parent's Matrix to form Absolute Matrix Transform = Transform * Parent->Transform; //Calculate Bone's orientation vector3 tempVec = (Direction * length) * Transform; if(Parent!=NULL) Start = Parent->End; else Start = vector3(); End = Start + tempVec; } The only translation I see here is the distance from Start to End, which is calculated in tempVec. Are you saying I should combine this with the Transformation Matrix?
9. ## Smooth skinning algorithm

I get what you'er saying, but Im not sure how to do it. I mean I know I have to translate the matrix by a certain point, then rotate it, and translate it back, but I'm not sure how to calculate the translation?
10. ## Smooth skinning algorithm

Quote:So for a point attached to the hand, the matrices should have some translation at least. The only thing Im doing to the bones are rotating them, where does the translation come from? Are you referring to the distance from the start of the bone to the end as the translation?
11. ## Smooth skinning algorithm

noone know what Im doing wrong? well any suggestions would be appreciated.
12. ## Smooth skinning algorithm

I've read a few articles (and skimmed through a bunch of posts) about CPU skinning. I've tried to implement it for a while, but it just doesn't seems to work for me. I know that the equation looks something like this, v' = sum( Weight[i] * TransformMatrix[i] * ReferencePose[i]^-1 ) * v; But when I try to implement this on a single point, it fails. Below are 2 screen shots I took. The first pic is a skeleton in its reference pose, with left arm rotated at -90 degrees in the z axis, and the right arm rotated in 90 degrees in the z axis. and the blue point is a vertex of a mesh, its coords are (19.426800, 9.168850, 0.129585) the second pic is the skeleton's right arm is in its default pose, where all its matrices are set to their identities. since the blue point is at the edge, I assume its under the influence of just 1 bone. So I don't have to calculate the sum of the weights, I just calculate: v'= TransformMatrix * ReferencePose^-1 * v where: v = (19.426800, 9.168850, 0.129585) TransformMatrix = Identity Matrix ReferencePose^-1 = the inverse matrix of 90 degrees in the z axis And when I compute the result, I get v'=(9.168850, -19.426800, 0.129585) As you can see in the second pic, that is not where v' should be. Any ideas on what I'm doing wrong?
13. ## Skeleton Animation reference pose

Quote:Original post by emeyex 2) ensure your Bone[i].InverseBind is correct (after you compute the inverse of the reference pose, invert the matrix again and ensure it's "equal" to the reference pose) well Im not sure if it makes a difference, but the way I calcualte the Inverse matrix is, during the Binding function, I loop through all the bones, Set the Inverse matrix to the Transpose of the Bone's Transform matrix. However, thats shouldnt really matter, because when i multiply the Transform by its Inverse, I get its Identity. Quote: I'll think a little longer and re-post if anything else jumps out at me. Thanks, that would really help.
14. ## Skeleton Animation reference pose

Well you didnt confuse me....much. I tried to do what you said, but I the same results. Here my rendering code: int maxBones; int maxTri; //maxTriangles Bones[maxBones]; //Holds Transform & Inverse matrix VertSkin[maxTri]; //Class holds skin influence data (bone IDs & Weights) matrix4 SkinMat[maxBones]; // skinning matrix vector3 Vertex[maxVertices]; //holds list of vertices (float x,y,z) polygon Polygon[maxTri]; //holds triangle indices (int a,b,c) for(i=0; i < maxBones; i++) //loop through i'th bones { //Calculate skinning matrix SkinMat[i] = Bone[i].Transform * Bone[i].InverseBind; } for(i=0; i<maxTri; i++) //Loop through i'th triangles { vector3 v1 = Vertex[Polygon[i].a]; //untransformed point int maxInfluences; //# of bones that influence v matrix4 M; //holds sum of weights //loop through j'th weights for(int j=0; j < maxInfluences; j++) { int boneID = VertSkin[ Polygon[i].a ].ID[j]; float weight = VertSkin[ Polygon[i].a ].Weight[j]; if(j==0) M = SkinMat[ boneID ] * weight; else M = M+(SkinMat[ boneID ] * weight); } //transform v1 by the sum of all weights v1 = M * v1; ... // Calculate v2 & v3 ... // Render Triangle } Im not sure if im making a mistake in the rendering code, or my matrix multiplication code. Heres a screenshot of simple skinned mesh in its reference pose: And here is a screenshot once i rotate the arm bones,
15. ## Skeleton Animation reference pose

Quote:Original post by emeyex v' = sum_for_each_vertex_weight_i( W[i] * Mref[ B[i] ]^-1 * M[ B[i] ] ) * v; so the program would loop through the number of weights influenced by the vertex, multiply (float)W[i] with (matrix4x4)Mref[ B[i] ]^-1, which would give another 4x4 matrix, which is then multipled by M[ B[i]], and the result is stored in another matrix, which is multiplied by v when the loop ends. Alright, I think I got it, but its been a while since I did matrix math, and can't remember how to multiply a float to matrix. So when I multiply W[i] * Mref[ B[i] ]^-1, I just scale all of Mref[ B[i] ]'s values by W[i]?