Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit your homework here #1

Open
neozhaoliang opened this issue Jun 1, 2022 · 8 comments
Open

Submit your homework here #1

neozhaoliang opened this issue Jun 1, 2022 · 8 comments

Comments

@neozhaoliang
Copy link
Contributor

neozhaoliang commented Jun 1, 2022

Please submit your homework in this issue. Recommended submission formats:

Repo link: https://github.com/your-name/your-repo

Description: which challenge did you finish? And quickly summarize what you did in your code.

Screenshots: https://raw.githubusercontent.com.../xxxx.png

@chunleili
Copy link

Repo link: https://github.com/chunleili/cloth-simulation-homework

Description: complete the easy and medium tasks. Hard is not finished. And medium 2(prevent the cloth to be ripped) is not understood.
本着用最小的修改原则(能不改的不改,尽量增加而不是修改)进行了修改。防止刺穿那点暂时不会。还没用其他语言写过。全部过程描述已放到上述repo readme中。

Screenshots: demo.png

image

@neozhaoliang
Copy link
Contributor Author

neozhaoliang commented Jul 6, 2022

@chunleili 不错!基本的挑战已经完成了。不过你的代码如果要添加很多球的话写起来就很麻烦了。其实有更简单的写法:

ball_center = ti.Vector.field(3, dtype=float, shape=(3, ))
ball_center[0] = [-0.5, 0, 0]
ball_center[1] = [0, 0, 0]
ball_center[2] = [0.5, 0, 0]

就可以了。后面碰撞检测的时候可以直接用 for loop 遍历所有的球,不需要每个球都写一遍代码。

@tlcui
Copy link

tlcui commented Jul 31, 2022

Repo link: https://github.com/tlcui/cloth_simulation_demo

Description: 用C++和opengl实现了一下这个demo,可以添加更多的球,加了一个布料与小球摩擦的trick。在个人PC上执行比taichi的ti.cpu运行更快(相应的taichi实现也在该repo中 https://github.com/tlcui/cloth_simulation_demo/blob/master/cloth_simulation.py )。 碰撞和布料的自相交太难不会>_<。详细情况可见该repo的readme。

Screenshots: https://github.com/tlcui/cloth_simulation_demo/blob/master/results.gif
results

@neozhaoliang
Copy link
Contributor Author

@tlcui The repo is private?

@tlcui
Copy link

tlcui commented Jul 31, 2022

@tlcui The repo is private?

不好意思 操作失误。现在已经设置为公开了^_^

@neozhaoliang
Copy link
Contributor Author

能用 C++ 和 opengl 实现也是很棒的了!穿模有点明显, 不过瑕不掩瑜。你的实现跑得比 taichi 快应该是可以预料的,因为taichi版本是跑在 cpu 上的。要不要在你的代码里面把开头改成 ti.init(arch=ti.vulkan) 试试?

@tlcui
Copy link

tlcui commented Aug 2, 2022

能用 C++ 和 opengl 实现也是很棒的了!穿模有点明显, 不过瑕不掩瑜。你的实现跑得比 taichi 快应该是可以预料的,因为taichi版本是跑在 cpu 上的。要不要在你的代码里面把开头改成 ti.init(arch=ti.vulkan) 试试?

之前忘了给布料shading,是直接指定颜色的。现在改过来了,算了法向量,也有shading了,现在布料看上去自然了不少hhh,帧数还是60左右。taichi里用ti.vulkan速度确实快的夸张,有215帧,甚至远远比ti.cuda还要快,非常震撼
results_new

@lucywsq
Copy link

lucywsq commented Aug 9, 2022

Hi, @chunleili @tlcui
Thanks for your great job. We have souvenirs for those who finished this homework. Please fill in the form if you'd like to get it. We will ship the souvenir the first Friday after we receive your information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants