Jenney Journal, part 2

I heard a crash from upstairs. I ran up to find Jenney naked on the floor of the bathroom. She had blacked out and fell on her way to the toilet. She’d been taking baths every so often as she found the water somewhat soothing, and wasn’t bothering to put clothes back on since she just went back to bed. I urged her to go to the ER. She refused saying we had an appointment on Monday with the OB who could advise us better. She didn’t want to go and have them charge us more money and say, “Take some Tylenol” again. But after that I watched her like a hawk and didn’t let her go to the bathroom alone.

read on

Jenney Journal, part 1

Jenney’s migraines started on Feb 10th while we were in San Diego visiting her mom. We had planned on taking the kids to Disney while we were there but Jenney could barely leave her bed, much less the house. She had vomited a couple times as well. The migraines came anywhere from 15 to 50 minutes at a time, lasted 5 to 10 minutes, and only seemed to subside at night or in the mornings. We started keeping a log.

read on

Karate; Body Programming

Karate is an advanced programming language for the body. Each movement is a letter in an alphabet which when strung together form words. These words are practiced in routines which become expressions, phrases, and functions stored in your muscle memory. Once stored, they can be quickly called upon to solve problems of a physical nature.

read on

THREE.js object and material loading

Messing with some THREE.js and on top of that the excellent webvr-starter-kit.

The WebVR starter kit is a library on top of Three.js that allows you to quickly and easily setup a scene without all of the coding required by Three.js.

VR.floor()

This will get you a basic scene with lighting, rendering, camera, and a checkered plane for a floor.

Since this is based on Three.js, you can then use typical Three.js libraries to do things like load objects and materials. Then you can add them to the existing scene like so:

VR.scene.add(whatever)

I wrote a basic example that utilizes Three’s OBJMTLLoader. You can see the source below and you can see it in action here.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Load Obj with Three.js</title>
  <meta charset="utf-8">
</head>
<body>
<script type="text/javascript" src="js/three.min.js"></script>
<script src="https://povdocs.github.io/webvr-starter-kit/build/vr.js"></script>

<script type="text/javascript" src="js/MTLLoader.js"></script>
<script type="text/javascript" src="js/OBJMTLLoader.js"></script>

<script type="text/javascript">

VR.floor()
console.log(VR) // this container things like VR.camera, VR.scene, VR.renderer from THREE

// this just
var manager = new THREE.LoadingManager()
manager.onProgress = function(item, loaded, total) {
  console.log('Manager:', item, loaded, total)
}

/**
 * objLocation should be the http location of the file without the extension.
 * we will automatically assume that an obj file and an mtl file are present.
 * ex: https://raw.githubusercontent.com/bitgridio/models/gh-pages/lullabot/Body
 */
var loadObjMtl = function(objLocation) {
  var loader = new THREE.OBJMTLLoader(manager)
  loader.load(
    objLocation + '.obj',
    objLocation + '.mtl',
    function(obj) {
      console.log(obj)
      VR.scene.add(obj)
    },
    function(xhr) {
      console.log(xhr.loaded + ' bytes loaded')
    },
    function(xhr) {
      console.log('Error loading object')
    }
  )
}

loadObjMtl('https://raw.githubusercontent.com/bitgridio/models/gh-pages/lullabot/Body')
loadObjMtl('https://raw.githubusercontent.com/bitgridio/models/gh-pages/lullabot/Headd')

</script>
</body>
</html>