Page 3 of 4

Re: Panorama Flash API

Posted: Mon Feb 04, 2008 11:12 am
by Congregate
The pano is added to the stage. However, I managed to fix it by removing the loader instead of 'vr'.
removeChild(loader);

Re: Panorama Flash API

Posted: Fri Mar 14, 2008 3:03 am
by karma
HI... i need some help i realse a Flash API that contains about 32 vr. i use pano2vr 1.6.6.. i want to do one think i need to add controllers to the application... with out have to process the vr again adding the controller from pano2vr... just add some code and some buttons to my proyect

Thanks

Re: Panorama Flash API

Posted: Fri May 23, 2008 9:49 am
by vopros
Hello. How to returns the current pan scale? I need compensate modification of the loaded clip.

Re: Panorama Flash API

Posted: Sat May 24, 2008 1:45 am
by thomas
vopros wrote:Hello. How to returns the current pan scale? I need compensate modification of the loaded clip.
What do you mean with "pan scale"? The current pan angle? If so, you can query it with vr.pano.getPan().

Re: Panorama Flash API

Posted: Thu Jul 03, 2008 1:24 pm
by vopros
Would you help create simple virtual tur for AS 3.0? Thanks.

Re: Panorama Flash API

Posted: Mon Jul 14, 2008 2:48 pm
by atreiu
Hello

Is it posible to read in flash all hotspots from loaded 360 swf ?
Something like getAllOriginalHotspots(panoID) or clearAllOriginalHotspots(panoID).

I want to do as follows:
1. Create pano with hotspots in pano2qtvr
2. Then load it to main movie
3. Get (read) all positions of hotspots created in pano2qtvr
4. substitute original hotspots with my custom movieclips on given positions.

Big thanks for your answer.

Re: Panorama Flash API

Posted: Tue Jul 15, 2008 6:10 pm
by thomas
atreiu wrote: I want to do as follows:
1. Create pano with hotspots in pano2qtvr
2. Then load it to main movie
3. Get (read) all positions of hotspots created in pano2qtvr
4. substitute original hotspots with my custom movieclips on given positions.
This is currently not possible, but I added it to the wish list.

Re: Panorama Flash API

Posted: Tue Jul 15, 2008 8:04 pm
by atreiu
OK. Thanks:)

Re: Panorama Flash API

Posted: Tue Jul 15, 2008 10:42 pm
by atreiu
Is it possible to lock somehow mouseListener for loaded pano?
For example I don't want scrollbutton on mouse to scroll FOV parameter on pano as mouse cursor is not over the pano.

Re: Panorama Flash API

Posted: Tue Jul 22, 2008 2:19 am
by atreiu
Hello again

I cannot manage _visibility of movieclips which were added with addHotSpot.
I only cannot manage it when the pano is not moving (while its pressed by user).

What I do is:

1. Create movieClip
var hsMovie:MovieClip=_root.attachMovie("pa","hsMovie"+idx,_root.getNextHighestDepth());
2. assign some behaviour to them:
hsMovie.onEnterFrame = function(){
this._visible=this.hitTest(this._parent.vr_);
}
3. add movie to pano as hotspot.
(in the loop)
vr.pano.addHotspot("hs"+idx,this.childNodes[idx].attributes.wa,this.childNodes[idx].attributes.ha,hsMovie);

In the example code this problem was solved with loading "border" higher than hotspots. I just cannot use such solution. -> I thought I solve it as above. My hitTest works fine, if I trace _visible it is same as hitTest, but on the screen there is no effect. Even if I put in point 2 something like this:
hsMovie.onEnterFrame = function(){
this._visible=0);
}

the hotspots are always visible. Only if my pano is not moving then my onEnterFrame works fine.

For the moment I use _alpha parameter but maybe anybody faced this issue before?

Thanks for the answer.

Re: Panorama Flash API

Posted: Tue Jul 22, 2008 11:23 am
by thomas
atreiu wrote:I cannot manage _visibility of movieclips which were added with addHotSpot.
I only cannot manage it when the pano is not moving (while its pressed by user).
The visibility is also controlled by the panorama because otherwise it would show up again if you are looking in the opposite direction. A solution with _alpha should work.

Re: Panorama Flash API

Posted: Tue Jul 22, 2008 1:07 pm
by atreiu
Ok thanks.
I guess handling _alpha is not enough... If MovieClip has some behavior attached (onPress, onRollOver or so on) those actions will block elements beneath.
If anybody faces same problem I solved it like this:

Code: Select all


hsMovie.onEnterFrame = function(){
	if(!this.hitTest(PanoArea)){
		this._alpha =0;
                delete this.onRelease;
                delete this.onRollOver;
                delete this.onRollOut;
               
	}else{
		this._alpha=100;
                this.onRelease = someOnrelaseFunction;
                this.onRollOver= someonRollOverFunction;
                this.onRollOut = someonRollOutFunction;
	}
}

Re: Panorama Flash API

Posted: Tue Jul 22, 2008 1:31 pm
by atreiu
And... I have another question:)

Since there is no possibility to read all positions of hotspots saved with pano2QTVR I created my own aplication were I can load flat 360-image and set some points (hotspots) and save it to database. I assumed that:

1. the center of the image is 0 pan and 0 tilt
2. the width of the image is 360 pan, and the height is 180 degree.

Basis on it I just use proportion to convert pixels to degrees.

This gives me approximate data because the image that I base on is flat. Generally it is ok but in some cases there is much misplacement.

The img beneath shows the point that I spot on my hotspot editor:
Image
The img beneath shows the point that I receive in my application:
Image

Is it possible that you tell me how can I better convert pixel (_x and _y) to pan and tilt?

Thanks.

Re: Panorama Flash API

Posted: Thu Jul 24, 2008 1:05 am
by thomas
I use the following code to get the angles:

Code: Select all

public function getPositionAngles(x :int,y :int):Point {
	var d:Number;
	var dx:Number;
	var dy:Number;

	d=rect.height/(2*Math.tan(fov.cur*Math.PI/360.0));
	dx=(x-rect.width/2.0);
	dy=(y-rect.height/2.0);
	var p:Point=new Point(); 
	p.x=180.0*Math.atan(dx/d) / Math.PI;
	p.y=180.0*Math.atan(dy/Math.sqrt(dx*dx+d*d)) / Math.PI;
	return p;
}
Where p.x is pan and p.y is tilt. You need to add the current pan an tilt angles.

Re: Panorama Flash API

Posted: Fri Jul 25, 2008 11:20 am
by atreiu
:)
I understand that "rect" is a flat 360 image.
One question: how can I get fov.cur ?