Cloth-Simulation | damper based real-time cloth simulation
kandi X-RAY | Cloth-Simulation Summary
kandi X-RAY | Cloth-Simulation Summary
I wrote this cloth simulation as a project for an animation and planning course I took in university.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Cloth-Simulation
Cloth-Simulation Key Features
Cloth-Simulation Examples and Code Snippets
Community Discussions
Trending Discussions on Cloth-Simulation
QUESTION
I got a problem understanding the logic I am trying to implement with Three.js and the GPUComputationRenderer by yomboprime.
(https://github.com/yomboprime/GPGPU-threejs-demos/blob/gh-pages/js/GPUComputationRenderer.js)
I want to make a simple Verlet-Cloth-Simulation. Here is the logic I was already able to implement (short version):
1) Position-Fragment-Shader: This shader takes the old and current position texture and computes the new position like this:
...ANSWER
Answered 2018-Apr-19 at 00:49This example is not verlet cloth, but I think the basic premise may help you. I have a fiddle that uses the GPUComputationRender
to accomplish some spring physics on a point cloud. I think you could adapt it to your needs.
What you need is more information. You'll need fixed references to the cloth's original shape (as if it were a flat board) as well as the force currently being exerted on any of those points (by gravity + wind + structural integrity or whatever else), which then gives you that point's current position. Those point references to its original shape in combination with the forces are what will give your cloth a memory instead of flinging apart as it has been.
Here, for example, is my spring physics shader which the GPUComputationRenderer
uses to compute the point positions in my visualization. The tOffsets
in this case are the coordinates that give the cloud a permanent memory of its original shape - they never change. It is a DataTexture I add to the uniforms at the beginning of the program. Various forces like the the mass
, springConstant
, gravity
, and damping
also remain consistent and live in the shader. tPositions
are the vec4 coords that change (two of the coords record current position, the other two record current velocity):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Cloth-Simulation
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page