Hello,
I am trying to understand simple cloth animation using three.js . I am facing some problems regarding the clothfunction.
A function plane is defined in such way so that it returns an entire function.
It does not return anything like an object but an entire function.
- How this is possible ?
I searched it as a javascript topic but could not find any answer. - plane() returns a function which takes target as an argument. What is target here?
target.set(x,y,z);
What does it mean ?
Now clothFunction takes a function which is returned by plane() function.
Now I am passing clothFunction as an argument to ParametricBufferGeometry( , , )
This time clothFunction does not take any argument . - If I assume clothFunction is a function then why it doesn’t take any argument?
- If I assume clothFunction is an object then where am I passing target argument ?
- If the function is defined and returned at the same time then when is it called ?
function (u,v,target){…};
The aforesaid function is referred here. - If the function is called at some point then where the target argument is passed ?
[As per my knowledge the scope of target is limited within the definition. It can’t be accessed from anywhere]
Source: Simple_cloth_simulation