Skip to content

Instantly share code, notes, and snippets.

@aiya000
Created January 29, 2022 18:03
Show Gist options
  • Save aiya000/bd932acf393fd752a5606f3c699d84c2 to your computer and use it in GitHub Desktop.
Save aiya000/bd932acf393fd752a5606f3c699d84c2 to your computer and use it in GitHub Desktop.
vrcss-fov.sh
#!/usr/bin/env zsh
# https://gist.github.com/chigirits/55d6eed4396ed5da64878af2b43111ed
dist=./vrcss-fov-dist
if [[ ! -d $dist ]] ; then
mkdir $dist
fi
if [[ $# -eq 2 ]] ; then
fov=$1
in=$2
elif [[ $# -eq 1 ]] ; then
fov=50
in=$1
else
echo 'invalid'
return 1
fi
k=$((fov / 60.0))
k2=$(((k - k * k * k) / 6.0))
ext=${in##*.}
name=${in%%.$ext}
out=$dist/$name-fixfov.$ext
convert -distort barrel "0 $k2 0 $k" "$in" "$out"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment