index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>three.js webgl - loaders - gltf</title>
  5. <meta charset="utf-8" />
  6. <meta
  7. name="viewport"
  8. content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
  9. />
  10. <style>
  11. body {
  12. margin: 0;
  13. padding: 0;
  14. }
  15. #container {
  16. width: 100vw;
  17. height: 100vh;
  18. display: flex;
  19. align-items: center;
  20. }
  21. #sphere {
  22. width: 100%;
  23. min-width: 20%;
  24. height: 100%;
  25. flex-shrink: 0;
  26. }
  27. #sphere2 {
  28. width: 0;
  29. height: 100%;
  30. flex: 1;
  31. flex-shrink: 0;
  32. }
  33. .splitBox {
  34. width: 1%;
  35. height: 100%;
  36. cursor: col-resize;
  37. align-items: center;
  38. justify-content: center;
  39. background-color: #ccc;
  40. display: none;
  41. }
  42. .splitLine {
  43. width: 6px;
  44. height: 5%;
  45. background-color: #428cee;
  46. }
  47. .buttonBox {
  48. position: absolute;
  49. top: 10px;
  50. right: 10px;
  51. display: flex;
  52. flex-direction: column;
  53. gap: 10px;
  54. }
  55. #ec-button,
  56. #strength-button {
  57. width: 120px;
  58. height: 45px;
  59. border-radius: 5px;
  60. font-size: 18px;
  61. font-weight: bold;
  62. z-index: 1000;
  63. cursor: pointer;
  64. border: 1px solid #acacac;
  65. display: none;
  66. }
  67. #ec-button:hover,
  68. #strength-button:hover {
  69. border: 1px solid black;
  70. }
  71. </style>
  72. </head>
  73. <body>
  74. <div id="container">
  75. <div class="buttonBox">
  76. <button id="ec-button">效果对比</button
  77. ><button id="strength-button">微痕增强</button>
  78. </div>
  79. <model-viewer
  80. id="sphere"
  81. src="./static/gltf-13/low-13.gltf"
  82. camera-controls
  83. tone-mapping="aces"
  84. shadow-intensity="0"
  85. interaction-prompt="none"
  86. zoom-sensitivity="2.5"
  87. >
  88. </model-viewer>
  89. <div class="splitBox">
  90. <div class="splitLine"></div>
  91. </div>
  92. </div>
  93. <!-- <script type="module" src="./mobile.js"></script> -->
  94. <script type="importmap">
  95. {
  96. "imports": {
  97. "three": "https://cdn.jsdelivr.net/npm/three@0.160.0/examples/js/controls/TrackballControls.js"
  98. }
  99. }
  100. </script>
  101. <script type='module' src="./controls.js"></script>
  102. <script type="module" src="./main.js"></script>
  103. <script type="module" src="./model-viewer.min.js"></script>
  104. </body>
  105. </html>