PicLens in Flash with Papervision3D 2.0: Part II
Tuesday, June 17, 2008This time (see Piclens to Flash with Papervision3D 2.0) public code (PicLens.as), I had to revise some parts of code, thus aligning the latest releases of Papervision3D 2.0 Great White and I made some adjustments and additions. I entered in this demo also a number of Knob, knobs, runtime to change some parameters.
Simulation of motion PicLens
To close as possible to the horizontal movement of PicLens original, I used a small way by including an "invisible" DisplayObject3D target for the room:
- ; __fooTarget = new DisplayObject3D ();
- ...
- = __fooTarget; __bv. cameraAsCamera3D. __fooTarget = target;
In practice room always tip the DisplayObject3D place behind the series of immmagini. When the camera moves (with a movement accelerated / inertial) also DisplayObject3D the following, but with a slight delay. This allowed me to make the effect of motion smooth and quite similar to that achieved on PicLens original:
- += ( ( __slider. Value - __bv. cameraAsCamera3D . x ) / 10 ) / 2 . 2 ; __bv. cameraAsCamera3D. x + = ((__slider. Value - __bv. cameraAsCamera3D. x) / 10) / 2. 2;
- __slider. Value - __fooTarget. x ) / 5 ) / 2 . 2 ; __fooTarget. x + = ((__slider. Value - __fooTarget. x) / 5) / 2. 2;
I have not used any Tween, but a more simple and efficient function:
- /accelerazione ) /inerzia; Position + = ((posizionefinale - position) / acceleration) / inertia;
In the demo you can change some parameters: focus, zoom and targets. This is the position of DisplayObject3D compared to 99 pictures! By changing this position you will notice changes in movement of the scene.
Focus and Zoom are property of Papervision3D.
Interaction
Just click on the pictures ... ![]()























Oliver Semrau said:
Projekt: Het groente en fruit lab ...
Für die Fondation Louis Bonduelle kindgerechtes Informationsportal wurde ein auf der Basis von Adobe Flash produziert. Aufgabe war es, den Kindern und die Vorteile von geheimen Superkräfte Früchten spielerisch näher Gemüse und zu bringen. Zusamme ...
MairoN001 said:
Hello, I analyzed the example of your style gallery piclens and I must say that I liked very much, not even to your level but I am studying several days and I banged my head on how to pass a filter to a single img.
You place a piece of my code to better explain
INSIDE STAGE DELI WHERE HAVE THE GRID WITH IMG POST:
photo1.addEventListener (InteractiveScene3DEvent.OBJECT_OVER, fnc_ObjRlOver)and then I created the following function
In this way I would like to rollOver the individual IMG lights ....
just so that the filter is assigned to all img but if I put
e.displayObject3Dme by mistakeLooking around at an example I found that Papervision uses
InteractiveSceneManagerto assign a filter for an event rid of mice ... Over on how to set it in your example?as I continue to give mistake?
Thank you very much
Giovambattista Fazioli said:
@ MairoN001: You did so good! You just add a line when you create objects. In practice, when the object initializes temporary
photo1in the loop of creation, beforeaddEventLister()add:photo1.useOwnContainer = true;In the
fnc_ObjRlOveruse instead:e.displayObject3D.filters = [new GlowFilter (0xffffff, 0.6, 10,10,2,1)];and everything will work!
MairoN001 said:
Thank you very much for your answer is fine except that entering "useOwnContainer"
Click the disability is.
I saw working around the r577 but not the 578 +
The release that I use is the Great White of 09 September 9th, 2008.
clear from documents where I find a solution in the meantime you will be grateful if sapresti tell me something more about it.
Anyway, thanks again for your reply.
MairoN001 said:
Ok I have found half a solution now does not click but the Double Click =)
place my temporary solution so should it be useful to qualkun'altro can easily read.
From what I saw around on papervision to apply filters to the primitive must use the viewport layers. Place the Code is perhaps easier to understand
THE PACKAGE:
org.papervision3d.view.layer.ViewportLayer import;IN CLASS:
var private layer: ViewportLayer;THE FUNCTION:
initObjectsTHE FUNCTION:
fnc_ObjRlOvere.displayObject3D.container.filters = [new GlowFilter (0xffffff, 0.60, 10,10,2,1)];I hope that this code can be useful to other perk the place I lost 3 days to find out how to put a filter on a plane in PVS3D this solution works with the click but not the Double try to understand why and if I discover the place ... To time thanks to the council without the incentive who knows how long I would have lost yet XD
Giovambattista Fazioli said:
@ MairoN001: excellent reporting! We will see what comes out
You still have installed the latest version of Papervision3D? Why have officially released the 2.0, remove from the beta branch.
MairoN001 said:
Tortoise and use every day all riuppo
Giovambattista Fazioli said:
@ MairoN001: perfect! It was exactly what I wanted to know! I also use Tortoise SVN
and before I start to develop a good "Update" 
MairoN001 said:
I must say that Tortoise is a really useful software and I know that for a couple of days you torturero with questions relating to the gallery =)
By continuing to analyze the gallery I could not help but note that in departing Img the cycle 4 .. I think it is due to qualke cycle internal Papervision3D or wrong? sapresti tell me why?
THK u
Giovambattista Fazioli said:
@ MairoN001: Where exactly did you see this cliclo
for4?MairoN001 said:
Function:
initObjectcycle:
for (var i = 0; i <__thnumber; i + +)the cycle proceeds on a regular basis but plans begin with "ID4" rather than "0"
I am running a trace into this for
trace ( "PLANE ID =" + __bv.scene.getChildByName (String (i)))After the photo assigned to plans
the first 4 tracks are null o_0 "
MairoN001 said:
Other advice for those who want to work on the gallery follow the example of piclens:
when you Click on a img you enlarge the photo, but if it had been previously clicked another those not selected should return to its original, so as to always see only the selected larger, from then on I had qualke problem I checked for that and studied how to create the plane and made available in order to recreate the gioketto forward and backward pictures, I had to create a click on the listener as an example:
FUNCTION
initObjecte.displayObject3D.addEventListener (InteractiveScene3DEvent.OBJECT_CLICK, fnc_ObjClk)FUNCTION:
fnc_ObjClkI hope that can be useful =)
Giovambattista Fazioli said:
@ MairoN001: for the cycle is due to deep levels associated with Papervision, nothing relevant to the end of the operation code