You are not logged in.

1

Thursday, September 6th 2012, 12:20am

spheretoscreen(h,v) in krpanointerface's Object

I'm developping krpano javascript plugin.
But spheretoscreen function seems not to be working.

Syntax written in document is

screentosphere(x,y)
spheretoscreen(h,v)
Functions for converting between screen and spherical coordinates.
Return value: an Object with x and y properties. The values of these properties can be NaN (Not a Number) when the conversion wasn't possible.

And here is my code.

var ath = 0;
var atv = 0;
krpano.trace(1,"ath=" + ath + ",atv=" + atv);
var coord = krpano.spheretoscreen(ath,atv);
krpano.trace(1,"tox=" + coord.x + ",toy=" + coord.y);

First trace message appears in console window.But second trace message doesn't appear, strangely.
I've got no error messages. What is happening ?

If I use krpano.call() instead of krpano.spheretoscreen like below, it works fine.

krpano.call("set(h,0); set(v,0);set(x,0); set(y,0); spheretoscreen(h,v,x,y);trace('x=', get(x));");
krpano.trace(1,"x=" + krpano.get("x"));

Is krpano.spheretoscreen() obsolete or not supported in javascript plugin interface ?

2

Sunday, September 9th 2012, 11:21am

Hi,

is your krpano version up-to-date?

the direct interface to the spheretoscreen/screentosphere functions was added in the 1.0.8.15,

best regards,
Klaus

3

Sunday, September 9th 2012, 11:05pm

With 1.0.8.15, it worked !


Thank you !