Gregg Tavares 7 年之前
父节点
当前提交
8eefd5bafb
共有 1 个文件被更改,包括 3 次插入2 次删除
  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;