lesson.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. // Licensed under a BSD license. See license.html for license
  2. 'use strict';
  3. /* global jQuery */
  4. (function($){
  5. function getQueryParams() {
  6. const params = {};
  7. if (window.location.search) {
  8. window.location.search.substring(1).split('&').forEach(function(pair) {
  9. const keyValue = pair.split('=').map(function(kv) {
  10. return decodeURIComponent(kv);
  11. });
  12. params[keyValue[0]] = keyValue[1];
  13. });
  14. }
  15. return params;
  16. }
  17. $(document).ready(function($){
  18. const codeKeywordLinks = {
  19. AnimationAction: 'https://threejs.org/docs/api/animation/AnimationAction.html',
  20. AnimationClip: 'https://threejs.org/docs/api/animation/AnimationClip.html',
  21. AnimationMixer: 'https://threejs.org/docs/api/animation/AnimationMixer.html',
  22. AnimationObjectGroup: 'https://threejs.org/docs/api/animation/AnimationObjectGroup.html',
  23. AnimationUtils: 'https://threejs.org/docs/api/animation/AnimationUtils.html',
  24. KeyframeTrack: 'https://threejs.org/docs/api/animation/KeyframeTrack.html',
  25. PropertyBinding: 'https://threejs.org/docs/api/animation/PropertyBinding.html',
  26. PropertyMixer: 'https://threejs.org/docs/api/animation/PropertyMixer.html',
  27. BooleanKeyframeTrack: 'https://threejs.org/docs/api/animation/tracks/BooleanKeyframeTrack.html',
  28. ColorKeyframeTrack: 'https://threejs.org/docs/api/animation/tracks/ColorKeyframeTrack.html',
  29. NumberKeyframeTrack: 'https://threejs.org/docs/api/animation/tracks/NumberKeyframeTrack.html',
  30. QuaternionKeyframeTrack: 'https://threejs.org/docs/api/animation/tracks/QuaternionKeyframeTrack.html',
  31. StringKeyframeTrack: 'https://threejs.org/docs/api/animation/tracks/StringKeyframeTrack.html',
  32. VectorKeyframeTrack: 'https://threejs.org/docs/api/animation/tracks/VectorKeyframeTrack.html',
  33. Audio: 'https://threejs.org/docs/api/audio/Audio.html',
  34. AudioAnalyser: 'https://threejs.org/docs/api/audio/AudioAnalyser.html',
  35. AudioContext: 'https://threejs.org/docs/api/audio/AudioContext.html',
  36. AudioListener: 'https://threejs.org/docs/api/audio/AudioListener.html',
  37. PositionalAudio: 'https://threejs.org/docs/api/audio/PositionalAudio.html',
  38. ArrayCamera: 'https://threejs.org/docs/api/cameras/ArrayCamera.html',
  39. Camera: 'https://threejs.org/docs/api/cameras/Camera.html',
  40. CubeCamera: 'https://threejs.org/docs/api/cameras/CubeCamera.html',
  41. OrthographicCamera: 'https://threejs.org/docs/api/cameras/OrthographicCamera.html',
  42. PerspectiveCamera: 'https://threejs.org/docs/api/cameras/PerspectiveCamera.html',
  43. StereoCamera: 'https://threejs.org/docs/api/cameras/StereoCamera.html',
  44. Animation: 'https://threejs.org/docs/api/constants/Animation.html',
  45. Core: 'https://threejs.org/docs/api/constants/Core.html',
  46. CustomBlendingEquation: 'https://threejs.org/docs/api/constants/CustomBlendingEquations.html',
  47. DrawModes: 'https://threejs.org/docs/api/constants/DrawModes.html',
  48. Materials: 'https://threejs.org/docs/api/constants/Materials.html',
  49. Renderer: 'https://threejs.org/docs/api/constants/Renderer.html',
  50. Textures: 'https://threejs.org/docs/api/constants/Textures.html',
  51. BufferAttribute: 'https://threejs.org/docs/api/core/BufferAttribute.html',
  52. BufferGeometry: 'https://threejs.org/docs/api/core/BufferGeometry.html',
  53. Clock: 'https://threejs.org/docs/api/core/Clock.html',
  54. DirectGeometry: 'https://threejs.org/docs/api/core/DirectGeometry.html',
  55. EventDispatcher: 'https://threejs.org/docs/api/core/EventDispatcher.html',
  56. Face3: 'https://threejs.org/docs/api/core/Face3.html',
  57. Geometry: 'https://threejs.org/docs/api/core/Geometry.html',
  58. InstancedBufferAttribute: 'https://threejs.org/docs/api/core/InstancedBufferAttribute.html',
  59. InstancedBufferGeometry: 'https://threejs.org/docs/api/core/InstancedBufferGeometry.html',
  60. InstancedInterleavedBuffer: 'https://threejs.org/docs/api/core/InstancedInterleavedBuffer.html',
  61. InterleavedBuffer: 'https://threejs.org/docs/api/core/InterleavedBuffer.html',
  62. InterleavedBufferAttribute: 'https://threejs.org/docs/api/core/InterleavedBufferAttribute.html',
  63. Layers: 'https://threejs.org/docs/api/core/Layers.html',
  64. Object3D: 'https://threejs.org/docs/api/core/Object3D.html',
  65. Raycaster: 'https://threejs.org/docs/api/core/Raycaster.html',
  66. Uniform: 'https://threejs.org/docs/api/core/Uniform.html',
  67. BufferAttributeTypes: 'https://threejs.org/docs/api/core/bufferAttributeTypes/BufferAttributeTypes.html',
  68. Earcut: 'https://threejs.org/docs/api/extras/Earcut.html',
  69. ShapeUtils: 'https://threejs.org/docs/api/extras/ShapeUtils.html',
  70. Curve: 'https://threejs.org/docs/api/extras/core/Curve.html',
  71. CurvePath: 'https://threejs.org/docs/api/extras/core/CurvePath.html',
  72. Font: 'https://threejs.org/docs/api/extras/core/Font.html',
  73. Interpolations: 'https://threejs.org/docs/api/extras/core/Interpolations.html',
  74. Path: 'https://threejs.org/docs/api/extras/core/Path.html',
  75. Shape: 'https://threejs.org/docs/api/extras/core/Shape.html',
  76. ShapePath: 'https://threejs.org/docs/api/extras/core/ShapePath.html',
  77. ArcCurve: 'https://threejs.org/docs/api/extras/curves/ArcCurve.html',
  78. CatmullRomCurve3: 'https://threejs.org/docs/api/extras/curves/CatmullRomCurve3.html',
  79. CubicBezierCurve: 'https://threejs.org/docs/api/extras/curves/CubicBezierCurve.html',
  80. CubicBezierCurve3: 'https://threejs.org/docs/api/extras/curves/CubicBezierCurve3.html',
  81. EllipseCurve: 'https://threejs.org/docs/api/extras/curves/EllipseCurve.html',
  82. LineCurve: 'https://threejs.org/docs/api/extras/curves/LineCurve.html',
  83. LineCurve3: 'https://threejs.org/docs/api/extras/curves/LineCurve3.html',
  84. QuadraticBezierCurve: 'https://threejs.org/docs/api/extras/curves/QuadraticBezierCurve.html',
  85. QuadraticBezierCurve3: 'https://threejs.org/docs/api/extras/curves/QuadraticBezierCurve3.html',
  86. SplineCurve: 'https://threejs.org/docs/api/extras/curves/SplineCurve.html',
  87. ImmediateRenderObject: 'https://threejs.org/docs/api/extras/objects/ImmediateRenderObject.html',
  88. BoxBufferGeometry: 'https://threejs.org/docs/api/geometries/BoxBufferGeometry.html',
  89. BoxGeometry: 'https://threejs.org/docs/api/geometries/BoxGeometry.html',
  90. CircleBufferGeometry: 'https://threejs.org/docs/api/geometries/CircleBufferGeometry.html',
  91. CircleGeometry: 'https://threejs.org/docs/api/geometries/CircleGeometry.html',
  92. ConeBufferGeometry: 'https://threejs.org/docs/api/geometries/ConeBufferGeometry.html',
  93. ConeGeometry: 'https://threejs.org/docs/api/geometries/ConeGeometry.html',
  94. CylinderBufferGeometry: 'https://threejs.org/docs/api/geometries/CylinderBufferGeometry.html',
  95. CylinderGeometry: 'https://threejs.org/docs/api/geometries/CylinderGeometry.html',
  96. DodecahedronBufferGeometry: 'https://threejs.org/docs/api/geometries/DodecahedronBufferGeometry.html',
  97. DodecahedronGeometry: 'https://threejs.org/docs/api/geometries/DodecahedronGeometry.html',
  98. EdgesGeometry: 'https://threejs.org/docs/api/geometries/EdgesGeometry.html',
  99. ExtrudeBufferGeometry: 'https://threejs.org/docs/api/geometries/ExtrudeBufferGeometry.html',
  100. ExtrudeGeometry: 'https://threejs.org/docs/api/geometries/ExtrudeGeometry.html',
  101. IcosahedronBufferGeometry: 'https://threejs.org/docs/api/geometries/IcosahedronBufferGeometry.html',
  102. IcosahedronGeometry: 'https://threejs.org/docs/api/geometries/IcosahedronGeometry.html',
  103. LatheBufferGeometry: 'https://threejs.org/docs/api/geometries/LatheBufferGeometry.html',
  104. LatheGeometry: 'https://threejs.org/docs/api/geometries/LatheGeometry.html',
  105. OctahedronBufferGeometry: 'https://threejs.org/docs/api/geometries/OctahedronBufferGeometry.html',
  106. OctahedronGeometry: 'https://threejs.org/docs/api/geometries/OctahedronGeometry.html',
  107. ParametricBufferGeometry: 'https://threejs.org/docs/api/geometries/ParametricBufferGeometry.html',
  108. ParametricGeometry: 'https://threejs.org/docs/api/geometries/ParametricGeometry.html',
  109. PlaneBufferGeometry: 'https://threejs.org/docs/api/geometries/PlaneBufferGeometry.html',
  110. PlaneGeometry: 'https://threejs.org/docs/api/geometries/PlaneGeometry.html',
  111. PolyhedronBufferGeometry: 'https://threejs.org/docs/api/geometries/PolyhedronBufferGeometry.html',
  112. PolyhedronGeometry: 'https://threejs.org/docs/api/geometries/PolyhedronGeometry.html',
  113. RingBufferGeometry: 'https://threejs.org/docs/api/geometries/RingBufferGeometry.html',
  114. RingGeometry: 'https://threejs.org/docs/api/geometries/RingGeometry.html',
  115. ShapeBufferGeometry: 'https://threejs.org/docs/api/geometries/ShapeBufferGeometry.html',
  116. ShapeGeometry: 'https://threejs.org/docs/api/geometries/ShapeGeometry.html',
  117. SphereBufferGeometry: 'https://threejs.org/docs/api/geometries/SphereBufferGeometry.html',
  118. SphereGeometry: 'https://threejs.org/docs/api/geometries/SphereGeometry.html',
  119. TetrahedronBufferGeometry: 'https://threejs.org/docs/api/geometries/TetrahedronBufferGeometry.html',
  120. TetrahedronGeometry: 'https://threejs.org/docs/api/geometries/TetrahedronGeometry.html',
  121. TextBufferGeometry: 'https://threejs.org/docs/api/geometries/TextBufferGeometry.html',
  122. TextGeometry: 'https://threejs.org/docs/api/geometries/TextGeometry.html',
  123. TorusBufferGeometry: 'https://threejs.org/docs/api/geometries/TorusBufferGeometry.html',
  124. TorusGeometry: 'https://threejs.org/docs/api/geometries/TorusGeometry.html',
  125. TorusKnotBufferGeometry: 'https://threejs.org/docs/api/geometries/TorusKnotBufferGeometry.html',
  126. TorusKnotGeometry: 'https://threejs.org/docs/api/geometries/TorusKnotGeometry.html',
  127. TubeBufferGeometry: 'https://threejs.org/docs/api/geometries/TubeBufferGeometry.html',
  128. TubeGeometry: 'https://threejs.org/docs/api/geometries/TubeGeometry.html',
  129. WireframeGeometry: 'https://threejs.org/docs/api/geometries/WireframeGeometry.html',
  130. ArrowHelper: 'https://threejs.org/docs/api/helpers/ArrowHelper.html',
  131. AxesHelper: 'https://threejs.org/docs/api/helpers/AxesHelper.html',
  132. BoxHelper: 'https://threejs.org/docs/api/helpers/BoxHelper.html',
  133. Box3Helper: 'https://threejs.org/docs/api/helpers/Box3Helper.html',
  134. CameraHelper: 'https://threejs.org/docs/api/helpers/CameraHelper.html',
  135. DirectionalLightHelper: 'https://threejs.org/docs/api/helpers/DirectionalLightHelper.html',
  136. FaceNormalsHelper: 'https://threejs.org/docs/api/helpers/FaceNormalsHelper.html',
  137. GridHelper: 'https://threejs.org/docs/api/helpers/GridHelper.html',
  138. PolarGridHelper: 'https://threejs.org/docs/api/helpers/PolarGridHelper.html',
  139. HemisphereLightHelper: 'https://threejs.org/docs/api/helpers/HemisphereLightHelper.html',
  140. PlaneHelper: 'https://threejs.org/docs/api/helpers/PlaneHelper.html',
  141. PointLightHelper: 'https://threejs.org/docs/api/helpers/PointLightHelper.html',
  142. RectAreaLightHelper: 'https://threejs.org/docs/api/helpers/RectAreaLightHelper.html',
  143. SkeletonHelper: 'https://threejs.org/docs/api/helpers/SkeletonHelper.html',
  144. SpotLightHelper: 'https://threejs.org/docs/api/helpers/SpotLightHelper.html',
  145. VertexNormalsHelper: 'https://threejs.org/docs/api/helpers/VertexNormalsHelper.html',
  146. AmbientLight: 'https://threejs.org/docs/api/lights/AmbientLight.html',
  147. DirectionalLight: 'https://threejs.org/docs/api/lights/DirectionalLight.html',
  148. HemisphereLight: 'https://threejs.org/docs/api/lights/HemisphereLight.html',
  149. Light: 'https://threejs.org/docs/api/lights/Light.html',
  150. PointLight: 'https://threejs.org/docs/api/lights/PointLight.html',
  151. RectAreaLight: 'https://threejs.org/docs/api/lights/RectAreaLight.html',
  152. SpotLight: 'https://threejs.org/docs/api/lights/SpotLight.html',
  153. DirectionalLightShadow: 'https://threejs.org/docs/api/lights/shadows/DirectionalLightShadow.html',
  154. LightShadow: 'https://threejs.org/docs/api/lights/shadows/LightShadow.html',
  155. SpotLightShadow: 'https://threejs.org/docs/api/lights/shadows/SpotLightShadow.html',
  156. AnimationLoader: 'https://threejs.org/docs/api/loaders/AnimationLoader.html',
  157. AudioLoader: 'https://threejs.org/docs/api/loaders/AudioLoader.html',
  158. BufferGeometryLoader: 'https://threejs.org/docs/api/loaders/BufferGeometryLoader.html',
  159. Cache: 'https://threejs.org/docs/api/loaders/Cache.html',
  160. CompressedTextureLoader: 'https://threejs.org/docs/api/loaders/CompressedTextureLoader.html',
  161. CubeTextureLoader: 'https://threejs.org/docs/api/loaders/CubeTextureLoader.html',
  162. DataTextureLoader: 'https://threejs.org/docs/api/loaders/DataTextureLoader.html',
  163. FileLoader: 'https://threejs.org/docs/api/loaders/FileLoader.html',
  164. FontLoader: 'https://threejs.org/docs/api/loaders/FontLoader.html',
  165. ImageBitmapLoader: 'https://threejs.org/docs/api/loaders/ImageBitmapLoader.html',
  166. ImageLoader: 'https://threejs.org/docs/api/loaders/ImageLoader.html',
  167. JSONLoader: 'https://threejs.org/docs/api/loaders/JSONLoader.html',
  168. Loader: 'https://threejs.org/docs/api/loaders/Loader.html',
  169. LoaderUtils: 'https://threejs.org/docs/api/loaders/LoaderUtils.html',
  170. MaterialLoader: 'https://threejs.org/docs/api/loaders/MaterialLoader.html',
  171. ObjectLoader: 'https://threejs.org/docs/api/loaders/ObjectLoader.html',
  172. TextureLoader: 'https://threejs.org/docs/api/loaders/TextureLoader.html',
  173. DefaultLoadingManager: 'https://threejs.org/docs/api/loaders/managers/DefaultLoadingManager.html',
  174. LoadingManager: 'https://threejs.org/docs/api/loaders/managers/LoadingManager.html',
  175. LineBasicMaterial: 'https://threejs.org/docs/api/materials/LineBasicMaterial.html',
  176. LineDashedMaterial: 'https://threejs.org/docs/api/materials/LineDashedMaterial.html',
  177. Material: 'https://threejs.org/docs/api/materials/Material.html',
  178. MeshBasicMaterial: 'https://threejs.org/docs/api/materials/MeshBasicMaterial.html',
  179. MeshDepthMaterial: 'https://threejs.org/docs/api/materials/MeshDepthMaterial.html',
  180. MeshLambertMaterial: 'https://threejs.org/docs/api/materials/MeshLambertMaterial.html',
  181. MeshNormalMaterial: 'https://threejs.org/docs/api/materials/MeshNormalMaterial.html',
  182. MeshPhongMaterial: 'https://threejs.org/docs/api/materials/MeshPhongMaterial.html',
  183. MeshPhysicalMaterial: 'https://threejs.org/docs/api/materials/MeshPhysicalMaterial.html',
  184. MeshStandardMaterial: 'https://threejs.org/docs/api/materials/MeshStandardMaterial.html',
  185. MeshToonMaterial: 'https://threejs.org/docs/api/materials/MeshToonMaterial.html',
  186. PointsMaterial: 'https://threejs.org/docs/api/materials/PointsMaterial.html',
  187. RawShaderMaterial: 'https://threejs.org/docs/api/materials/RawShaderMaterial.html',
  188. ShaderMaterial: 'https://threejs.org/docs/api/materials/ShaderMaterial.html',
  189. ShadowMaterial: 'https://threejs.org/docs/api/materials/ShadowMaterial.html',
  190. SpriteMaterial: 'https://threejs.org/docs/api/materials/SpriteMaterial.html',
  191. Box2: 'https://threejs.org/docs/api/math/Box2.html',
  192. Box3: 'https://threejs.org/docs/api/math/Box3.html',
  193. Color: 'https://threejs.org/docs/api/math/Color.html',
  194. Cylindrical: 'https://threejs.org/docs/api/math/Cylindrical.html',
  195. Euler: 'https://threejs.org/docs/api/math/Euler.html',
  196. Frustum: 'https://threejs.org/docs/api/math/Frustum.html',
  197. Interpolant: 'https://threejs.org/docs/api/math/Interpolant.html',
  198. Line3: 'https://threejs.org/docs/api/math/Line3.html',
  199. Math: 'https://threejs.org/docs/api/math/Math.html',
  200. Matrix3: 'https://threejs.org/docs/api/math/Matrix3.html',
  201. Matrix4: 'https://threejs.org/docs/api/math/Matrix4.html',
  202. Plane: 'https://threejs.org/docs/api/math/Plane.html',
  203. Quaternion: 'https://threejs.org/docs/api/math/Quaternion.html',
  204. Ray: 'https://threejs.org/docs/api/math/Ray.html',
  205. Sphere: 'https://threejs.org/docs/api/math/Sphere.html',
  206. Spherical: 'https://threejs.org/docs/api/math/Spherical.html',
  207. Triangle: 'https://threejs.org/docs/api/math/Triangle.html',
  208. Vector2: 'https://threejs.org/docs/api/math/Vector2.html',
  209. Vector3: 'https://threejs.org/docs/api/math/Vector3.html',
  210. Vector4: 'https://threejs.org/docs/api/math/Vector4.html',
  211. CubicInterpolant: 'https://threejs.org/docs/api/math/interpolants/CubicInterpolant.html',
  212. DiscreteInterpolant: 'https://threejs.org/docs/api/math/interpolants/DiscreteInterpolant.html',
  213. LinearInterpolant: 'https://threejs.org/docs/api/math/interpolants/LinearInterpolant.html',
  214. QuaternionLinearInterpolant: 'https://threejs.org/docs/api/math/interpolants/QuaternionLinearInterpolant.html',
  215. Bone: 'https://threejs.org/docs/api/objects/Bone.html',
  216. Group: 'https://threejs.org/docs/api/objects/Group.html',
  217. Line: 'https://threejs.org/docs/api/objects/Line.html',
  218. LineLoop: 'https://threejs.org/docs/api/objects/LineLoop.html',
  219. LineSegments: 'https://threejs.org/docs/api/objects/LineSegments.html',
  220. LOD: 'https://threejs.org/docs/api/objects/LOD.html',
  221. Mesh: 'https://threejs.org/docs/api/objects/Mesh.html',
  222. Points: 'https://threejs.org/docs/api/objects/Points.html',
  223. Skeleton: 'https://threejs.org/docs/api/objects/Skeleton.html',
  224. SkinnedMesh: 'https://threejs.org/docs/api/objects/SkinnedMesh.html',
  225. Sprite: 'https://threejs.org/docs/api/objects/Sprite.html',
  226. WebGLRenderer: 'https://threejs.org/docs/api/renderers/WebGLRenderer.html',
  227. WebGLRenderTarget: 'https://threejs.org/docs/api/renderers/WebGLRenderTarget.html',
  228. WebGLRenderTargetCube: 'https://threejs.org/docs/api/renderers/WebGLRenderTargetCube.html',
  229. ShaderChunk: 'https://threejs.org/docs/api/renderers/shaders/ShaderChunk.html',
  230. ShaderLib: 'https://threejs.org/docs/api/renderers/shaders/ShaderLib.html',
  231. UniformsLib: 'https://threejs.org/docs/api/renderers/shaders/UniformsLib.html',
  232. UniformsUtils: 'https://threejs.org/docs/api/renderers/shaders/UniformsUtils.html',
  233. Fog: 'https://threejs.org/docs/api/scenes/Fog.html',
  234. FogExp2: 'https://threejs.org/docs/api/scenes/FogExp2.html',
  235. Scene: 'https://threejs.org/docs/api/scenes/Scene.html',
  236. CanvasTexture: 'https://threejs.org/docs/api/textures/CanvasTexture.html',
  237. CompressedTexture: 'https://threejs.org/docs/api/textures/CompressedTexture.html',
  238. CubeTexture: 'https://threejs.org/docs/api/textures/CubeTexture.html',
  239. DataTexture: 'https://threejs.org/docs/api/textures/DataTexture.html',
  240. DepthTexture: 'https://threejs.org/docs/api/textures/DepthTexture.html',
  241. Texture: 'https://threejs.org/docs/api/textures/Texture.html',
  242. VideoTexture: 'https://threejs.org/docs/api/textures/VideoTexture.html',
  243. CCDIKSolver: 'https://threejs.org/docs/examples/animations/CCDIKSolver.html',
  244. MMDAnimationHelper: 'https://threejs.org/docs/examples/animations/MMDAnimationHelper.html',
  245. MMDPhysics: 'https://threejs.org/docs/examples/animations/MMDPhysics.html',
  246. OrbitControls: 'https://threejs.org/docs/examples/controls/OrbitControls.html',
  247. ConvexBufferGeometry: 'https://threejs.org/docs/examples/geometries/ConvexBufferGeometry.html',
  248. ConvexGeometry: 'https://threejs.org/docs/examples/geometries/ConvexGeometry.html',
  249. DecalGeometry: 'https://threejs.org/docs/examples/geometries/DecalGeometry.html',
  250. BabylonLoader: 'https://threejs.org/docs/examples/loaders/BabylonLoader.html',
  251. GLTFLoader: 'https://threejs.org/docs/examples/loaders/GLTFLoader.html',
  252. MMDLoader: 'https://threejs.org/docs/examples/loaders/MMDLoader.html',
  253. MTLLoader: 'https://threejs.org/docs/examples/loaders/MTLLoader.html',
  254. OBJLoader: 'https://threejs.org/docs/examples/loaders/OBJLoader.html',
  255. OBJLoader2: 'https://threejs.org/docs/examples/loaders/OBJLoader2.html',
  256. LoaderSupport: 'https://threejs.org/docs/examples/loaders/LoaderSupport.html',
  257. PCDLoader: 'https://threejs.org/docs/examples/loaders/PCDLoader.html',
  258. PDBLoader: 'https://threejs.org/docs/examples/loaders/PDBLoader.html',
  259. SVGLoader: 'https://threejs.org/docs/examples/loaders/SVGLoader.html',
  260. TGALoader: 'https://threejs.org/docs/examples/loaders/TGALoader.html',
  261. PRWMLoader: 'https://threejs.org/docs/examples/loaders/PRWMLoader.html',
  262. Lensflare: 'https://threejs.org/docs/examples/objects/Lensflare.html',
  263. GLTFExporter: 'https://threejs.org/docs/examples/exporters/GLTFExporter.html',
  264. };
  265. function getKeywordLink(keyword) {
  266. return keyword.startsWith('THREE.')
  267. ? codeKeywordLinks[keyword.substring(6)]
  268. : codeKeywordLinks[keyword];
  269. }
  270. $('code').filter(function() {
  271. return getKeywordLink(this.textContent) &&
  272. this.parentElement.nodeName !== 'A';
  273. }).wrap(function() {
  274. const a = document.createElement('a');
  275. a.href = getKeywordLink(this.textContent);
  276. return a;
  277. });
  278. const methodPropertyRE = /^(\w+).(\w+)$/;
  279. const classRE = /^(\w+)$/;
  280. $('a').each(function() {
  281. const href = this.getAttribute('href');
  282. const m = methodPropertyRE.exec(href);
  283. if (m) {
  284. const codeKeywordLink = getKeywordLink(m[1]);
  285. if (codeKeywordLink) {
  286. this.setAttribute('href', `${codeKeywordLink}#${m[2]}`);
  287. }
  288. } else if (classRE.test(href)) {
  289. const codeKeywordLink = getKeywordLink(href);
  290. if (codeKeywordLink) {
  291. this.setAttribute('href', codeKeywordLink);
  292. }
  293. }
  294. });
  295. const linkImgs = function(bigHref) {
  296. return function() {
  297. const a = document.createElement('a');
  298. a.href = bigHref;
  299. a.title = this.alt;
  300. a.className = this.className;
  301. a.setAttribute('align', this.align);
  302. this.setAttribute('align', '');
  303. this.className = '';
  304. this.style.border = '0px';
  305. return a;
  306. };
  307. };
  308. const linkSmallImgs = function(ext) {
  309. return function() {
  310. const src = this.src;
  311. return linkImgs(src.substr(0, src.length - 7) + ext);
  312. };
  313. };
  314. const linkBigImgs = function() {
  315. const src = $(this).attr('big');
  316. return linkImgs(src);
  317. };
  318. $('img[big$=".jpg"]').wrap(linkBigImgs);
  319. $('img[src$="-sm.jpg"]').wrap(linkSmallImgs('.jpg'));
  320. $('img[src$="-sm.gif"]').wrap(linkSmallImgs('.gif'));
  321. $('img[src$="-sm.png"]').wrap(linkSmallImgs('.png'));
  322. $('pre>code')
  323. .unwrap()
  324. .replaceWith(function() {
  325. return $('<pre class="prettyprint showlinemods">' + this.innerHTML + '</pre>');
  326. });
  327. if (window.prettyPrint) {
  328. window.prettyPrint();
  329. }
  330. const params = getQueryParams();
  331. if (params.doubleSpace || params.doublespace) {
  332. document.body.className = document.body.className + ' doubleSpace';
  333. }
  334. $('.language').on('change', function() {
  335. window.location.href = this.value;
  336. });
  337. });
  338. }(jQuery));