当前位置:网站首页>SPH中的粒子初始排列问题(两张图解决)
SPH中的粒子初始排列问题(两张图解决)
2022-07-04 22:37:00 【beidou111】
因此对应代码为(改自太极k-ye的pbf2d.py)
def init():
init_pos = ti.Vector([0.2,0.3,0.2])
cube_size = 0.4
spacing = 0.02
num_per_row = (int) (cube_size // spacing)
num_per_floor = num_per_row * num_per_row
for i in range(num_particles):
floor = i // (num_per_floor)
row = (i % num_per_floor) // num_per_row
col = (i % num_per_floor) % num_per_row
positions[i] = ti.Vector([row*spacing, floor*spacing, col*spacing]) + init_pos
边栏推荐
- Analog rocker controlled steering gear
- Photoshop批量给不同的图片添加不同的编号
- 攻防世界 MISC 进阶区 can_has_stdio?
- 【ODX Studio编辑PDX】-0.3-如何删除/修改Variant变体中继承的(Inherited)元素
- 微信小程序显示样式知识点总结
- On-off and on-off of quality system construction
- Taobao commodity review API interface (item_review get Taobao commodity review API interface), tmall commodity review API interface
- Create Ca and issue certificate through go language
- Redis introduction complete tutorial: slow query analysis
- Redis入门完整教程:Redis Shell
猜你喜欢
C语言快速解决反转链表
Editplus-- usage -- shortcut key / configuration / background color / font size
攻防世界 MISC 进阶区 3-11
攻防世界 MISC 進階區 Erik-Baleog-and-Olaf
P2181 diagonal and p1030 [noip2001 popularization group] arrange in order
One of the commonly used technical indicators, reading boll Bollinger line indicators
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
Redis introduction complete tutorial: slow query analysis
MySQL Architecture - user rights and management
Redis入门完整教程:列表讲解
随机推荐
Redis入门完整教程:事务与Lua
新版判断PC和手机端代码,手机端跳转手机端,PC跳转PC端最新有效代码
金融市场,资产管理与投资基金
攻防世界 MISC 进阶区 hong
剑指 Offer 67. 把字符串转换成整数
智力考验看成语猜古诗句微信小程序源码
Qt个人学习总结
Redis入门完整教程:客户端通信协议
Photoshop batch adds different numbers to different pictures
Redis入门完整教程:Pipeline
Redis introduction complete tutorial: client communication protocol
Pagoda 7.9.2 pagoda control panel bypasses mobile phone binding authentication bypasses official authentication
Advanced area a of attack and defense world misc Masters_ good_ idea
Analysis of the self increasing and self decreasing of C language function parameters
Gnawing down the big bone - sorting (II)
攻防世界 MISC 进阶区 hit-the-core
Taobao commodity review API interface (item_review get Taobao commodity review API interface), tmall commodity review API interface
Summary of index operations in mongodb
攻防世界 MISC 進階區 Erik-Baleog-and-Olaf
【ODX Studio編輯PDX】-0.2-如何對比Compare兩個PDX/ODX文件