Skip to content

Instantly share code, notes, and snippets.

View dimensions
function sceneSetup(){
scene = new THREE.Scene();
container = document.getElementById( 'canvas' );
var width = container.offsetWidth;
var height = container.offsetHeight;
camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );
camera.position.z = 2;
View gist.js
var PixiRenderer = function (_BaseRenderer) {
inherits(PixiRenderer, _BaseRenderer);
function PixiRenderer(element, stroke) {
classCallCheck(this, PixiRenderer);
var _this = possibleConstructorReturn(this, (PixiRenderer.__proto__ || Object.getPrototypeOf(PixiRenderer)).call(this, element));
_this.stroke = stroke;
_this.setColor = false;
@scummtomte
scummtomte / index.html
Last active Feb 10, 2021
porting shadertoy to three.js
View index.html
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/85/three.min.js"></script>
</head>
<body>
<img id="image" src="crib.jpg">
<script id="fragShader" type="shader-code">