You are not logged in.

VN2009

Professional

  • "VN2009" started this thread

Posts: 1,336

Location: Duluth MN

  • Send private message

1

Thursday, May 20th 2010, 9:30pm

can krpano do this?

http://www.erikleeman.com/HTM/english-sh…ma_viewer=FLASH

he made 2 panos sit on top of each other and created a parallelax effect looking through the windows. is there any way to simulate this with krpano?

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

2

Saturday, May 22nd 2010, 6:33am

random thoughts off the top of my head...

each window is made of two hotspots... the background / outside image + a mask. The mask is locked to a location matching up to the window frame (easier to do if you have a cube face pano)... and the background is moved left / right dependent upon what the current lookat is.

Sorry that I can't write you up some code to do it... but it seems possible... just has to be broken down to it's simpler parts.

3

Tuesday, May 25th 2010, 2:19pm

Hi,

it's not directly possible, because there can't be two pano layers,
but with distorted hotspots it's nearly possible,

here a quick and simple example:
http://krpano.com/examples/parallaxtest/

and here the code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<krpano>

    <style name="cubeface" width="1000" height="1000" distorted="true" enabled="false" />

    <hotspot name="back_l" style="cubeface" url="garten_l.jpg" ath="-90"  atv="0"   zorder="1" />
    <hotspot name="back_f" style="cubeface" url="garten_f.jpg" ath="0"    atv="0"   zorder="1" />
    <hotspot name="back_r" style="cubeface" url="garten_r.jpg" ath="+90"  atv="0"   zorder="1" />
    <hotspot name="back_b" style="cubeface" url="garten_b.jpg" ath="+180" atv="0"   zorder="1" />

    <hotspot name="pano_l" style="cubeface" url="pano_l.swf" ath="-90"  atv="0"   zorder="2" />
    <hotspot name="pano_f" style="cubeface" url="pano_f.swf" ath="0"    atv="0"   zorder="2" />
    <hotspot name="pano_r" style="cubeface" url="pano_r.swf" ath="+90"  atv="0"   zorder="2" />
    <hotspot name="pano_b" style="cubeface" url="pano_b.swf" ath="+180" atv="0"   zorder="2" />
    <hotspot name="pano_u" style="cubeface" url="pano_u.jpg" ath="0"    atv="-90" zorder="2" />
    <hotspot name="pano_d" style="cubeface" url="pano_d.jpg" ath="0"    atv="+90" zorder="2" />

    <events onviewchange="updateback();" />

    <action name="updateback">
        sub(diffhlookat, view.hlookat, lastviewhlookat);
        copy(lastviewhlookat, view.hlookat);
        add(hotspot[back_l].ath, diffhlookat, -90);
        add(hotspot[back_f].ath, diffhlookat, 0);
        add(hotspot[back_r].ath, diffhlookat, +90);
        add(hotspot[back_b].ath, diffhlookat, +180);
    </action>

</krpano>


the 'background' pano is included as hotspots and the foreground pano too,
but the foreground pano images are images with an alpha channel,

originally they were .png images, because .jpeg don't have an alpha channel,
but .png doesn't compress well, so they were converted to a .swf by this png2swf tool,
here internally Flash uses JPEG compression for image and the alpha channel which makes it the file a lot smaller,

for the parallax effect a very simple 'delay' was used - the difference of the last horizontal move was added to the background hotspot positions,
doing the same also for the vertical position is not possible because the rotation base is different,

best regards,
Klaus

VN2009

Professional

  • "VN2009" started this thread

Posts: 1,336

Location: Duluth MN

  • Send private message

4

Tuesday, May 25th 2010, 10:45pm

very nice! with some more creative coding would it have been possible to make the rear view mirror react in the opposite effect as the windshield? sometimes i sit and wonder if there is anything krpano can't do.

*** i wonder i i dropped my W2 form on a droplet if it would do my taxes for me also? ***

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

5

Thursday, May 27th 2010, 7:40am

with some more creative coding would it have been possible to make the rear view mirror react in the opposite effect as the windshield?
should be possible.. the basic thought would be... if pano moves +x then offset mirror -x


sometimes i sit and wonder if there is anything krpano can't do
I often have the same thought... and honestly... the full possibilities of krpano haven't been touched yet (in my opinion)


i wonder i i dropped my W2 form on a droplet if it would do my taxes for me also?
You didn't see that droplet in the last release? ;-)
It worked great. *whistling*