Skip to content

Instantly share code, notes, and snippets.

View turner's full-sized avatar

Douglass Turner turner

  • Elastic Image Software LLC
  • Lexington, MA USA 02421
  • X @dugla
View GitHub Profile
@turner
turner / helloSpotloght.js
Created April 8, 2019 20:11
Driver App for SpotlightDropShadow Class.
let spotlight = new SpotLightDropShadow({ color: appleCrayonColorThreeJS('snow'), intensity: 1.5, shadowSize: 1024, near: 0.8e3, far: 3.0e3, doShowHelper: true });
spotlight.addToScene(scene);
const near = 1e3;
const far = 2e3;
spotlight.pose({ position: new THREE.Vector3(-400, 1500, -400), target: new THREE.Vector3(-400, 0, -400), near, far });
@turner
turner / spotLightDropShadow.js
Last active April 8, 2019 20:10
SpotLight With Shadow. Near/Far Clip Planes Not Updating
import * as THREE from './threejs_es6/three.module.js';
class SpotLightDropShadow {
constructor({ color, intensity, shadowSize, near, far, doShowHelper}) {
let spotLight = new THREE.SpotLight( color, intensity );
spotLight.castShadow = true;
spotLight.shadow.mapSize.width = shadowSize;
@turner
turner / custom_shader_bug.js
Created February 6, 2019 15:17
Custom Shader Rendering Bug in three.js
import * as THREE from './threejs_es6/three.module.js';
import LineGeometry from './threejs_es6/LineGeometry.js';
import LineMaterial from './threejs_es6/LineMaterial.js';
import Line2 from './threejs_es6/Line2.js';
import OrbitControls from './threejs_es6/orbit-controls-es6.js';
import { appleCrayonNames, appleCrayonColorHexValue, appleCrayonColorThreeJS } from './ei_color.js';
import SequenceManager from './sequenceManager.js';
@turner
turner / three.js.shader.html
Created February 4, 2019 23:03 — forked from kylemcdonald/three.js.shader.html
Minimal three.js shader example.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0px;
overflow: hidden;
}
import * as THREE from 'three';
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
*/
http://igv.org/web/release/2.0.0-beta7/dist/igv.js
@turner
turner / embedded_figures.js
Last active June 27, 2017 19:25
Embedded Figures
<script type="text/javascript">
$(document).ready(function () {
var browser1,
browser2,
str;
str = 'state=1%2C1%2C4%2C594.253105%2C615.253105%2C1%2CNONE&colorScale=8&hicUrl=https%3A%2F%2Fhicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC046.hic&name=Rao%20and%20Huntley%20et%20al.%20%7C%20Cell%202014%20GM12878%20(human)%20in%20situ%20no%20crosslinking%20HIC046%20(46M)&tracks=https%3A%2F%2Fwww.encodeproject.org%2Ffiles%2FENCFF222NCQ%2F%40%40download%2FENCFF222NCQ.bigWig%7CA375%200%3A1%7C%7Crgb(3%2C%20116%2C%20178)%7C%7C%7Chttps%3A%2F%2Fwww.encodeproject.org%2Ffiles%2FENCFF972ZQA%2F%40%40download%2FENCFF972ZQA.bigWig%7CHepG2%20HNRNPAB0%3A1%7C%7Crgb(3%2C%20116%2C%20178)%7C%7C%7Chttps%3A%2F%2Fwww.encodeproject.org%2Ffiles%2FENCFF027LKU%2F%40%40download%2FENCFF027LKU.bigWig%7CHepG2%20HNRNPU0%3A1%7C%7Crgb(3%2C%20116%2C%20178)';
browser1 = hic.createBrowser($('#app-container-1'), {
@turner
turner / juiceboxjs-example-browser.js
Last active May 19, 2017 13:13
Browser - Example - JuiceboxJS. An example of how to instantiate an empty JuiceboxJS browser. No contact matrix. No tracks.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href=../img/favicon.ico>
<title>Browser</title>
@turner
turner / igv-bootstap-tab.js
Last active May 10, 2017 21:31
IGV in Bootstrap Tab. Lazy-load browser.
<script type="text/javascript">
var browser,
container,
options,
$e = $("a[href='#igv']");
options =
{
reference: {
id: "hg19",
@turner
turner / tstable-snippet.js
Created July 25, 2016 15:33
CMap - Touchstone App - TSTable Snippet
var config =
{
$parent: $('#touchstone_table'),
height: '628px',
data: touchstoneData,
doSearch: true,
doShowCheckbox: true,
doRowSelection: true,
customButtons: true,
mouseOverHandler: function (tstable, e) {