Saturday, August 4, 2012

Final Video

Hello, added a Maya plugin to control cloth parameters and external force strength and direction while simulating tearing in cloth.

This is the final video with the results. The video has a commentary attached to it, so please turn on the volume.


Monday, April 16, 2012

Tearing in Cloth

Hello, couldn't update this weekend, so multiple updates today. Over the weekend, implemented tearing in cloth using the Stretch constraint. The stretch along the edge multiplied by stretch scaling factor is compared with the tearing threshold of the cloth to determine whether the cloth should tear. The stretched edge determines where the cloth should tear off.

The following steps are performed:
* Compare with tearing threshold (depends on cloth material)
* If greater than the threshold, get the edge to be broken off. Select one vertex from this edge.
* Duplicate this vertex and draw an imaginary plane perpendicular to the edge.
* Triangles containing the selected vertex which lie above the plane are assigned to the duplicate vertex, while those that lie below the plane are assigned to the original vertex. If a triangle has vertices which lie on either side of the plane, then the one with the higher value of dot product with the normal is given preference.
* Neighbors and faces are adjusted as per the above step.
* Distribution of mass among vertices is changed.
* The Stretch and Bend constraints are updated considering the new neighbors.

Following the above steps, tearing is achieved. Special cases are handled so as to not get orphan vertices, where vertices are not connected to any edge.

Below are few results from the simulation


There are few artificats at the end of the simulation which has to be handled. This might be caused due to the way orphan vertices are handled.

Rigid Body Collision

Aparajith has started with rigid body collisions. He has been able to find out which vertices will collide with the rigid body mesh in the next time instant. The current position of each vertex, the projected position at the next time instant and the ray along the direction of velocity is considered while determining collision with the rigid body mesh. Two terms are of importance here:

Continuous Collision: In this case, the current position of the vertex is outside the mesh, while the next projected position is inside the mesh. In this case the point where the vertex intersects the mesh and the normal at that face is considered to generate a constraint.

Static Collision:In this case, the current position as well as projected positions are inside the rigid body (can occur due to failure in the continuous collision case). The point on the rigid bosy cloest to the projected point and the normal at that point are considered while creating the constraint for this type of collision.

Aparajith is currently figuring out how to solve the constraint. He has temporarily solved it using a scaling factor, but he is still investigating the issue. Below is the video generated using a scaling factor. You can see how the cloth collides with the rigid body and repels out.


Saturday, April 7, 2012

Distance and Bending Constraints

After a bit of rest away from Cloth tear, I am back updating the code. I have implemented the Distance as well as the bending constraint on the cloth. The stretch (distance constraint) can be controlled by kStretch and the bending in cloth can be controlled using the kBend constraint. Below are the results with and without the bending constraint. You can see how the cloth folds without the bending constraint. Both cases in the video have a stretching constraint applied to it.


Till Now:
* Cloth Structure
* Damping factor (Controllable)
* Stretch Constraints (Controllable)
* Bend Constraints (Controllable)

Next Steps:
* Collision detection with world objects
* Self Collision detection

Aparajith has now joined me in this project. We will be working together from now on.

Wednesday, April 4, 2012

First Update

Just started with the project today. Have started to implement the paper "Position Based Dynamics" by Matthias Muller et al. I am planning to use the algorithm from the paper to handle tearing in cloth.

Till Now:
* Started from scratch and created a basic triangular mesh structure (Nothing substantial yet)

My current cloth :P

Next steps:
* Updating velocities for next time steps
* Applying stretching and bending constraints