Skip to content

Instantly share code, notes, and snippets.

View Bolloxim's full-sized avatar

Andi Smithers Bolloxim

View GitHub Profile
@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

@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 / 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.

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.

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

version 0.2 added canvas rotate / translate to rotate around the y axis

@Bolloxim
Bolloxim / Asteriod-Field.markdown
Created August 3, 2014 06:25
A Pen by Andi Smithers.

Asteriod Field

Taking the icosahedron we deform the vertices randomly for each asteriod giving a unique shape to each one. We then give it some rotational component and then collide them with each other to create a nice bouncing action.

version 0.2 allow morphing greater a safe value which now can cause concave issues.

version 0.3 timer to spawn a new random field. Tied into the same structures as the long range scanner.

A Pen by Andi Smithers on CodePen.

@Bolloxim
Bolloxim / index.html
Created August 1, 2014 09:04
A Pen by Andi Smithers.
j<body>
<canvas id='test'></canvas>
</body>

Icosahedron - rendered in 2D

Old School 3D convex hull rendering using cross product in screenspace for backface culling removal and subsequent shading.

version 0.1 basic hedron rotating

version 0.2 true reason ... 3d shield effect

version 0.3 touch of shiny blue neon to the icosahedron

Star-Raiders : homage to old school

This is the frame work game for star-raiders remake in pure html 5 canvas. Oh yes we could make this in webGL but whats the fun of that. More interesting to see what we can render in 3D without using a 3D rendering api.

controls are based on touch screen as well for ipads etc, keyboard short cuts will be available however mapping to the originals.

version 0.1 Forked Galactic Scanner and added buttons hud items. This means that AI works for tokens on scanner and we can populate locals with enemys now.

version 0.2 Long Range Scanner. This gives enemies in local space and a means to align and target those enemies

@Bolloxim
Bolloxim / index.html
Created July 24, 2014 16:25
A Pen by Andi Smithers.
j<body>
<canvas id='test'></canvas>
</body>