Skip to content

Instantly share code, notes, and snippets.

nbogie /
Last active Mar 7, 2022
initial p5.xr VR experiments (for the quest 2)
View ProjectileFirer.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ProjectileFirer : MonoBehaviour
public List<GameObject> projectilePrefabs;
public float fireStrength = 20;
public float spinStrength = 10f;
nbogie / MouseLookScript.cs
Created Nov 16, 2021
MouseLookScript - Unity - Old input system
View MouseLookScript.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseLookScript : MonoBehaviour
public float lookSensitivity = 10f;
private float leftRightAngle = 0;
private float upDownAngle = 0;
View Unity.gitignore
# This .gitignore file should be placed at the root of your Unity project directory
# Get latest from
# Neill modified to ignore .log files.
View favePlacesData.json
"placeName": "St. Thomas",
"location": "British Virgin Islands, Caribbean",
"description": "Beautiful island with great people, be careful of the lizards",
"image": {
"src": "",
"altText": "Virgin islands beach"
nbogie / DumpObjectToConsoleForThree.js
Created Nov 9, 2020
utility functions to report structure of scene / sub-scene to console, for three.js (at least for gltf-loaded-models). by@greggman
View DumpObjectToConsoleForThree.js
import * as THREE from '';
function dumpObjectToTextLines(obj, lines = [], isLast = true, prefix = '') {
if (!obj || !obj.children) {
return lines;
const localPrefix = isLast ? '└─' : '├─';
lines.push(`${prefix}${prefix ? localPrefix : ''}${ || '*no-name*'} [${obj.type}]`);
const newPrefix = prefix + (isLast ? ' ' : '│ ');
const lastNdx = obj.children.length - 1;
View stacked-layers-shader.shadertoy
// Trying to build stacked crosssectional plates of animated 3d noise, to mimic this work:
// Using the noise algorithm from this shader by iq:
// then making it have octaves.
// TODO: Make the plates square and isometric.
// TODO: Fix the noise so that builds in from both up as well as down.
// TODO: Correctly just overlay the colours of each upper disc on the lower discs, if the upper pixel is not transparent. Need to model alpha.
// TODO: don't calculate a noise value that is going to be thrown away!
nbogie /
Last active Jun 5, 2020
student issues: react week 3

React week 3 - student questions and issues for class

  • setFoo doesn't magically update foo (useState):
  • useState("someinitvalue") only initialises the variable the first time the component is ?rendered?. Subsequent calls to useState return the new current value of the variable.
  • passing props down and down. useContext? "
    • should I learn redux?
  • "should i learn class components?"
  • to investigate: synthetic events an issue?
nbogie /
Last active Jun 5, 2020
JS exercises - working with data

pure js exercises using data


  • tv maze - pure JS exercises (in repl)
  • jobs listing pure JS exercises (in mahmut's repl)
    • get all the company titles and positions of every job [{company: CYF, position: programmer}, ...], etc
  • stuff from my json-examples netlify
  • p5js (filter points by dist(), find points by same, find enemies with low hit-points, etc)