I have already written the core of the new plugin and will update Lensflare Free as well someday, but since this is just my hobby I can't guarantee any deadlines or quick fixes.
Posts by Sergey74
-
-
Hi,
here an example to extend krpano with a 'onlookchange' event that tracks only hlookat, vlookat and fov changes (could be extended with other view attributes too):
Code
Display More<action type="js" autorun="onstart"> var view = krpano.view; var attrs = ["hlookat", "vlookat", "fov"]; var prevstate = {}; attrs.forEach( function(attr){ prevstate[attr] = view[attr]; }); krpano.events.addListener("onviewchanged", function() { var haschanged = false; attrs.forEach( function(attr) { if (prevstate[attr] != view[attr]) { prevstate[attr] = view[attr]; haschanged = true; } }); if (haschanged) { krpano.events.dispatch("onlookchange"); } }); </action>
Best regards,
KlausThank you Klaus!
-
Thanks guys! The new syntax is convenient. I want to write a plugin with support for older versions of krpano (1.21 and older). So I'll have to do it the old way
-
Is there any way to track changes directly to the view (hlookat, vlookat, fov, etc.) without using hacks? I couldn't think of anything other than tracking changes to each of them (hlookat, vlookat, fov, etc.)
-
Hi Klaus!
Changing hotspot.alpha via tweens in infinite animation causes infinite onviewchanged even if the view is not changing. This is due to WebGL rendering of hotspots. Please check why the engine reacts like this.
I have some code that uses the onviewchanged event and I'm finding that onviewchanged is firing infinitely even though the view is not changing.
Below I have provided a small test that points to the problem. Also I did not find any fundamental difference between onviewchanged and onviewchange in my tests, could you give some explanations. Yes, I read the documentation well.
Code
Display More<krpano version="1.22" onstart="showlog();"> <style name="test_hotspot_style" renderer="webgl" blendmode="add" url="hotspot.png" enabled="false" /> <scene name="scene_test" title="Test Scene" onstart="blink();" autoload="true"> <preview type="grid(cube,64,64,512,0x00FF00,0x000000,0x00FF00);" /> <view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="100" /> <hotspot name="test_hotspot" style="test_hotspot_style" ath="0.0" atv="0.0" scale="1.0" alpha="1.0" bright="1.0" /> </scene> <events name="test_events" keep="true" onviewchanged="trace('onviewchanged triggered');" /> <action name="blink" scope="local"> set(random_alpha, get(random)); tween(hotspot[test_hotspot].alpha, get(random_alpha), 0.5, linear, blink();); <!-- alpha or scale or ... --> </action> </krpano>
-
I don't know if it's a bug or a feature. It happened by chance, if you pass a value (rx, ry, rz) to a hotspot that is not a number, then it behaves like a layer. Example
Code<krpano> <preview type="grid(cube,64,64,512,0xCCCCCC,0x444444,0x999999);" /> <view fov="100"/> <hotspot name="test" type="container" distorted="true" enabled="true" edge="leftbottom" width="500" height="500" bg="true" bgcolor="0x000000" bgalpha="0.5" bgborder="1 0x00FF00" bgbordermode="inside" bgborderblend="true" bgcapture="true" onclick="set(rx, NaN);"/> </krpano>
-
Very cool Klaus!
P.S. Where are the monsters?
-
Hey! Not yet. Perhaps someday, but I just don't have time for this.
-
-
Do you want to make the hotspot width equal to the stagewidth? Just set the width to 100%
-
It didn't work out to do it smoothly, but I think you will understand what I mean
-
Very good! I discovered an undocumented feature - Dolly Zoom. I wonder if this can be programmed?
-
Alternatively, place a textfield in a container
-
-
-
Hi Klaus!
Will it be possible to add control for mobile devices (for zoom in /
out): double touch + swipe up / down in a future version?For example, as in this video https://youtu.be/ZLRGWudSpH0
-
It's not entirely clear what you mean
QuoteHow to change view under hotspot
but study it, it might help. https://krpano.com/docu/actions/#loadscene
-
It's very easy! Open your tour.xml
Code
Display More<skin_settings maps="false" ... design_bgcolor="0x2D3E50" design_bgalpha="0.8" design_bgborder="0" design_bgroundedge="1" design_bgshadow="0 4 10 0x000000 0.3" design_thumbborder_bgborder="3 0xFFFFFF 1.0" design_thumbborder_padding="2" design_thumbborder_bgroundedge="0" design_text_css="color:#FFFFFF; font-family:Arial;" design_text_shadow="1" />
-
-