Skip to content

Instantly share code, notes, and snippets.

@nbriz

nbriz/trails.js Secret

Last active May 17, 2017 11:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nbriz/27eab66b01f3cc09d8c2 to your computer and use it in GitHub Desktop.
Save nbriz/27eab66b01f3cc09d8c2 to your computer and use it in GitHub Desktop.
leave trails snippet, for threejs_playGnd
/* ------------------- INSTRUCTIONS -----
to leave trails
replace the 'renderer = new ...' on line 27
in the setup() function, with the code below
-------------------------------------- */
renderer = new THREE.WebGLRenderer( { preserveDrawingBuffer: true } );
renderer.autoClearColor = false;
/* --------------------------------------
to see this in action, move and/or spin
your mesh, add the code below to your
draw() function
-------------------------------------- */
mesh.position.x = Math.sin( Date.now() * 0.001 ) * 50;
mesh.rotation.z = Date.now() * 0.0005;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment