Panorama Flash API

Specific Q&A about the new Flash export
Congregate
Posts: 3
Joined: Mon Aug 27, 2007 11:16 am

The pano is added to the stage. However, I managed to fix it by removing the loader instead of 'vr'.
removeChild(loader);
Crackers dont matter
karma
Posts: 3
Joined: Fri Mar 14, 2008 2:54 am

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
vopros
Posts: 7
Joined: Fri May 23, 2008 9:36 am

Hello. How to returns the current pan scale? I need compensate modification of the loaded clip.
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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().
MfG, Thomas
vopros
Posts: 7
Joined: Fri May 23, 2008 9:36 am

Would you help create simple virtual tur for AS 3.0? Thanks.
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

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.
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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.
MfG, Thomas
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

OK. Thanks:)
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

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.
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

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.
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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.
MfG, Thomas
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

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;
	}
}
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

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.
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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.
MfG, Thomas
atreiu
Posts: 9
Joined: Mon Jul 14, 2008 2:37 pm

:)
I understand that "rect" is a flat 360 image.
One question: how can I get fov.cur ?
Locked