Skip to content

Instantly share code, notes, and snippets.

View Bolloxim's full-sized avatar

Andi Smithers Bolloxim

View GitHub Profile

Cutaway hemisphere - js canvas 2D

Started off as something else but now its a marble earth kind of thing. will be my star-raiders starbase

can do a lot more with the hemisphere rendering. If I have time can show gold ring, shadows and moons etc.. all cool stuff.

might make a solar system flyby once star-raiders is finished

A Pen by Andi Smithers on CodePen.

@Bolloxim
Bolloxim / Random-Normal.markdown
Created August 15, 2014 09:35
A Pen by Andi Smithers.

Random Normal

I call this Random Normal as it effectively generates randomized unit vectors uniformly distributed.

Instead of using x = random(2)-1, y = random(2)-1, z = random(2)-1 then normalized.. which is rather poor in many reasons.

We compute the euler angles for theta and phi. It works on a nice property of arc-cos which is a uniform distribution of the 'y' axis just by using -1 to 1.

as you can see by the rotating sphere.. no polar bias. lovely.

@Bolloxim
Bolloxim / Animated-cone-cylinder.markdown
Created August 16, 2014 08:50
A Pen by Andi Smithers.

Animated cone/cylinder

Useful 2D geometry rendered to look 3D cylinders are useful to tie sysems and moels together

A Pen by Andi Smithers on CodePen.

License.

@Bolloxim
Bolloxim / Atari-Pokey-Chip-Emulator.markdown
Created August 26, 2014 09:14
A Pen by Andi Smithers.

Atari Pokey Chip Emulator

Simple Web Audio Implementation for emulating the atari pokey chip

version 0.1 Its early yet but got the pure tone frequency done. Noise next along with some game effects

version 0.2 after trying to emulate a 1.79mhz clock used as a RNG then turned into noise .. I ended up with a randomized buffer.

*note tonal was working as a port for pokey but the noise RNG is tough to emulator without using scriptnode in webaudio and thats a no-no as it hurts perf. so going for a hybrid system