Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  get position of particles
#5
Hey again,

ok first of all i created 2 lists with the particle positions of each flag which is working.
Code:
  for (int i = 0; i <= 288; i++)
        {
            clothParticles1.Add(cloth1.GetParticlePosition(cloth1.solverIndices[i]));
            clothParticles2.Add(cloth2.GetParticlePosition(cloth2.solverIndices[i]));
        
        }
Then tried couple ways to compare. 
Code:
foreach (Vector3 i in clothParticles1)
        {
            if (clothParticles2.Contains(i))
            {
                stitchlist.Add(i);
            }

        }
and
Code:
List<Vector3> stitchlist = new List<Vector3>(clothParticles1.Intersect(clothParticles2));

Both the above returned the correct value of the list length (289 because the 2 flags have 17x17 vertices) only when the 2 flags were 100% on the same position.
Reply


Messages In This Thread
get position of particles - by orestissar - 19-02-2021, 10:44 AM
RE: get position of particles - by josemendez - 19-02-2021, 11:08 AM
RE: get position of particles - by orestissar - 19-02-2021, 02:49 PM
RE: get position of particles - by josemendez - 19-02-2021, 03:22 PM
RE: get position of particles - by orestissar - 19-02-2021, 03:52 PM
RE: get position of particles - by josemendez - 19-02-2021, 04:11 PM
RE: get position of particles - by orestissar - 22-02-2021, 02:59 PM