{"id":32409,"date":"2022-12-29T10:00:31","date_gmt":"2022-12-29T02:00:31","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=32409"},"modified":"2022-12-29T10:00:42","modified_gmt":"2022-12-29T02:00:42","slug":"browser-3d-tours","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/browser-3d-tours.html","title":{"rendered":"3D\u5168\u666f\uff01\u8fd9\u4e48\u725b\uff01\uff01"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5982\u679c\u4f60\u7528\u8fc7\u7f51\u9875\u7248\u7684\u767e\u5ea6\u5730\u56fe\uff0c\u4f60\u5927\u69823D\u5168\u666f\u56fe\u6d4f\u89c8\u662f\u4e00\u79cd\u600e\u6837\u7684\u9177\u70ab\u4f53\u9a8c\uff1a\u5728\u4e00\u4e2a\u70b9\u53ef\u4ee5360\u5ea6\u73af\u987e\u5468\u56f4\u7684\u5efa\u7b51\u3001\u666f\u8272\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u56db\u5468\u79fb\u52a8\uff0c\u5c31\u50cf\u8eab\u4e34\u5176\u5883\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n \u5168\u666f\u56fe\u5171\u5206\u4e3a\u4e09\u79cd\uff1a<\/strong><\/div>\n \u2460\u7403\u9762\u5168\u666f\u56fe<\/strong><\/span><\/div>\n \u5229\u7528\u4e00\u5f20\u5168\u666f\u56fe\u56f4\u6210\u4e00\u4e2a\u7403\uff0c\u81ea\u8eab\u4f4d\u7f6e\u4f4d\u4e8e\u7403\u4f53\u5185\u3002\u7531\u4e8e\u56fe\u7247\u662f\u77e9\u5f62\uff0c\u6240\u4ee5\u6700\u4e0a\u548c\u6700\u4e0b\u7684\u7f1d\u5408\u5904\u5f88\u660e\u663e\u5c31\u80fd\u591f\u770b\u5f97\u51fa\u6765\u3002<\/p>\n \u7403\u9762\u5168\u666f\u56fe\u662f\u6700\u63a5\u8fd1\u4eba\u773c\u7684\u6784\u5efa\u6a21\u5f0f\uff0c\u82e5\u5229\u7528\u591a\u4e2a\u7acb\u9762\u6784\u5efa\uff0c\u62fc\u63a5\u65b9\u6cd5\u7e41\u7410\uff0c\u6027\u80fd\u6d88\u8017\u9ad8\u3002<\/p>\n \u56e0\u6b64\uff0c\u672c\u6587\u4ecb\u7ecd\u7684\u662f\u4e0a\u8ff0\u901a\u8fc7\u4e00\u5f20\u5168\u666f\u56fe\u6784\u6210\u7684\u7403\u9762\u5168\u666f\u56fe\u3002<\/p>\n \u2461\u7acb\u65b9\u4f53\u5168\u666f\u56fe<\/strong><\/span><\/div>\n \u4e00\u4e2a\u7acb\u65b9\u4f53\uff0c\u6709\u516d\u4e2a\u9762\u7ec4\u6210\uff0c\u6240\u4ee5\u5c31\u9700\u8981\u516d\u5f20\u56fe\u7247\u5566\u3002\u81ea\u8eab\u7684\u4f4d\u7f6e\u4f4d\u4e8e\u7acb\u65b9\u4f53\u4e2d\u95f4\u3002\u8fd9\u4e5f\u662f\u6700\u5e38\u89c1\u7684\u5168\u666f\u56fe\u6784\u5efa\u6a21\u5f0f\u3002<\/p>\n \u2462\u67f1\u72b6\u5168\u666f\u56fe<\/strong><\/span><\/div>\n \u8fd9\u4e2a\u5219\u662f\u524d\u4e24\u79cd\u6784\u5efa\u6a21\u5f0f\u7684\u7ed3\u5408\u7248\u5566\u3002<\/p>\n \u51c6\u5907<\/strong><\/div>\n \u5728\u6d4f\u89c8\u5668\u4e2d\u5b9e\u73b03D\u5168\u666f\u6d4f\u89c8\u5f00\u53d1\uff0c\u9996\u5148\u9700\u8981\u51e0\u6837\u4e1c\u897f\uff1a<\/p>\n \u2460\u652f\u6301WebGL\u548ccanvas\u7684\u6d4f\u89c8\u5668<\/strong><\/span><\/div>\n \u6bd4\u5982\u8bf4Google Chrome 9+\u548cMozilla Firefox 4+\u7b49\u3002<\/p>\n \u2461Three.js<\/strong><\/span><\/div>\n \u8fd9\u91cc\u5c31\u4e0d\u4ecb\u7ecd\u8fd9\u4e2a\u63d2\u4ef6\u4e86\uff0c\u6240\u4ee5\u9605\u8bfb\u672c\u6587\u9700\u8981Three.js\u7b80\u5355\u7684\u57fa\u7840 O(\u2229_\u2229)O~ \u2462photo-sphere-viewer.js<\/strong><\/span><\/div>\n \u8fd9\u662f\u57fa\u4e8eThree.js\u5f00\u53d1\u7684\u67f1\u72b6\u5168\u666f\u56fe\u63d2\u4ef6<\/p>\n \u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/JeremyHeleine\/Photo-Sphere-Viewer<\/p>\n \u2463\u5168\u666f\u56fe<\/strong><\/span><\/div>\n <\/p>\n \u50cf\u4e0a\u56fe\u90a3\u6837\u7684360\u5ea6\u5168\u666f\u56fe\uff0c\u6700\u597d\u662f\u5de6\u53f3\u80fd\u591f\u5b8c\u7f8e\u62fc\u63a5\u7684\uff0c\u8fd9\u6837\u73af\u987e\u65f6\u624d\u81ea\u7136\u3002<\/p>\n \u73b0\u5728\u4e5f\u6709\u80fd\u591f\u751f\u6210\u5168\u666f\u56fe\u7684\u5de5\u5177\uff0c\u8fd9\u91cc\u5c31\u4e0d\u4ecb\u7ecd\u5566\u3002<\/p>\n \u5168\u666f\u56fe\u7d20\u6750\u7ad9\u70b9\uff1ahttp:\/\/www.tupian114.com\/tupian\/quanjing.html<\/p>\n \u5f00\u59cb<\/strong><\/div>\n html\u90e8\u5206\uff1a<\/strong><\/span><\/div>\n <\/p>\n \u9700\u8981\u4e00\u4e2a\u6807\u7b7e\u5143\u7d20\u505a\u4e3a\u5168\u666f\u56fe\u7684\u5bb9\u5668,\u5e76\u5f15\u5165\u6240\u9700\u7684\u4e24\u4e2a\u63d2\u4ef6\u3002<\/p>\n js\u90e8\u5206\uff1a<\/strong><\/span><\/div>\n \u521d\u59cb\u5316\u63d2\u4ef6\uff0c\u521b\u5efa\u4e00\u4e2aphotosphereviewer\u5bf9\u8c61\u3002<\/p>\n <\/p>\n \u5176\u4e2d\uff0c\u524d\u4e24\u4e2a\u9009\u9879panorama\u548ccontainer\u662f\u5fc5\u987b\u7684\uff0c\u5176\u4ed6\u90fd\u4e3a\u53ef\u9009\u9879\u3002<\/p>\n \u7136\u540e\uff0c3D\u5168\u666f\u6548\u679c\u5c31\u8fd9\u6837\u5b9e\u73b0\u5566\uff0c\u7b80\u5355\u5427\u3002<\/p>\n \u90a3\u63a5\u4e0b\u6765\u5c31\u4ecb\u7ecd\u4e00\u4e0b\u914d\u7f6e\u53c2\u6570\u53ca\u65b9\u6cd5\u5427\u3002<\/p>\n \u914d\u7f6e\u53c2\u6570\u4ecb\u7ecd<\/strong><\/span><\/div>\n panorama\uff1a(\u5fc5\u9009)\u5168\u666f\u56fe\u7684\u8def\u5f84\u3002<\/p>\n container\uff1a(\u5fc5\u9009)\u653e\u7f6e\u5168\u666f\u56fe\u7684\u5bb9\u5668\u3002<\/p>\n autoload\uff1a(\u9ed8\u8ba4\u4e3atrue)true\u4e3a\u81ea\u52a8\u52a0\u8f7d\u5168\u666f\u56fe\uff0cfalse\u4e3a\u8fdf\u70b9\u52a0\u8f7d\u5168\u666f\u56fe(\u901a.\u8fc7load\u65b9\u6cd5)\u3002<\/p>\n usexmpdata\uff1a(\u9ed8\u8ba4\u503c\u4e3atrue)photo sphere viewer\u662f\u5426\u5fc5\u987b\u8bfb\u5165xmp\u6570\u636e\uff0cfalse\u4e3a\u4e0d\u5fc5\u987b\u3002<\/p>\n cors_anonymous\uff1a(\u9ed8\u8ba4\u503c\u4e3atrue)true\u4e3a\u4e0d\u80fd\u901a\u8fc7cookies\u83b7\u5f97\u7528\u6237<\/p>\n pano_size\uff1a(\u9ed8\u8ba4\u503c\u4e3anull)\u5168\u666f\u56fe\u7684\u5927\u5c0f\uff0c\u662f\u5426\u88c1\u5207\u3002<\/p>\n default_position\uff1a(\u9ed8\u8ba4\u503c\u4e3a0)\u5b9a\u4e49\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u7528\u6237\u770b\u89c1\u7684\u7b2c\u4e00\u4e2a\u70b9\uff0c\u4f8b\u5982\uff1a{long: math.pi, lat: math.pi\/2}\u3002<\/p>\n min_fov\uff1a(\u9ed8\u8ba4\u503c\u4e3a30)\u89c2\u5bdf\u7684\u6700\u5c0f\u533a\u57df\uff0c\u5355\u4f4ddegrees\uff0c\u57281-179\u4e4b\u95f4\u3002<\/p>\n max_fov\uff1a(\u9ed8\u8ba4\u503c\u4e3a90)\u89c2\u5bdf\u7684\u6700\u5927\u533a\u57df\uff0c\u5355\u4f4ddegrees\uff0c\u57281-179\u4e4b\u95f4\u3002<\/p>\n allow_user_interactions\uff1a(\u9ed8\u8ba4\u503c\u4e3atrue)\u8bbe\u7f6e\u4e3afalse\uff0c\u5219\u7981\u6b62\u7528\u6237\u548c\u5168\u666f\u56fe\u4ea4\u4e92(\u5bfc\u822a\u6761\u4e0d\u53ef\u7528)\u3002<\/p>\n allow_scroll_to_zoom\uff1a(\u9ed8\u8ba4\u503c\u4e3atrue)\u82e5\u8bbe\u7f6e\u4e3afalse\uff0c\u5219\u7528\u6237\u4e0d\u80fd\u901a\u8fc7\u9f20\u6807\u6eda\u52a8\u8fdb\u884c\u7f29\u653e\u56fe\u7247\u3002<\/p>\n tilt_up_max\uff1a(\u9ed8\u8ba4\u503c\u4e3amath.pi\/2)\u5411\u4e0a\u503e\u659c\u7684\u6700\u5927\u89d2\u5ea6\uff0c\u5355\u4f4dradians\u3002<\/p>\n tilt_down_max\uff1a(\u9ed8\u8ba4\u503c\u4e3amath.pi\/2)\u5411\u4e0b\u503e\u659c\u7684\u6700\u5927\u89d2\u5ea6\uff0c\u5355\u4f4dradians\u3002<\/p>\n min_longitude\uff1a(\u9ed8\u8ba4\u503c\u4e3a0)\u80fd\u591f\u5c55\u793a\u7684\u6700\u5c0f\u7ecf\u5ea6\u3002<\/p>\n max_longitude\uff1a(\u9ed8\u8ba4\u503c\u4e3a2PI)\u80fd\u591f\u5c55\u793a\u7684\u6700\u5927\u7ef4\u5ea6\u3002<\/p>\n zoome_level\uff1a(\u9ed8\u8ba4\u503c\u4e3a0)\u9ed8\u8ba4\u7684\u7f29\u653e\u7ea7\u522b\uff0c\u503c\u57280-100\u4e4b\u95f4\u3002<\/p>\n long_offset\uff1a(\u9ed8\u8ba4\u503c\u4e3aPI\/360)mouse\/touch\u79fb\u52a8\u65f6\u6bcf\u50cf\u7d20\u7ecf\u8fc7\u7684\u7ecf\u5ea6\u503c\u3002<\/p>\n lat_offset\uff1a(\u9ed8\u8ba4\u503c\u4e3api\/180)mouse\/touch\u79fb\u52a8\u65f6\u6bcf\u50cf\u7d20\u7ecf\u8fc7\u7684\u7eac\u5ea6\u503c\u3002<\/p>\n time_anim(\u9ed8\u8ba4\u503c\u4e3a2000)\u5168\u666f\u56fe\u5728time_anim\u6beb\u79d2\u540e\u4f1a\u81ea\u52a8\u8fdb\u884c\u52a8\u753b\u3002(\u8bbe\u7f6e\u4e3afalse\u7981\u7528\u5b83)<\/p>\n reverse_anim\uff1a(\u9ed8\u8ba4\u503c\u4e3atrue)\u5f53\u6c34\u5e73\u65b9\u5411\u5230\u8fbe\u6700\u5927\/\u6700\u5c0f\u7684\u7ecf\u5ea6\u65f6\uff0c\u52a8\u753b\u65b9\u5411\u662f\u5426\u53cd\u8f6c(\u4ec5\u4ec5\u662f\u4e0d\u80fd\u770b\u5230\u5b8c\u6574\u7684\u5706)\u3002<\/p>\n anim_speed\uff1a(\u9ed8\u8ba4\u503c\u4e3a2rpm)\u52a8\u753b\u6bcf\u79d2\/\u5206\u949f\u591a\u5c11\u7684\u901f\u5ea6\u3002<\/p>\n vertical_anim_speed\uff1a(\u9ed8\u8ba4\u503c\u4e3a2rpm)\u5782\u76f4\u65b9\u5411\u7684\u52a8\u753b\u6bcf\u79d2\/\u5206\u949f\u591a\u5c11\u7684\u901f\u5ea6\u3002<\/p>\n vertical_anim_target\uff1a(\u9ed8\u8ba4\u503c\u4e3a0)\u5f53\u81ea\u52a8\u65cb\u8f6c\u65f6\u7684\u7ef4\u5ea6\uff0c\u9ed8\u8ba4\u4e3a\u8d64\u9053\u3002<\/p>\n navbar\uff1a(\u9ed8\u8ba4\u4e3afalse)\u663e\u793a\u5bfc\u822a\u6761\u3002<\/p>\n navbar_style\uff1a(\u9ed8\u8ba4\u503c\u4e3afalse)\u5bfc\u822a\u6761\u7684\u6837\u5f0f\u3002\u6709\u6548\u7684\u5c5e\u6027\uff1a<\/p>\n backgroundColor\uff1a\u5bfc\u822a\u6761\u80cc\u666f\u8272(\u9ed8\u8ba4\u503crgba(61, 61, 61, 0.5));<\/p>\n buttonsColor\uff1a\u6309\u94ae\u524d\u666f\u8272(\u9ed8\u8ba4\u503c rgba(255, 255, 255, 0.7));<\/p>\n buttonBackgroundColor\uff1a\u6309\u94ae\u6fc0\u6d3b\u65f6\u7684\u80cc\u666f\u8272(\u9ed8\u8ba4\u503c rgba(255, 255, 255, 0.1));<\/p>\n buttonsHeight\uff1a\u6309\u94ae\u9ad8\u5ea6\uff0c\u5355\u4f4dpx(\u9ed8\u8ba4\u503c 20);<\/p>\n autorotateThickness\uff1a\u81ea\u52a8\u65cb\u8f6c\u56fe\u7247\u7684\u5c42(\u9ed8\u8ba4\u503c 1);<\/p>\n zoomRangeWidth\uff1a\u7f29\u653e\u6e38\u6807\u7684\u5bbd\u5ea6\uff0c\u5355\u4f4dpx(\u9ed8\u8ba4\u503c 50);<\/p>\n zoomRangeThickness\uff1a\u7f29\u653e\u6e38\u6807\u7684\u5c42(\u9ed8\u8ba4\u503c 1);<\/p>\n zoomRangeDisk\uff1a\u7f29\u653e\u6e38\u6807\u7684\u653e\u5927\u7387\uff0c\u5355\u4f4dpx(\u9ed8\u8ba4\u503c 7);<\/p>\n fullscreenRatio\uff1a\u5168\u5c4f\u56fe\u6807\u7684\u6bd4\u4f8b(\u9ed8\u8ba4\u503c 4\/3);<\/p>\n fullscreenThickneee\uff1a\u5168\u5c4f\u56fe\u7247\u7684\u5c42\uff0c\u5355\u4f4dpx(\u9ed8\u8ba4\u503c 2)<\/p>\n loading_msg\uff1a(\u9ed8\u8ba4\u503c\u4e3aLoading...)\u52a0\u8f7d\u4fe1\u606f\u3002<\/p>\n loading_img\uff1a(\u9ed8\u8ba4\u503c \u4e3anull)loading\u56fe\u7247\u7684\u8def\u5f84\u3002<\/p>\n loading_html\uff1a(\u9ed8\u8ba4\u503c \u4e3anull)html\u52a0\u8f7d\u5668(\u6dfb\u52a0\u5230\u5bb9\u5668\u4e2d\u7684\u5143\u7d20\u6216\u5b57\u7b26\u4e32)\u3002<\/p>\n size\uff1a(\u9ed8\u8ba4\u503c\u4e3anull)\u5168\u666f\u56fe\u5bb9\u5668\u7684\u6700\u7ec8\u5c3a\u5bf8\uff0c\u4f8b\u5982{width: 500, height: 300}\u3002<\/p>\n onready\uff1a(\u9ed8\u8ba4\u503c\u4e3anull)\u5168\u666f\u56fe\u51c6\u5907\u597d\u5e76\u4e14\u7b2c\u4e00\u5f20\u56fe\u7247\u5c55\u793a\u51fa\u6765\u540e\u7684\u56de\u8c03\u51fd\u6570\u3002<\/p>\n \u65b9\u6cd5\u4ecb\u7ecd<\/strong><\/span><\/div>\n addAction()\uff1a\u6dfb\u52a0\u4e8b\u4ef6(\u63d2\u4ef6\u6ca1\u6709\u63d0\u4f9b\u6267\u884c\u4e8b\u4ef6\u7684\u65b9\u6cd5\uff0c\u4f3c\u4e4e\u662f\u63d0\u4f9b\u7ed9\u63d2\u4ef6\u5185\u90e8\u4f7f\u7528\u7684)\u3002<\/p>\n fitToContainer()\uff1a\u8c03\u6574\u5168\u666f\u56fe\u5bb9\u5668\u5927\u5c0f\u4e3a\u6307\u5b9a\u5927\u5c0f\u3002<\/p>\n getPosition()\uff1a\u83b7\u53d6\u5750\u6807\u7ecf\u7eac\u5ea6\u3002<\/p>\n getPositionInDegrees()\uff1a\u83b7\u53d6\u7ecf\u7eac\u5ea6\u5ea6\u6570\u3002<\/p>\n getZoomLevel()\uff1a\u83b7\u53d6\u7f29\u653e\u7ea7\u522b\u3002<\/p>\n load()\uff1a\u52a0\u8f7d\u5168\u666f\u56fe()\u3002<\/p>\n moveTo(longitude, latitude)\uff1a\u6839\u636e\u7ecf\u7eac\u5ea6\u79fb\u52a8\u5230\u67d0\u4e00\u70b9\u3002<\/p>\n rotate(dlong, dlat)\uff1a\u6839\u636e\u7ecf\u7eac\u5ea6\u5ea6\u6570\u79fb\u52a8\u5230\u67d0\u4e00\u70b9\u3002<\/p>\n toggleAutorotate()\uff1a\u662f\u5426\u5f00\u542f\u5168\u666f\u56fe\u81ea\u52a8\u65cb\u8f6c\u3002<\/p>\n toggleDeviceOrientation()\uff1a\u662f\u5426\u5f00\u542f\u91cd\u529b\u611f\u5e94\u65b9\u5411\u63a7\u5236\u3002<\/p>\n toggleFullscreen()\uff1a\u662f\u5426\u5f00\u542f\u5168\u666f\u56fe\u5168\u5c4f\u3002<\/p>\n toggleStereo()\uff1a\u662f\u5426\u5f00\u542f\u7acb\u4f53\u6548\u679c(\u53ef\u7528\u4e8eWebVR\u54e6)\u3002<\/p>\n zoom(level)\uff1a\u8bbe\u7f6e\u7f29\u653e\u7ea7\u522b\u3002<\/p>\n zoomIn()\uff1a\u653e\u5927\u3002<\/p>\n zoomOut()\uff1a\u7f29\u5c0f\u3002<\/p>\n \n |