Skip to content

Instantly share code, notes, and snippets.

View pailhead's full-sized avatar

Dusan Bosnjak pailhead

View GitHub Profile
import { Vector3 } from 'three'
const PI2 = Math.PI * 2
class Particle {
public random0 = Math.random()
public random1 = Math.random()
public random11 = Math.random() * 2 - 1
position = new Vector3()
velocity = new Vector3()
import { Vector3, Camera } from 'three'
class IndexedVector3 extends Vector3 {
constructor(public readonly index: number, public bufferIndex: number = -1) {
super()
}
}
export class ParticleSorter {
private _currentBuffer: number[] = []
@pailhead
pailhead / gist:6074816
Created July 24, 2013 21:38
generate an ngon mesh in unity
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class ProceduralCircle : MonoBehaviour {
public float radius = 1;
public int sides = 5;
private Vector3[] vertices;
private Vector2[] uv;