Skip to content

Instantly share code, notes, and snippets.

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;
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;
@scummtomte
scummtomte / index.html
Last active February 10, 2021 12:48
porting shadertoy to three.js
<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">