Skip to content

Instantly share code, notes, and snippets.

@mathdoodle
mathdoodle / Grid.ts
Last active August 31, 2016 01:49
Line Charge Redux
import World from './World';
export default class Grid {
private inner: EIGHT.Grid;
constructor(private world: World) {
this.inner = new EIGHT.Grid({
uSegments: 8,
vSegments: 8
})
world.add(this.inner)
@mathdoodle
mathdoodle / README.md
Created August 13, 2016 18:44
Finite Line Charge

World Scaffold

Overview

A scaffold application that separates typical setup code from the main animation loop where the action happens.

@mathdoodle
mathdoodle / README.md
Last active September 8, 2016 19:59
World Scaffold

World Scaffold

Overview

A scaffold application that separates typical setup code from the main animation loop where the action happens.

@mathdoodle
mathdoodle / README.md
Last active February 24, 2018 18:56
EIGHT Getting Started

EIGHT Project Template

Overview

A starter template for creating high-level 3D graphics using the the EIGHT library.

@mathdoodle
mathdoodle / Bug.ts
Last active July 8, 2020 04:27
Local Geometry on a Sphere
import { Geometric3, VectorE3, BivectorE3 } from 'davinci-eight'
/**
* Scratch variable for implementing the rotate method.
*/
const R = Geometric3.zero()
/**
* Heading
*/
const INDEX_H = 0
@mathdoodle
mathdoodle / Bug.ts
Last active August 8, 2016 03:51
Turtle Geometry
const FLOATS_PER_VERTEX = 3;
const BYTES_PER_FLOAT = 4;
const STRIDE = BYTES_PER_FLOAT * FLOATS_PER_VERTEX;
function primitive(): EIGHT.Primitive {
const aPosition: EIGHT.Attribute = {
values: [
[0,+0.0,0, 0,-0.3,0, -0.3,0,0, +0.3,0,0], // center
[0,+1,0, -1,-1,0], // LHS
[0,+1,0, +1,-1,0], // RHS
@mathdoodle
mathdoodle / Bug.ts
Last active August 8, 2016 02:56
Local Physics Basics
const FLOATS_PER_VERTEX = 3;
const BYTES_PER_FLOAT = 4;
const STRIDE = BYTES_PER_FLOAT * FLOATS_PER_VERTEX;
function primitive(): EIGHT.Primitive {
const aPosition: EIGHT.Attribute = {
values: [
[0,+0.1,0, 0,-0.1,0, -0.1,0,0, +0.1,0,0], // center
[0,+1,0, -1,-1,0], // LHS
[0,+1,0, +1,-1,0], // RHS
@mathdoodle
mathdoodle / $3DMol.d.ts
Last active August 6, 2016 01:59
3Dmol Ribbon
declare module 3DMol {
}
declare module '3dmol' {
export = 3DMol;
}
@mathdoodle
mathdoodle / $3DMol.d.ts
Last active January 3, 2021 11:37
3Dmol Atoms
declare module 3DMol {
}
declare module '3dmol' {
export = 3DMol;
}
@mathdoodle
mathdoodle / $3DMol.d.ts
Created August 5, 2016 23:39
3Dmol Animation
declare module 3DMol {
}
declare module '3dmol' {
export = 3DMol;
}