You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

mindlessboss

Professional

  • "mindlessboss" started this thread

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

1

Monday, June 14th 2010, 12:20pm

area sizes and position

could be better if area have right bottom corner positon, then width and height set to auto. its like div margin *rolleyes*
this situation is more common
for example
area.left
area.top
area.right
area.bottom
area.width=auto - default
area.height=auto - default
if area.width or height is custom then right and bottom = auto (i have no idea about align)
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

2

Tuesday, June 15th 2010, 11:26am

Hi,

thanks, good idea!

I think in this case a new area "mode" would be good,
e.g.
area.mode="border"
area.left="..."
area.top="..."
area.right="..."
area.bottom="..."

and let width/height alway be automatic in this mode,
I will add that to the next release

best regards,
Klaus

mindlessboss

Professional

  • "mindlessboss" started this thread

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

3

Tuesday, June 15th 2010, 4:54pm

That's great!

Thanks! *thumbsup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Tuur

Sage

Posts: 3,284

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Thursday, June 17th 2010, 2:31pm

HE Klaus,

that's what i mean with the area margins..

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

5

Thursday, June 17th 2010, 11:14pm

this would be possible with an action.

Source code

1
2
3
4
5
6
7
8
9
10
<events onresize="setMargin(10,10,10,10);" />
	<!-- setMargin(leftmargin,topmargin,bottommargin,rightmargin); -->
	<action name="setMargin">		
		<-- calculate remaining width. stagewidth - marginleft - marginright = area width -->
		sub(tmp1, stagewidth, %1); sub(tmp2, tmp1, %4); set(area.width, tmp2);
		<!-- calculate remaining height. stageheight - margintop - marginbottom = area height -->
		sub(tmp3, stageheight, %2); sub(tmp4, tmp3, %3); set(area.height, tmp4);
		<!--move the area-->
		set(area.x, %1); set(area.y, %2);
	</action>


the other away around would be possible to. Defining a fixed area size and the posistion it in the center no mather what resolution.

Source code

1
2
3
4
5
6
7
8
9
10
<events onresize="define_area_size(1008,571);" />

	<action name="define_area_size">
		div(halfstagewidth, stagewidth, 2); div(halfareawidth, %1, 2); sub(dest_area_x, halfstagewidth, halfareawidth);
		copy(area.x, dest_area_x);
		div(halfstageheight, stageheight, 2); div(halfareaheight, %2, 2); sub(dest_area_y, halfstageheight, halfareaheight);
		copy(area.y, dest_area_y);
		set(area.width, %1);
		set(area.height, %2);
	</action>


sorry if there's some faults in the code. it's late ;p

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

6

Friday, June 18th 2010, 12:28am

Hi Zephir *thumbup* ,

Quoted

sorry if there's some faults in the code. it's late ;p
You are right... it is late *smile* ;-) ...
set(area.width, tmp2); returns temp2
set(area.height, tmp4); returns temp4
Should be:
set(area.width, get(temp2));
or copy(area.width, tmp2);

Here the first code corrected:

Source code

1
2
3
4
5
6
7
8
9
10
	<events onresize="setMargin(10,10,10,10);" />
	<!-- setMargin(leftmargin,topmargin,bottommargin,rightmargin); -->	
	<action name="setMargin">	
		<!-- calculate remaining width. stagewidth - marginleft - marginright = area width -->
		sub(tmp1, stagewidth, %1); sub(tmp2, tmp1, %4); copy(area.width, tmp2);
		<!-- calculate remaining height. stageheight - margintop - marginbottom = area height -->
		sub(tmp3, stageheight, %2); sub(tmp4, tmp3, %3); copy(area.height, tmp4);
		<!--move the area-->
		set(area.x, %1); set(area.y, %2);
	</action>


Anyway, that's great... thanks to share *thumbup* ...

SAlut.

Tuur

Sage

Posts: 3,284

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

7

Friday, June 18th 2010, 1:05am

MASTERS!!!

Tuur
*thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Yomas

Intermediate

Posts: 190

Location: Anglet, France

  • Send private message

8

Thursday, October 6th 2011, 9:58pm

Up please ^^

Hi all ^^
That's great !!
Would it be possible to add a fixed aspect ratio to this code part ? :

Source code

1
2
3
4
5
6
7
8
9
10
<events onresize="setMargin(10,10,10,10);" />
	<!-- setMargin(leftmargin,topmargin,bottommargin,rightmargin); -->	
	<action name="setMargin">	
		<!-- calculate remaining width. stagewidth - marginleft - marginright = area width -->
		sub(tmp1, stagewidth, %1); sub(tmp2, tmp1, %4); copy(area.width, tmp2);
		<!-- calculate remaining height. stageheight - margintop - marginbottom = area height -->
		sub(tmp3, stageheight, %2); sub(tmp4, tmp3, %3); copy(area.height, tmp4);
		<!--move the area-->
		set(area.x, %1); set(area.y, %2);
	</action>

Thanks in advance ^^
Best regards.
My website: www.eboovisite.com, See me also on www.Viewat.com, Facebook and Twitter

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

9

Thursday, October 6th 2011, 11:24pm

It could be done, but you wouldnt have a fixed margin then. You would have maybe 100px black left and right, or 70px top and bottom, depending which resolution it would fit best.

let me think about it, my head is bit cloudy atm :P