当前位置:网站首页>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
边栏推荐
- Redis getting started complete tutorial: Key Management
- 堆排序代码详解
- Redis introduction complete tutorial: detailed explanation of ordered collection
- Feature scaling normalization
- Redis getting started complete tutorial: publish and subscribe
- Is Huatai Securities a nationally recognized securities firm? Is it safe to open an account?
- Unity Xiuxian mobile game | Lua dynamic sliding function (specific implementation of three source codes)
- Redis入门完整教程:键管理
- String类中的常用方法
- Redis introduction complete tutorial: client communication protocol
猜你喜欢

Persistence mechanism of redis

字体设计符号组合多功能微信小程序源码

Talk about Middleware

Editplus-- usage -- shortcut key / configuration / background color / font size
![[roommate learned to use Bi report data processing in the time of King glory in one game]](/img/06/22dde3fcc0456bd230e1d0cde339ec.png)
[roommate learned to use Bi report data processing in the time of King glory in one game]

Install the gold warehouse database of NPC

Redis getting started complete tutorial: hash description
![[OpenGL] note 29 anti aliasing (MSAA)](/img/66/61f29e1c41d3099d55e2ead0a3b01e.png)
[OpenGL] note 29 anti aliasing (MSAA)

Redis入门完整教程:Pipeline

攻防世界 misc 高手进阶区 a_good_idea
随机推荐
Create Ca and issue certificate through go language
Redis introduction complete tutorial: detailed explanation of ordered collection
Redis introduction complete tutorial: Collection details
模拟摇杆控制舵机
P2181 对角线和P1030 [NOIP2001 普及组] 求先序排列
Attack and defense world misc master advanced zone 001 normal_ png
MYSQL架构——逻辑架构
A complete tutorial for getting started with redis: understanding and using APIs
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
Attack and Defense World MISC Advanced Area Erik baleog and Olaf
Redis introduction complete tutorial: client communication protocol
Redis入门完整教程:API的理解和使用
[Lua] Int64 support
Persistence mechanism of redis
Redis入门完整教程:客户端通信协议
Summary of index operations in mongodb
Mongodb aggregation operation summary
Advanced area a of attack and defense world misc Masters_ good_ idea
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
【机器学习】手写数字识别