Gregg Tavares hace 7 años
padre
commit
8eefd5bafb
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      threejs/lessons/resources/threejs-primitives.js

+ 3 - 2
threejs/lessons/resources/threejs-primitives.js

@@ -2,6 +2,9 @@
 
 function main() {
 
+  // even on low-res we want hi-res rendering so the lines are small
+  const pixelRatio = 2;
+
   const primitives = {
     BoxBufferGeometry: {
       create() {
@@ -539,8 +542,6 @@ function main() {
     return render;
   }
 
-  const pixelRatio = 2;  // even on low-res we want hi-res rendering
-
   function resizeRendererToDisplaySize(renderer) {
     const canvas = renderer.domElement;
     const width = canvas.clientWidth * pixelRatio;