FAQ.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <h2>Which 3D model format is best supported?</h2>
  13. <div>
  14. <p>
  15. The recommended format for importing and exporting assets is glTF (GL Transmission Format). Because glTF is focused on runtime asset delivery, it is compact to transmit and fast to load.
  16. </p>
  17. <p>
  18. three.js provides loaders for many other popular formats like FBX, Collada or OBJ as well. Nevertheless, you should always try to establish a glTF based workflow in your projects first.
  19. </p>
  20. </div>
  21. <h2>Why are there meta viewport tags in examples?</h2>
  22. <div>
  23. <div class="highlight highlight-text-html-basic"><pre>&lt;<span class="pl-ent">meta</span> <span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">"</span>viewport<span class="pl-pds">"</span></span> <span class="pl-e">content</span>=<span class="pl-s"><span class="pl-pds">"</span>width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0<span class="pl-pds">"</span></span>&gt;</pre></div>
  24. <p>These tags control viewport size and scale for mobile browsers (where page content may be rendered at different size than visible viewport).</p>
  25. <p><a href="https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html">Safari: Using the Viewport</a></p>
  26. <p><a href="https://developer.mozilla.org/en/Mobile/Viewport_meta_tag">MDN: Using the viewport meta tag</a></p>
  27. </div>
  28. <h2>How can scene scale be preserved on resize?</h2>
  29. <p>
  30. We want all objects, regardless of their distance from the camera, to appear the same size, even as the window is resized.
  31. The key equation to solving this is this formula for the visible height at a given distance:
  32. <code>
  33. visible_height = 2 * Math.tan( ( Math.PI / 180 ) * camera.fov / 2 ) * distance_from_camera;
  34. </code>
  35. If we increase the window height by a certain percentage, then what we want is the visible height at all distances
  36. to increase by the same percentage.
  37. This can not be done by changing the camera position. Instead you have to change the camera field-of-view.
  38. [link:http://jsfiddle.net/Q4Jpu/ Example].
  39. </p>
  40. <h2>Why is part of my object invisible?</h2>
  41. <p>
  42. This could be because of face culling. Faces have an orientation that decides which side is which. And the culling removes the backside in normal circumstances. To see if this is your problem, change the material side to THREE.DoubleSide.
  43. <code>material.side = THREE.DoubleSide</code>
  44. </p>
  45. </body>
  46. </html>