import taichi as ti
ti.init(arch=ti.gpu)
#gui system using taichi-ggui:
#https://docs.taichi.graphics/zh-Hans/docs/lang/articles/misc/ggui
imgSize = 512
clothWid = 4.0
clothHgt = 4.0
clothResX = 31
num_triangles = clothResX * clothResX * 2
indices = ti.field(int, num_triangles * 3)
vertices = ti.Vector.field(3, float, (clothResX+1)*(clothResX+1))
pos_pre = ti.Vector.field(3, dtype=ti.f32, shape=(clothResX+1, clothResX+1))
pos = ti.Vector.field(3, dtype=ti.f32, shape=(clothResX+1, clothResX+1))
vel = ti.Vector.field(3, dtype=ti.f32, shape=(clothResX+1, clothResX+1))
F = ti.Vector.field(3, dtype=ti.f32, shape=(clothResX+1, clothResX+1))
This file has been truncated. show original