Skip to content

Instantly share code, notes, and snippets.

View Bolloxim's full-sized avatar

Andi Smithers Bolloxim

View GitHub Profile

Starfield old school style

The illusion of movement without moving (although I move the stars if cameraTrick==0, basically we wrap the starfield around without ever changing the dataset).

versions

0.6 added WARP speed on the left click

0.5 added sparcity, focalpoint, fixed sort bug

Particle system .. step 1

step 1 in creating a nice particle system for exploding spaceships and plasma balls.

firs stage. get tons of transforms running second create groups third build effect emitters

forth.. err fix bugs. somethings seriously wrong with the photon torp emitter.

@Bolloxim
Bolloxim / Zylon-Fighter,-Fake-3d.markdown
Created July 22, 2014 19:44
A Pen by Andi Smithers.

Zylon Fighter, Fake 3d

using angles we can fake sorting order of our zylon fighter. Using ellipse rendering for the cockpit we can get a very nice 3d effect. Wings are made of simple hexagons with some line rendering. Its modular.

render a few hundred in a bizarre sin/cos pattern field.

step 3. fragment the ship as though destroyed .. fun stuff

A Pen by Andi Smithers on CodePen.

@Bolloxim
Bolloxim / index.html
Created July 22, 2014 19:45
A Pen by Andi Smithers.
<body>
<canvas id="texteffect"></canvas>
</body>
@Bolloxim
Bolloxim / index.html
Created July 24, 2014 16:25
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

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

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

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.