Sie sind nicht angemeldet.

1

Freitag, 5. September 2014, 05:04

About screentosphere

Hi,

Can use "get" to replace "call" with "screentosphere" function in JS? Because "call" is not 'sync' and i need to use screentosphere in a loop function.




1, Use call function,it will be return the same results for gx and gy.

Quellcode

1
2
3
4
5
6
7
8
9
var a=100; 
var b=200; 
for (var i = 0; i < 2; i++) { 

krpano.call("spheretoscreen("+a+","+b+",gx,gy);"); 
var gx = krpano.get("gx"); 
var gy = krpano.get("gy"); 

}


2,Use get function,it will be return null for "c".

Quellcode

1
2
3
4
5
var a=100; 
var b=200; 
for(var i=0;i<2;i++){ 
var c=krpano.get("screentosphere("+a+","+b+")"); 
}



thx!

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »boxui« (5. September 2014, 05:42)


2

Montag, 8. September 2014, 18:19

Hi,

there is currently no 'sync' way to call krpano actions from JS (but there is already one in the planing).

A way to directly use the spheretoscreen/screentosphere function, would be using the krpano plugin interface - there these functions can be called directly:
http://krpano.com/docu/plugininterface/#krpanointerface

Best regards,
Klaus

3

Dienstag, 9. September 2014, 09:30

thx

another question:

How to use multiple loop in krpano plugin interface?

like in js :

Quellcode

1
2
3
4
5
6
7
for(var i=0;i<10;i++) 
{ 
for (var j=0;j<10;j++) 
{ 
//do someting 
} 
}

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

4

Dienstag, 9. September 2014, 10:06

try this ;-)


Quellcode

1
2
3
4
5
for(set(i,0),i LT 10,inc(i),
 	for(set(j,0),j LT 10,inc(j),
		  //do someting 
 	);
);


ragerds

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*