Skip to content

Instantly share code, notes, and snippets.

View ecker00's full-sized avatar
🌊

Christer Eckermann ecker00

🌊
View GitHub Profile
@ecker00
ecker00 / SunPosition.cs
Last active December 15, 2021 13:10
Realistic sun position based on time of year and latitude/longitude in Unity 3D. Making it possible to simulate phenomena like the midnight sun. If this came in handy, say hi over at @SnutiHQ on Twitter.
// This code is licensed under the terms of the MIT license
using UnityEngine;
public class SunPosition : MonoBehaviour
{
[SerializeField, Range(-90f, 90f)]
public float latitude = 69.6546f;
[SerializeField, Range(-180f, 180f)]
public float longitude = 18.9637f;
@ecker00
ecker00 / FFmpegBatchTimelapse.ps1
Last active November 9, 2019 20:27
PowerShell batch timelapses with FFmpeg
# Batch process timelapses
#
### About
#
# This script will find all .mp4 files in the given directory and create an
# ./ffmpeg directory with the outputs. You can decide speed multiplier and to
# queue all files or just a few.
#
### Setup
#
@ecker00
ecker00 / AgentBrain.js
Last active January 14, 2018 23:18
Unity3D Boids script 2013
#pragma strict
// Customizable
var detectionRange : float = 25.0; // Set from spawn script
var updateSkip : float = 5.0;
var aSpeed : float = 70;
var hostile : boolean = false;
var player : boolean = false;
private var curVec : Vector2 = Vector2.zero;