krpano限制場景視角
scene 標籤下的view標籤就是控制場景的視角的。
默認的配置:
<view hlookat="0.0"
vlookat="0.0"
fov="90.0"
fovmin="1.0"
fovmax="179.0"
maxpixelzoom=""
/>
hlookat就是默認的水平視角範圍-180-180,vlookat就是垂直的視角範圍-90-90。這很好理解。
fov就是默認是視角的角度。
可擴展配置:
<view hlookat="0.0"
vlookat="0.0"
camroll="0.0"
fovtype="VFOV"
fov="90.0"
fovmin="1.0"
fovmax="179.0"
maxpixelzoom=""
mfovratio="1.333333"
distortion="0.0"
distortionfovlink="0.5"
stereographic="true"
pannini="0.0"
architectural="0.0"
architecturalonlymiddle="true"
limitview="auto"
hlookatmin=""
hlookatmax=""
vlookatmin=""
vlookatmax=""
rx="0" ry="0"
tx="0" ty="0" tz="0"
ox="0" oy="0" oz="0"
/>
比如我想進入場景後,不讓他看天看地,也不能轉到後面,我們就可以加上下面的代碼。
hlookatmin 就是最大能朝左轉90°,hlookatmax就是最大能朝右轉90°。
vlookatmin,vlookatmax就是上下限制45°。同時記得設置limitview,他默認是auto。
limitview="range "
hlookatmin="-90" hlookatmax="90"
vlookatmin="-45" vlookatmax="45"
limitview的參數說明如下圖所示。