This time (see PicLens in Flash with Papervision3D 2.0 ) public code ( PicLens.as ), I had to revise some parts of code, align it with the latest release of Papervision3D 2.0 Great White and I made some adjustments and additions. I have included in this demo also a number of Knob, knobs, to change certain runtime parameters.
Simulation of motion PicLens
To get as close as possible to the horizontal movement of PicLens original, I used a little trickery by inserting a "not visible" DisplayObject3D target for the room:
1 2 3 | ; __fooTarget = new DisplayObject3D (); ... target = __fooTarget ; __bv. cameraAsCamera3D. __fooTarget = target; |
In practice, the camera always points to the DisplayObject3D Image gallery behind the series. When the camera moves (with an accelerated motion / inertia) also DisplayObject3D follows, but with a slight delay. This allowed me to make the effect of motion of the soft and very similar to that performed on the original PicLens:
1 2 | x + = ( ( __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 simpler and more powerful function:
1 | position + = ((posizionefinale - position) / acceleration) / inertia; |
In the demo you can change some parameters: focus, zoom and target. This is the position of the DisplayObject3D than 99 images! By changing this position, you will notice changes in the movement of the whole scene.
Focus and zoom are environment properties Papervision3D.
Interaction
Try clicking on the images ... ![]()












Projekt: Het groente en fruit lab ...
Louis Bonduelle Foundation wurde für die ein auf der Basis von kindgerechtes Informationsportal Adobe Flash produziert. Aufgabe war es, den Kindern Vorteile und die geheimen Superkräfte Früchten von und zu bringen Gemüse spielerisch Naher. Zusamme ...
Hello I tested your example of the style gallery PicLens and I must say I loved it, your levels are not yet but I am studying several days and I slam my head on how to pass a filter to a single img.
You place a piece of my code to better explain
DELI IN CYCLE WHERE YOU HAVE THE GRID WITH INSERT IMG:
and then I create the following function
2
3
4
e . displayObject3D , 'z' , Strong . easeOut , e . displayObject3D . z , - 10 , 1 , true ) ; new Tween (and. displayObject3D, 'z', Strong. easeOut, and. displayObject3D. z, - 10, 1, true);
filters = [ new GlowFilter ( 0xffffff , 0.60 , 10 , 10 , 2 , 1 ) ] ; and. sprites. filters = [new GlowFilter (0xffffff, 0.60, 10, 10, 2, 1)];
}
In this way I would like to rollover the lights ... single IMG.
just so the filter is assigned to all but if I put img
e.displayObject3Dme erroran example of looking around I found that Papervision uses
InteractiveSceneManagerto assign a filter to an event you would know ... Over advise me on how to set it in your example?as it continues to give me error?
Thank you very much
@ MairoN001: You did everything right! Just add a line when creating objects. aggiungi: In practice, when the temporary object initialized
photo1, in the loop of creation, beforeaddEventLister()add:photo1.useOwnContainer = true;In the event
fnc_ObjRlOveruse something like:e.displayObject3D.filters = [new GlowFilter (0xffffff, 0.6, 10,10,2,1)];and everything will work!
Thanks so much for the answer that works perfectly only with "useOwnContainer"
Click will disable.
I've seen around that works on r577 but not on the 578 +
The release I use is the Great White 9th of September 9, 2008.
I will see if I can find a solution to document in the meantime I would be grateful if you could you tell me more about it.
Anyway thanks again for the answer.
Ok I found a solution now works half the click but not the Double Click =)
place my temporary solution so if it should be useful to qualkun'altro safely read.
From what I've seen around in papervision to apply filters to the primitives must use viewport layers. Maybe you put the code easier to understand
THE PACKAGE:
org.papervision3d.view.layer.ViewportLayer imports;IN CLASS:
private var layer: ViewportLayer;THE FUNCTION:
initObjects2
3
4
addChild ( photo1 ) ; __BasicVw. Scenes. AddChild (photo1);
getChildLayer ( photo1 , true ) ; layer = __BasicVw. viewport. getChildLayer (photo1, true);
( InteractiveScene3DEvent . OBJECT_OVER , fnc_ObjRlOver ) photo1. addEventListener (InteractiveScene3DEvent. OBJECT_OVER, fnc_ObjRlOver)
THE FUNCTION:
fnc_ObjRlOverI hope 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 with this solution works but not the click the Double try to understand why and if I discover the place ... again and again thanks for the advice without that incentive who knows how long I lost again XD
@ MairoN001: excellent reporting! We'll see what comes out
You still have the latest version of Papervision3D? Why have officially released the 2.0, removing it from the beta branch.
Tortoise and use every day throughout riuppo
@ MairoN001: perfect! It was just what I wanted to know! I also use Tortoise SVN
and before I start developing a good "Update" 
I must say that tortoise is a software very useful and I know that for a couple of days I will torture you with questions related to the gallery =)
Continuing to analyze the gallery I could not help but notice that in the cycle start at the Img 4 .. I think it is due to inner loop qualke to Papervision3D is not it? could you tell me why?
thk u
@ MairoN001: where exactly you saw this Click Submit
forfrom 4?Function:
initObjectcycle:
for (var i = 0; i <__thnumber; i + +)the cycle moves on a regular basis but plans begin with "ID4" instead of "0"
I noticed in doing this for a trace
trace ("PLANE ID =" + __bv.scene.getChildByName (String (i)))After the photo assigned to plans
the first 4 are null trace o_0 "
Another tip for those who always wanted to work on the gallery following the example of PicLens:
at the time when you clik on a photo will enlarge the img, but if it had been previously clicked another unselected should return to its original position, so as to see more and larger only one selected, from here on I had a problem qualke so I checked and studied how to create their plane and made available to recreate the photos back and forth gioketto I had to create a listener clicks on the attachment as shown:
FUNCTION
initObject:FUNCTION:
fnc_ObjClk2
3
4
5
6
7
8
9
10
11
12
Number = 0 ; var k: Number = 0;
4 ; // HACK PER PLANE SU PV3D CHE PARTONO DA 4 allThb THUMBNAIL_NUMBER var = + 4 / / HACK FOR PLANE ON PV3D starting from 4
k= 4 ; k & lt ; allThb ; k ++ ) // IN QUESTO MODO I PRIMI 4 VUOTI LI SALTA for (k = 4, k & lt; allThb k + +) / / THIS WAY IN THE FIRST 4 EMPTY SKIP THEM
{
obj_select ! = k ) if (obj_select! = k)
{
Plane = __bv . scene . getChildByName ( String ( k ) ) as Plane ; Any var: = Plane __bv. scenes. getChildByName ( String (k)) as Plane;
Any , 'z' , Strong . easeOut , Any . z , 0 , 1 , true ) ; new Tween (Any, 'z', Strong. easeOut, Any. z, 0, 1, true);
}
}
I hope it can be helpful =)
@ MairoN001: With regard to the cycle is due to deep levels associated with Papervision, anything relevant to the end of the operation of the code
PicLens [...] in Flash with Papervision3D 2.0: Part II http://www.undolog.com/2008/06/17/piclens-in-flash-con-papervision3d-20-parte-ii/ [... ]