pokemon yiff art wedding invitations wording samples in spanish online melbourne chat sample student resume cigarette brands nicotine content t shirt printing machine for sale google earth free download sawgrass mills mall directory map evil desktop themes mercedes benz parts diagrams download dragonball game pontiac g8 gxp for sale used subwoofer wiring diagram crutchfield download balkan download gamecube emulator mac salary calculator pocket tanks deluxe download mac check engine mitsubishi eclipse of land pollution 3d kitchen design software flashget download mercury outboard serial identification free ball licking movies happy jesus song download the fuji viewer wine enthusiast coupon codes salary of professional athletes free pron movies radio flyer scooter target minivan rental orlando florida drug ultram mozzila slo download harley davidson sportster parts accessories nikon coolpix l100 10mp digital camera review nikon d3000 dslr camera price vintage cigarette cases for women scheduling software paige jeans funny quotes from movies hangover levitra clinical trials online pharmacy phentermine xenical hair cuttery coupons printable downloadable dbz computer games mitsubishi lancer evolution x body kits digital camera reviews canon powershot sx120 cheap usb flash drives bulk rpg maker xp download free full costumes for cats musical guitar pro 5 free download torrent furniture warehouse san diego kearny mesa autodesk revit architecture 2010 crack rapidshare antares auto tune mac crack winter olympics locations history glass pipes and bongs for sale honeymoon packages in india with prices free website builder for mac os x free animated powerpoint backgrounds subwoofer reviews home audio pizza hut menu and price list rolex watches for men uk yamaha atv parts diagrams free models download kia sorento 2011 reviews weather channel radar florida mitsubishi electric mr slim air conditioning atheros ar5005g wireless network adapter driver xp camera reviews nikon coolpix s203 used toyota tacoma prerunner double cab for sale family cruises deals 2010 honda generators for sale used laminate kitchen countertops belkin n1 wireless router setup guide egyptian symbols alphabet malayalam movies 2009 watch online autodesk sketchbook pro 2010 mac torrent dell printer drivers for mac os x big trucks parking games fruity loops download golf magazine top 100 courses you can play nintendo dsi xl reviews bmw x5 repair manual haircuts fine hair free 2d animation software for beginners 1999 chrysler sebring convertible problems hyundai sonata 2011 pictures shu uemura art of hair autodesk inventor 2010 student download movies on demand brighthouse list snow white and the seven dwarfs story online 2010 subaru forester xt limited review tattoos designs for men free dvd release schedule 2010 wireless g usb network adapter driver download mitsubishi tv remote codes free nintendo 64 emulators for mac funny pictures of people with no teeth bluetooth dongle software download vista gps reviews consumer reports hyundai sonata 2011 prices samsung lcd tv problems no picture plants vs zombies free download full version mac samsung omnia apps free download honda crv maintenance schedule 2004 microsoft flight simulator x demo crack honda civic type r for sale in us race v3 download playstation network card numbers for free flowers by zoe website wine country gift baskets coupon code free shipping xbox live gold subscription trial generator atheros ar5007eg wireless network adapter vista driver rpg maker xp keygen download cool desktop backgrounds for macbook football for dummies positions roses department store employment camcorders for sale uk flashget for mac free download honda civic 2010 pictures uae download sim city full toyota gas pedal recall list free flight simulator games online mattress factory direct post wedding reception invitation wording examples jeep cherokee accessories rpg maker vx resources battlers sony vegas 9 torrent mininova dvd decrypter download mac jewelry exchange reviews tustin nissan leaf release date honda crv parts used genuine subaru parts online harley davidson dealers in california hp compaq presario v5000 memory laminate wood flooring stairs active desktop calendar download free nintendo ds roms download professor layton playstation network card numbers rolex oyster perpetual datejust prices spanish music lyrics for free cable modem hack comcast original xbox live codes for free windowblinds serial red pubic hair japanese dating sim games ds free download full poker nikon d90 prices dubai sof2 wallhack download snowflake patterns to cut out for kids doctor serial number compaq laptops drivers cq40 kode gta san download bmw x6 reviews pinewood derby templates 2003 bmw m3 convertible hardtop star wars download jeep grand cherokee srt8 for sale in texas vadivel comedy download mud tires for sale cheap download pokemon game on pc mitsubishi lancer evolution x wallpaper female shaving pubic hair volkswagen cc reviews 2010 genuine microsoft software download windows click 1979 volkswagen beetle convertible for sale soccer practice drills honda generators prices in pakistan autodesk maya 2010 serial number and product key isuzu trooper diesel craigslist windows digital desktop background siding brake video down jackets for tall women xnxx flash jeep grand cherokee laredo 2000 manual rolex submariner used fonts calibri download replica handbags flight simulator 2004 demo free download w200i games free download download indian video songs conexant modem drivers for xp sony vegas 9 keygen serial flash player for mac snow leopard kaspersky internet key generator cowgirl boots for women cheap samsung eternity applications free download autodesk autocad 2010 torrent download winter olympics 2010 hockey bonzi download compaq presario v6000 wireless driver download winter olympics 2010 hockey teams download antares autotune 5 free download igra nfs subaru impreza outback sport forum cigarette prices by state map xbox live gold membership card 12 months buttmans art gallery youtube to mp3 converter for mac os x free download avid liquid linux mint 8 usb bootable dvd43 64 bit windows 7 virtual dj software download free full version warcraft 2 cheat codes small tattoos for girls on feet plants vs zombies free full version download link samsung i8000 omnia 2 reviews cricket flash games free download for pc evening dresses to buy online hindi movies released in 2009 list mobile phone free nintendo ds emulator download for pc camping checklist excel xbox live gold code generator download belkin wireless g usb network adapter driver download atheros ar928x wireless network adapter driver windows 7 hair gallery free flash hair photos hentai sim game tonya harding honeymoon video beowulf the movie monster trucks games for kids online download winzip incest chat rooms free rated movie clips honda accord body kit racer v3 download music player download for nokia 3110c enclosure subwoofer box dangerous dave download hot cartoon games lolita art handbags outlet online nudist art watch hindi movies free online without downloading msn account cracker download program football manager training schedules 2010 pictures of pubic hair styles download titans free oompa loompa costumes restaurant organizational chart met art underwear models photos play for free slot machine design your own wedding dress virtual antivirus bit torrent guild keygen inflation game adobe flash player for iphone safari dresses to wear to a wedding as a guest halo download mugen download microsoft office phone activation code keygen als scan download combofix mazda 626 manual book women their pubic hair black movies gamecube isos direct download marketing sample download free counter strike cd key nikon d40 kit refurbished at work brazzer hairstyles for women over 50 years old pictures free software downloads for blackberry curve 8520 printable viagra coupon lavetria plus size bra sony handycam dcr 30 driver vista tifa flash antivirus free download key gen sony vegas 9 serial number generator free download tamil mp3 songs download entrance theme adobe cs2 serial number activation code kaspersky keyboard symbol art download microsoft frontpage skype emoticons art happy birthday ubuntu smb password small bathroom remodeling ideas pictures free guitar pro download full version suzuki kizashi forum pizza hut delivery number malaysia dvdfab platinum 6 keygen dating rpg games online compaq evo drivers downloads dvdfab 6 registration key torrent malayalam movies free online watch famous graffiti artists list nokia 3110c music player download free slow down flash games freeware gamecube roms zelda the wind waker snow patrol chasing cars mp3 4shared opel astra parts catalog volkswagen beetle convertible for sale used guitar pro tabs free download summer fashion internships for high school students in nyc honda fit 2009 owners manual pdf opel astra wagon 2010 flash games index swf iskysoft dvd ripper for mac serial number autodesk maya 2010 crack nudity games compaq presario v2000 drivers skype download for blackberry curve 8900 compaq presario v6000 drivers for xp download porsche cayenne reliability 2004 warcraft 3 frozen throne torrent download free buy vans shoes online cheap desi movies watch online free kawasaki mule 3010 service manual dating sim rpg games for girls boeing 747 flight simulator games online windows server 2008 activation crack download toyota recall list of cars samsung cdma mobile phones microsoft points and xbox live gold membership generator sony vegas 9 keygen digital insanity tattoo ideas for men leg summer 2010 internships nintendo gamecube roms free download warcraft 3 download full game torrent best juice fasting recipes delta airlines flight attendant jobs rolex datejust oyster perpetual price wedding dresses for sale second hand flight simulator 2004 free download full version free skype video recorder for mac samsung led tv 6000 best settings sister wedding invitation wordings india miniclip flash games free download for pc kia sportage 2010 review hindu wedding card invitation wordings jacket sewing patterns free funny wedding invitation wording examples nokia 6300 music player download free best snow leopard hackintosh netbook porsche cayenne hybrid release date winterbells no sound dvd shrink for vista 64 bit download guitar pro 5 free download with crack 48 hour xbox live codes generator winterbells full screen game dvd shrink free download windows 7 volkswagen beetle for sale by owner watch movies online streaming megavideo sony vegas movie studio 9 platinum keygen warcraft 3 torrent limewire extended pro free download car battery trickle charger reviews gamecube emulator for psp satellite tv for pc 2009 titanium edition crack ar rehman video download compaq presario f700 drivers download nismo nissan skyline r34 gtr z tune for sale transparent desktop calendar freeware rpg maker vx activation code motorcycle superstore coupon 20 off chrysler town and country commercial music dvdfab 6 crack code dvd43 windows 7 compatible equipment rental agreement template free flight simulator x deluxe edition download volkswagen parts catalog online desktop themes for mac os x leopard xbox 360 hard drive transfer disc iso compaq presario c700 drivers malayalam movies free online watching snowboard boots reviews 2010 compaq presario drivers c500 samsung led tv 6000 problems xbox live gold membership codes free marlboro cigarette prices in north carolina isuzu trooper engine rebuild dvdfab 6 registration key free software testing tutorial pdf burton snowboard boots clearance famous quotes about life lessons bluetooth hack software nokia samsung omnia apps torrent samsung moment battery life issues sony ericsson k550i mazda miata parts diagram morgan movies compaq presario sound drivers free download soccer poems download vga for windows xp live satellite view of my house free t shirt gallery facebook bypass proxy server download full version gta3 birthday cake templates satellite view of my house real time nokia maps code hack ford motor company recalls 2009 cigarette lighting misa photoshoot download samsung impression apps free igre za mobitel download battery charger circuit schematic coolest desktop theme account cracker free download offline rpgs for pc sagem unlock codes mazda 626 timing belt monitor repair manual aurora snow flash flash revolution resonance take off my bra desktop destroyer 2 game moto racer download download dat mcafee update wow armory ensidia skinhead tattoo galleries free online templates for business cards free fretwork scroll saw patterns nature art gallery clips pants off dance off unedited sunny download free applications for mobile phones compaq evo drivers d51c games in eboot zip files tattoo magazines caribbean cruise line bahamas celebration scam youtube headshave golf gps comparison reviews download habbo hack mercedes 300sl gullwing sofa beds for sale ikea repossessed cars for jeeps for sale in pa pictures of highlighted hair download klm caribbean cruise line free cruise voucher lingerie models nude clothes steamer comparison norton antivirus code mms jamshedpur schools warcraft armory blackberry download pokemon ruby version wedding invitations wording samples microsoft security center antivirus override free antivirus for p3300 rpg maker vx sprite generator micro download keyboard symbols pictures sign in sheet templates free program templates download inspirat free wet t shirt wedding invitation wording templates soccer bulge current job vacancies in nigeria cashman slot donkey pc full download replica toy guns for sale i a japanese game show house of brides free powerpoint templates business free game download guitar chord chart for beginners antivirus plus v10 license key marathi download how to yourself a blow job free download form defend your castle flash game autoplay removal tool john mccain official website download san andreas where i download simtractor free free pantyhose movies samsung unlock codes fuse box diagram dodge dakota hidden games completly free avast antivirus free software sissy husband dress armpit hair galleries programi download glasbe free honda atv manuals online vista 64bit sony drivers bust move free download the perfume movie download spam list sign up software architecture design document sample contract template xbox 360 60gb hard drive transfer cable live satellite images of my house free buy rohypnol online ancient egypt food recipes for kids sony outlet short funny jokes one liners email marketing software freeware adobe raider download new marathi movies watch online student examples of letter writing flight simulator x acceleration expansion pack rapidshare cheap replica chanel designer handbags stronghold download compaq presario c700 drivers for vista free download certificate templates autodesk revit mep 2010 training compaq presario v6000 drivers download sample birth certificate nintendo ds emulator download for pc free sissy dress battery warehouse direct reviews compaq presario c700 hard drive replacement kalonline download t shirt printing machines for sale uk mazda protege free repair manuals dvdfab 6 registration key generator torrent nintendo ds roms torrent download wedding dance by amador daguio sony cybershot dsc s930 digital camera price in india free agenda templates summary of trojan war


10. Advanced Interactivity

**UPDATE
This tutorial has been updated:
Updates:
1) Removed InteractiveScene3DEvent and replaced it with standard MouseEvents
2) Updated to use papervision's BasicView.as class

view-update

Today we're going to learn how to handle more advanced interactivity. We'll be making something like this:

Click on a face of the cube to zoom into it. Click it again to make the cube spin again.

So, in this tutorial I'm going to show you exactly how to work out which material has been clicked on the cube and act accordingly.

If you haven't read it already, I strongly suggest that you read the Basic Interactivity tutorial first or you'll probably miss something.

Ok, so on to the code.

Firstly we'll want six materials to apply to each face of the cube. Here are mine, although you can create whatever materials you like:

Actionscript:
  1. private var frontMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/front.jpg");
  2.         private var backMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/back.jpg");
  3.         private var leftMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/left.jpg");
  4.         private var rightMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/right.jpg");
  5.         private var topMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/top.jpg");
  6.         private var bottomMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/bottom.jpg");

So, in this code I'm just loading six images from my server to use as each face.

Also, add the following declaration beneath the texture declarations to hold our Cube object:

Actionscript:
  1. private var cube:Cube;

Now we need to set up the 3d initiation code. In this code we will firstly set all of our materials as interactive, and then give each of our materials a name. This is VERY important to be able to easily find out which material has been clicked. If we didn't give each material a name then we wouldn't be able to easily work out which face has been clicked.

So, add the following code to your init3d() function:

Actionscript:
  1. override protected function init3d():void {
  2.             // We need to be able to identify each side. We'll do this
  3.             // by asssigning names to each material. During this process
  4.             // we'll also make the materials interactive.
  5.             frontMaterial.interactive = true;
  6.             frontMaterial.name = "front";
  7.             backMaterial.interactive = true;
  8.             backMaterial.name = "back";
  9.             leftMaterial.interactive = true;
  10.             leftMaterial.name = "left";
  11.             rightMaterial.interactive = true;
  12.             rightMaterial.name = "right";
  13.             topMaterial.interactive = true;
  14.             topMaterial.name = "top";
  15.             bottomMaterial.interactive = true;
  16.             bottomMaterial.name = "bottom";
  17.             // ---------------------------------------------
  18.            
  19.             cube = new Cube(new MaterialsList( {
  20.                 front: frontMaterial,
  21.                 back: backMaterial,
  22.                 left: leftMaterial,
  23.                 right: rightMaterial,
  24.                 top: topMaterial,
  25.                 bottom: bottomMaterial
  26.                 } ), 500, 500, 500, 3, 3, 3);
  27.             cube.addEventListener( InteractiveScene3DEvent.OBJECT_PRESS, onPress);
  28.             default_scene.addChild(cube);
  29.         }

So, In this code, we've set each material as interactive, given each one a sensible name, and initialised our cube with the materials assigned to the correct faces.

We then add an event listener to trigger the "onPress" event when the cube is clicked, then finally we add the cube to the scene.

We've now got a cube with six materials on it listening for a click event.

Now, the code which will let us work out which face has been clicked:

Actionscript:
  1. private function onPress( e:InteractiveScene3DEvent ):void {
  2.     switch(e.face3d.material.name) {
  3.         case "front":
  4.             // This code will be run when the front face is clicked
  5.         break;
  6.         case "back":
  7.             // This code will be run when the back face is clicked
  8.         break;
  9.         case "left":
  10.             // This code will be run when the left face is clicked
  11.         break;
  12.         case "right":
  13.             // This code will be run when the right face is clicked
  14.         break;
  15.         case "top":
  16.             // This code will be run when the top face is clicked
  17.         break;
  18.         case "bottom":
  19.             // This code will be run when the bottom face is clicked
  20.         break;
  21.     }
  22. }

Pretty self explanitary. The "e" variable in this code holds lots of data about the click event, including which material has been clicked, so, because we know which material is on each face, we can tell by the materials name which face has been clicked!

With a little bit of code, you can make a nice spinning cube gallery like the example above:

Here is my final code, have fun!

Actionscript:
  1. package  {
  2.    
  3.     import flash.display.DisplayObject;
  4.     import org.papervision3d.materials.BitmapFileMaterial;
  5.     import org.papervision3d.materials.utils.MaterialsList;
  6.     import org.papervision3d.events.InteractiveScene3DEvent;
  7.     import org.papervision3d.objects.primitives.Cube;
  8.    
  9.     public class Main extends PaperBase {
  10.        
  11.         private var frontMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/front.jpg");
  12.         private var backMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/back.jpg");
  13.         private var leftMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/left.jpg");
  14.         private var rightMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/right.jpg");
  15.         private var topMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/top.jpg");
  16.         private var bottomMaterial:BitmapFileMaterial = new BitmapFileMaterial("http://papervision2.com/wp-content/pvTex/bottom.jpg");
  17.        
  18.         private var targetrotationX:Number = 0;
  19.         private var targetrotationY:Number = 0;
  20.         private var targetrotationZ:Number = 0;
  21.        
  22.         private var tweening:Boolean = false;
  23.        
  24.         private var cube:Cube;
  25.        
  26.         public function Main() {
  27.             init(400, 400);
  28.         }
  29.        
  30.         override protected function init3d():void {
  31.             // We need to be able to identify each side. We'll do this
  32.             // by asssigning names to each material. During this process
  33.             // we'll also make the materials interactive.
  34.             frontMaterial.interactive = true;
  35.             frontMaterial.name = "front";
  36.             backMaterial.interactive = true;
  37.             backMaterial.name = "back";
  38.             leftMaterial.interactive = true;
  39.             leftMaterial.name = "left";
  40.             rightMaterial.interactive = true;
  41.             rightMaterial.name = "right";
  42.             topMaterial.interactive = true;
  43.             topMaterial.name = "top";
  44.             bottomMaterial.interactive = true;
  45.             bottomMaterial.name = "bottom";
  46.             // ---------------------------------------------
  47.            
  48.             cube = new Cube(new MaterialsList( {
  49.                 front: frontMaterial,
  50.                 back: backMaterial,
  51.                 left: leftMaterial,
  52.                 right: rightMaterial,
  53.                 top: topMaterial,
  54.                 bottom: bottomMaterial
  55.                 } ), 500, 500, 500, 3, 3, 3);
  56.             // Listen for the click:
  57.             cube.addEventListener( InteractiveScene3DEvent.OBJECT_PRESS, onPress);
  58.             // Add to scene:
  59.             default_scene.addChild(cube);
  60.         }
  61.        
  62.         private function onPress( e:InteractiveScene3DEvent ):void {
  63.             // If the cube has been moved to the front:
  64.             if (tweening) {
  65.                 // Let it rotate again
  66.                 tweening = false;
  67.             }else {
  68.                 // Find which rotation we need to be able to see
  69.                 // the face image:
  70.                 switch(e.face3d.material.name) {
  71.                     case "front":
  72.                         targetrotationX = 0;
  73.                         targetrotationY = 180;
  74.                         targetrotationZ = 0;
  75.                         tweening = true;
  76.                     break;
  77.                     case "back":
  78.                         targetrotationX = 0;
  79.                         targetrotationY = 0;
  80.                         targetrotationZ = 0;
  81.                         tweening = true;
  82.                     break;
  83.                     case "left":
  84.                         targetrotationX = 0;
  85.                         targetrotationY = -90;
  86.                         targetrotationZ = 0;
  87.                         tweening = true;
  88.                     break;
  89.                     case "right":
  90.                         targetrotationX = 0;
  91.                         targetrotationY = 90;
  92.                         targetrotationZ = 0;
  93.                         tweening = true;
  94.                     break;
  95.                     case "top":
  96.                         targetrotationX = 90;
  97.                         targetrotationY = 0;
  98.                         targetrotationZ = 0;
  99.                         tweening = true;
  100.                     break;
  101.                     case "bottom":
  102.                         targetrotationX = -90;
  103.                         targetrotationY = 0;
  104.                         targetrotationZ = 180;
  105.                         tweening = true;
  106.                     break;
  107.                 }
  108.             }
  109.         }
  110.        
  111.         override protected function processFrame():void {
  112.             if (tweening) {
  113.                 // If a face has been clicked
  114.                 if (default_camera.zoom <6.8) {
  115.                     // If the camera isn't zoomed enough then zoom in a bit more:
  116.                     default_camera.zoom += Math.sqrt(6.8-default_camera.zoom)/5;
  117.                 }
  118.                
  119.                 // Test each rotation and rotate it towards the target rotation:
  120.                 // X axis:
  121.                 if (cube.rotationX <targetrotationX) {
  122.                     cube.rotationX += Math.sqrt(targetrotationX-cube.rotationX);
  123.                     cube.rotationX = Math.round(cube.rotationX);
  124.                 }else if (cube.rotationX> targetrotationX) {
  125.                     cube.rotationX -= Math.sqrt(cube.rotationX-targetrotationX);
  126.                     cube.rotationX = Math.round(cube.rotationX);
  127.                 }
  128.                 // Y axis:
  129.                 if (cube.rotationY <targetrotationY) {
  130.                     cube.rotationY += Math.sqrt(targetrotationY-cube.rotationY);
  131.                     cube.rotationY = Math.round(cube.rotationY);
  132.                 }else if (cube.rotationY> targetrotationY) {
  133.                     cube.rotationY -= Math.sqrt(cube.rotationY-targetrotationY);
  134.                     cube.rotationY = Math.round(cube.rotationY);
  135.                 }
  136.                 // Z axis:
  137.                 if (cube.rotationZ <targetrotationZ) {
  138.                     cube.rotationZ += Math.sqrt(targetrotationZ-cube.rotationZ);
  139.                     cube.rotationZ = Math.round(cube.rotationZ);
  140.                 }else if (cube.rotationZ> targetrotationZ) {
  141.                     cube.rotationZ -= Math.sqrt(cube.rotationZ-targetrotationZ);
  142.                     cube.rotationZ = Math.round(cube.rotationZ);
  143.                 }
  144.             }else {
  145.                 // If the camera is zoomed in, it shouldn't be now
  146.                 if (default_camera.zoom> 2) {
  147.                     // So zoom out a bit.
  148.                     default_camera.zoom -= Math.sqrt(default_camera.zoom-2)/5;
  149.                 }
  150.                
  151.                 // Rotate the cube a bit:
  152.                 cube.rotationX += 2;
  153.                 cube.rotationY += 2;
  154.                
  155.                 // Make sure that we dont "wind up" the rotation
  156.                 if (cube.rotationX>= 360) cube.rotationX = 0;
  157.                 if (cube.rotationY>= 360) cube.rotationY = 0;
  158.             }
  159.         }
  160.     }
  161. }

Post to Twitter Post to Delicious Delicious Post to Digg Digg This Post Post to Facebook Facebook Post to StumbleUpon Stumble This Post

72 Responses to “10. Advanced Interactivity”


  • thanks to Luke and thanks to ttubin for solving the bug. I could’nt really figure it out by myself

    sayd that, what about a panorama3D tutorial?

  • I’m just getting used to PV and while looking at this file, apparently the Main.as has some errors, I tried fixing them but was not succesful. I’ d like to know if there’s a way to fix it. Thanks

  • I have completed this tutorial successfully, although I did have to alter some of the values of the targetrotation faces, because 2 of the faces were showing wrong sides when clicked, and they were upside down. Took me about 10 min to figure out what the proper values should be.

    I have a question though. I am using the PaperBase.as basis with this, I think? If it even imports those settings? Not sure.

    Anyways. I want to know if it is possible to make the camera position different, and what the code to do that would be. When I run this movie, the cube goes waayy into the distance, and I have to zoom like 400% in the flash player to see it properly.

    Got a link to altering camera position/movement? Or code?

  • PaperBase? I think Im using a newer version, seems to me that the biggest problem Im running into is refrencing all the classes

  • Here is the CORRECTED targetrotation numbers for the ‘top’ and ‘bottom’ materials.. as Dave stated, those 2 faces were mixed up and upside down:

    case “top”:
    targetrotationX = -90;
    targetrotationY = 0;
    targetrotationZ = 0;
    tweening = true;
    break;
    case “bottom”:
    targetrotationX = 90;
    targetrotationY = 0;
    targetrotationZ = 180;
    tweening = true;
    break;

  • In the ‘if’ statement, try changing the ‘6.8′ in both places to ‘60.8′. This is for the zoomout when not clicked.

    and in the ‘else’, change the ‘2′ in both places to ‘30′. This is for the zoom in when clicked.

  • Hello admin,

    Can you please remove that post where i started saying “My last post came out incorrectly and it won’t let me delete the..” That code snippet is not correct, there was some sort of pasting error.

    The post where i start off saying “Here is the CORRECTED targetrotation numbers for the ‘top’ and ‘bottom’ materials..” is in fact correct ;)

  • Thank you so much for the awesome tutorial!

    I’m a completely new to PV3D, and I have a rather stupid question.
    When I publish the swf file to my html website the cube and the interactivity works, but none of the images appear. Can you let me know if there’s anything special I need to do?

    Thanks again!

  • I tried to add interactivity to your Cow from earlier tutorial but unfortunately I realised that only objects with explicit interactivity of material can work.
    Is it possible to add mouse events to other 3D objects?

    Kind regards,
    Maciek

  • hi!
    and thank you for this tutorial!
    i would like to ask you what “<” means ?
    because when I try to publish my swf, I have an error on it
    which is saying : (excuse me but it is in french)
    “1084: Erreur de syntaxe : rightparen est attendu devant semicolon.”
    and
    “1084: Erreur de syntaxe : semicolon est attendu devant rightparen.”
    “1084: Erreur de syntaxe : rightparen est attendu devant semicolon.”
    “1008: Attribut non valide.”
    “1084: Erreur de syntaxe : identifier est attendu devant rightparen.”
    etc…
    there are 17 errors like that…
    did I do something wrong?
    thank you for your answer.

  • sorry it’s me again

    when i post my message “<” appeared !
    and it was oncoding on my flash
    I changed that and it’s ok now

    sorry again… and lot of thanks !

  • very nice tutorial,

    it’s been mentioned in other posts but bear in mind this guy’s blog doesn’t like signs, and replaces them with unicode.

    also 6.8 and 2 should be replaced with 60.8 and 30 in the zooming logic, and the top and bottom cases are wrong..

    anyway, i’m loving learning pv3d with this series of tutorials, so very well done and many thanks :D

  • hello. thanx for sharing!
    when I clicked on any side noting happens.
    the listener dis not working…
    cube.addEventListener( InteractiveScene3DEvent.OBJECT_PRESS, onPress);

    thanx for any help

  • hello,
    looks great. unfortunately i cant get this running.. i allready tried to get help in german flash forums but no one could help.. as i can see here is allmost no one who didnt manage to run it properly.. maybe someone clould look at my script/file.. or more easy send me a file?
    im triing this for so long and i realy need this for my website navigation..
    thanx for any responding

  • You may also need to set:

    viewport.interactive = true;

    to make your press event working.

  • Could someone zip up a working version of the files for this and post it here so I can compare them with mine? Thanks!

  • Hi there,
    thanx for this great tutorial! It runs as it should, but maybe you can help me to solve another problem:

    I want to load the final cube.swf via loader-class into another swf (interface.swf), created in Flash CS3 Pro. If I test this swf in Flash, it loads the cube as wanted. In a Flash-Projector, it works too. But with the local Flashplayer or online, the cube seems not to get loaded. If I try to load a JPG instead, it works fine.

    Any ideas?
    Thank you very much, greetings from Germany,

    Chris

  • Problem solved! The interface.fla / swf has to be stored inside the cube.swf-folder. But theres another problem appearing now: If i reload the cube over and over using a loader-button inside the interface.swf, the cube gets slower and slower with each reload. Ideas?

    THX,
    Chris

  • I can get the cube loaded, with images, but when I click on it it dissapears :(

  • I did the tutorial, and compared the code to the best of my ability. The cube isn’t quite performing as the example.

    On click it spins around lovely, but sometimes it ends up zooming on a corner. Or when I click the “green side” it spins around to the blue side…

    Anyhow, I’m glad I got the rotating cube. Thanks for the tutorial.

    *Inching towards enlightenment* ^^

  • Hey Everyone,

    This tutorial has been updated.
    http://papervision2.com/advanced-interactivity/

    It includes a fix for targeting the proper panel of the cube when clicking the top / bottom sides.

    Charlie

  • Thank’s (–)(__)

Leave a Reply


Follow papervision2 on Twitter

Flash and the City banner
2010 Flash And The City Speaker

RSS Feed