This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from panda3d.core import NodePath, Shader, ShaderAttrib, ShaderBuffer, GeomEnums, ComputeNode | |
| from direct.showbase.ShowBase import ShowBase | |
| from des_constants import PC1, PC2, SHIFTS, S1, S2, S3, S4, S5, S6, S7, S8, IP, FP, E, P | |
| def generate_sp_boxes(): | |
| def permute(v, table, length): | |
| res = 0 | |
| for i, p in enumerate(table): | |
| if v & (1 << (length - p)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #version 430 | |
| struct Projectile { | |
| vec2 position; // 2 floats | |
| vec2 velocity; // 2 floats | |
| float spawn; // 1 float | |
| float range; // 1 float | |
| float decay; // 1 float | |
| vec4 color; // 4 floats | |
| float scale; // 1 float |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2024 Andrew Spangler | |
| # Licensed under WTFPL | |
| # Makes gifs of falling / floating sand | |
| # Requires numpy, pil, and imageio | |
| # run: pip install numpy pil imageio | |
| # Outputs to sand_simulation.gif | |
| import time | |
| import numpy as np | |
| import imageio | |
| from collections import deque |