You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a source code for my view page as follows. I want to add a hotspot to the panorama by adding it to the view of a list of paronama. However, after adding and formatting the default scene as panoB, it successfully loaded the default scene. attached to hotspot but when I click on hotspot, logically it should go to panoC scene but it still reloads to panoB scene.
@{
ViewData["Title"] = "Hutech View";
}
<linkrel="stylesheet" href="https://cdn.jsdelivr.net/npm/pannellum@2.5.6/build/pannellum.css" />
<scripttype="text/javascript" src="https://cdn.jsdelivr.net/npm/pannellum@2.5.6/build/pannellum.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script><linkrel="stylesheet" type="text/css" href="~/css/Style.css" />
<style>
#panorama-container {
width: 1000px;
height: 500px;
margin-left: auto;
margin-right: auto;
}
</style><divclass="jumbotron"><br />
<h1>QUẢN LÝ HÌNH ẢNH 360</h1><pclass="lead">360DEGREE</p></div><divclass="row"><divid="panorama-container"></div><script>document.addEventListener('DOMContentLoaded',function(){constpanoramas=[{idHsp: "a",id: 'panoA',img: '/Image/winter.jpg',pitch: 0,yaw: 0,hfov: 110},{idHsp: "b",id: 'panoB',img: '/Image/river.jpg',pitch: 0,yaw: 90,hfov: 110},{idHsp: "c",id: 'panoC',img: '/Image/winter.jpg',pitch: 0,yaw: 180,hfov: 110},];consthotspots=[{idHsp: "b",from: 'panoA',to: 'panoB',text: 'Hotspot B',pitch: 50,yaw: 50},{idHsp: "c",from: 'panoB',to: 'panoC',text: 'Hotspot C',pitch: 50,yaw: 50},{idHsp: "a",from: 'panoC',to: 'panoA',text: 'Hotspot A',pitch: 50,yaw: 50},];constscenes=panoramas.map(panorama=>({id: panorama.id,type: 'equirectangular',panorama: panorama.img,pitch: panorama.pitch,yaw: panorama.yaw,hfov: panorama.hfov,autoLoad: true,hotSpots: [],}));/* let currentScene; */// Biến để lưu trữ thông tin về cảnh hiện tạiconstviewer=pannellum.viewer('panorama-container',{default: scenes.find(scene=>scene.id==='panoB'),// Sử dụng panoA làm cảnh mặc địnhscenes: scenes,});hotspots.forEach(hotspot=>{constcurrentScene=scenes.find(scene=>scene.id===hotspot.from);if(currentScene){currentScene.hotSpots.push({pitch: hotspot.pitch,yaw: hotspot.yaw,type: 'scene',text: hotspot.text,sceneId: hotspot.to,});}});viewer.on('scenechange',function(e){console.log("Scene changed event:",e);currentScene=scenes.find(scene=>scene.id===e.sceneId);// Lưu trữ thông tin về cảnh hiện tạisetTimeout(function(){console.log("Scene changed to:",currentScene ? currentScene.id : 'undefined');},100);// Trì hoãn 100 milliseconds});});</script><scriptsrc="~/js/ADD.js"></script></div>
The text was updated successfully, but these errors were encountered:
You appear to be using the default parameter incorrectly. You're setting it to the contents of the particular scene, which is incorrect. It's used to set parameters that are common to all scenes and to set the firstScene. You should be using something like:
I have a source code for my view page as follows. I want to add a hotspot to the panorama by adding it to the view of a list of paronama. However, after adding and formatting the default scene as panoB, it successfully loaded the default scene. attached to hotspot but when I click on hotspot, logically it should go to panoC scene but it still reloads to panoB scene.
The text was updated successfully, but these errors were encountered: