Skip to content

Instantly share code, notes, and snippets.

@Uradamus
Uradamus / dwf2swf.py
Last active February 5, 2018 02:31
Decrypt dwf files to swf.
from sys import argv
magic = 28 # Defined here in case it needs to be changed.
with open(argv[1], 'rb') as dwf:
data = bytearray(dwf.read())
count = 0
for byte in data:
@Uradamus
Uradamus / Building Size Standards
Created February 25, 2018 19:49
These are my notes on some rough sizes I started to collect from some testing to help with planning 3D game level designs.
avg char height 1.6
avg eye level 1.5
avg char diameter 0.4
floor thickness 0.4
wall thickness 0.2
wall height 3.2 residential
wall height 3.6 commercial
door width 1.2
door height 2.2
stair rise 0.2
@Uradamus
Uradamus / ptf2pam.py
Created May 4, 2019 22:17
This is a pretty simple conversion script to get .ptf texture files into a format that ImageMagick could further process into any desired output formats.
"""Copyright 2019 Uradamus
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@Uradamus
Uradamus / specular.py
Created July 21, 2019 00:05
A simple script for determining an approriate specular value to use with Blender's Principled BSDF shader for a given IOR value.
#!/usr/bin/env python3
from sys import argv
ior = float(argv[1])
specular = ((ior-1)/(ior+1))**2/0.08
print(round(specular, 3))