Help needed on correction applied to the rotatonY angle when using perspectiveProjection

Hello, can someone help me out please?
I have a stage with and height of : 600x400
On this stage i have 3 squares that have a centerpoint in the middle. The square are 90 (width) and 80 (height)
The first square is aligned to the left site and the second one in the middle and the third one on the right
The perspectiveProjection is setup using the middle of the stage as it projectionCenter.
When i rotate all squares to 90 degrees (rotationY) than only the middle one is now not visible anymore, at that point i want to
switch the image inside the square. But at 90 degrees the left and right squares are not invisible..  For the left square that point would
be at 90 - 22, and the right one 90 + 22.   Is there a way to calculate the correction value (22) in this example?
What i don't want is to give every square it's own perspectiveProjecten , then it would work but you have a completely different
3D rotation.
The only thing that goes wrong in my example is that the image from the left and right square are not changed at the right time, because
90 degrees on the left square does not mean it it not visible at that point.
And here is the code:
import flash.display.MovieClip;
import flash.geom.Point;
import flash.geom.PerspectiveProjection;
import fl.transitions.*;
import fl.transitions.easing.*
var squares:Array = [c1, c2, c3];
this.transform.perspectiveProjection.projectionCenter = new Point(300, 200);
this.transform.perspectiveProjection.fieldOfView = 50;
for(var i:int = 0; i< squares.length; i++) {
var square:MovieClip = squares[i] as MovieClip;
var tween:Tween = new Tween(square, "rotationY", Strong.easeOut, 0, 180,8, true);
tween.addEventListener(TweenEvent.MOTION_CHANGE, onTweenUpdate);
function onTweenUpdate(e:TweenEvent):void {
if(e.currentTarget.obj.rotationY >=90) {
  e.currentTarget.obj.img2.visible = true;
  e.currentTarget.obj.img1.visible = false;
} else {
  e.currentTarget.obj.img2.visible = false;
  e.currentTarget.obj.img1.visible = true;
//trace("targ", e.target.obj.rotationY);

try:
import flash.display.MovieClip;
import flash.geom.Point;
import flash.geom.PerspectiveProjection;
import fl.transitions.*;
import fl.transitions.easing.*
var squares:Array = [c1, c2, c3];
this.transform.perspectiveProjection.projectionCenter = new Point(300, 200);
this.transform.perspectiveProjection.fieldOfView = 50;
for(var i:int = 0; i< squares.length; i++) {
var square:MovieClip = squares[i] as MovieClip;
var tween:Tween = new Tween(square, "rotationY", Strong.easeOut, 0, 180,8, true);
tween.addEventListener(TweenEvent.MOTION_CHANGE, onTweenUpdate);
function onTweenUpdate(e:TweenEvent):void {
var theX:Number=e.currentTarget.obj.x;
var difX:Number=theX-this.transform.perspectiveProjection.projectionCenter.x;
var tempDegree:Number=e.currentTarget.obj.rotationY-(difX/10); //  <---anyone know the right formula?
if(tempDegree>=90) {
  e.currentTarget.obj.img2.visible = true;
  e.currentTarget.obj.img1.visible = false;
} else {
  e.currentTarget.obj.img2.visible = false;
  e.currentTarget.obj.img1.visible = true;
//trace("targ", e.target.obj.rotationY);

Similar Messages

  • Lots of existing threads, but no consistent answer - what settings need to be applied to the 2012 (new) Airport Express for it to work at hotels with an ethernet only connection?  Any answers specific to Japan would be helpful.

    Lots of existing threads, but no consistent answer - what settings need to be applied to the 2012 (new) Airport Express for it to work at hotels with an ethernet only connection?  Any answers specific to Japan would be helpful.  I would prefer not to take my old Dell laptop and just be able to use my Ipad 2 via the wireless connection that the Airport Express creates.  However, I can configure the Airport Express at home prior to leaving if that is the best thing to do.

    I have a very similar problem with my AE! My MacBook, MacBook Pro & iPod Touch (1st Generation) all get a GREAT signal from our AE. BUT, our iPod Touch (2nd Generation) and new iPad (WiFi) get terrible signal strength unless we're right next to the AE!! Tech support at Apple is of no help! I'm ready to sell them all! This all started when we got the last OS update for iPod Touch/iPhone/iPad. So it must be a software issue not a hardware one..
    Any ideas?

  • OUI-10091:There are no patches that need to be applied from the patchset

    Hi All,
    when i try to apply 10.2.0.3 patch on 10.2.0.1 in linux x86 I am getting into this error.
    OUI-10091:There are no patches that need to be applied from the patchset Oracle Db 10g R2 Patchset 10.2.0.3.0
    The original ora inventory is lost and cannot be recovered.
    So is there any way I can upgrade the database software.
    Please advise.
    thanks in Advance
    -PK

    You should first try to troubleshoot the missing inventory issue. Check this metalink document:
    OUI-67105 Due To Missing Or Corrupted Central Inventory In 10g
         Doc ID:      Note:417236.1
    ~ Madrid

  • Please help me. I just cleaned the disk and, when I clicked to install new OS X mavericks a screen with apple id popped up and said that I need to put apple id that purchased the OS X.

    Please help me. I just cleaned the disk and, when I clicked to install new OS X mavericks a screen with apple id popped up and said that I need to put apple id that purchased the OS X.

    How did youobtain OS X?

  • Help needed  while exporting crystal reports to HTML file format using java

    Help needed  while exporting crystal reports to HTML file format using java api(not using crystalviewer).i want to download the
    html file of the report
    thanks

    the ReportExportFormat class does not have HTML format, it has got to be XML. Export to HTML is available from CR Designer only.
    Edited by: Aasavari Bhave on Jan 24, 2012 11:37 AM

  • Hello, please help, my interface is connected to the microphone and when i open Logic 9 it does´t work. But I opened garageband to check and it works fine. I can record voice with any effect... With Logic i see the sound passes in the interface.

    Hello, please help, my interface is connected to the microphone and when i open Logic 9 it does´t work. But I opened garageband to check and it works fine. I can record voice with any effect... With Logic i see the sound passes in the interface but does not arrive in Logic. The Loops works fine and i can hear. Is just the sound to record the voice it does not work. What can i do ??? I used Logic before in the same computer and it worked fine. Thank you so much, I´m a begginer recording myself.

    Make sure you go into preferences in Logic and set the audio input to be your interface and the audio output to be either built in output or the interface, if that is hooked up to something else. It sounds like Garageband has the audio interface set as the input but not Logic.
    Also make sure you close all other applications except Logic to ensure it is not running in slave mode...

  • I am new to mac.  Do I need to store photos on the hard drive to use iPhoto or can I store pics on a network drive and still edit with iPhoto?

    I am new to mac.  Do I need to store photos on the hard drive to use iPhoto or can I store pics on a network drive and still edit with iPhoto?

    iPhoto needs to have the Library sitting on disk formatted Mac OS Extended (Journaled). Users with the Library sitting on disks otherwise formatted regularly report issues including, but not limited to, importing, exporting, saving edits and sharing the photos.
    See this article
    http://support.apple.com/kb/TS5168
    for more. Note also the comment:
    “Additionally, storing the iPhoto library on a network rather than locally on your computer can also lead to poor performance or data loss.”

  • Does the battery need to be calibtated on the MBP it is used in?

    Does the battery need to be calibtated on the MBP it is used in?
    My daughter has the same MBP I have.
    If I calibrate the battery on my MBP can I swap it with hers? Will it still be calibrated?
    Thanks ... Ken

    It can be calibrated in either machine. The calibration circuitry is in the battery, not the computer.

  • I'm trying to crop individual frames. Can this be done without the crop being applied to the entire clip? Using imovie 11

    I'm trying to crop individual frames. Can this be done without the crop being applied to the entire clip? Using imovie 11

    use the cmd-B(lade) command to split your single clip into individual ones

  • I want to remove or hide the Details Panel. when using OpenDoc.

    Hello I'm Yong ho Park.
    I recently had hard time because of Details Panel.
    I want to remove or hide the Details Panel. when using OpenDoc(Dashboard file).
    My system's version is  BI 4.1 SP02.
    Is your problem solved??
    If your problem isn't solved, I want to be offered related formation.
    I need your help. !!

    Hi,
    you cant hide the Details Panel. This behaviour is By Design.
    http://service.sap.com/sap/support/notes/2021076
    Regards
    -Seb.

  • How do I remove an old username from the app store when using the update function

    How do I remove an old username from the app store when using the update function.
    I purchased my Mac used.  The former owners username prepopulates when I try to perform the updated function on the app store.  It does not allow me to use a different user name.    I have created my own username and password.  I have even been able to purchase items from the app store, it's just when I use the update function it does populate with my username.  Any help is appreciated.

    The first thing to do with a second-hand computer is to erase the internal drive and install a clean copy of OS X. You — not the previous owner — must do that. How you do it depends on the model, and on whether you already own another Mac. If you're not sure of the model, enter the serial number on this page. Then find the model on this page to see what OS version was originally installed.
    1. You don't own another Mac.
    If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc from the Apple Store or a reputable reseller — not from eBay or anything of the kind. If the machine has less than 1 GB of memory, you'll need to add more in order to install 10.6. Preferably, install as much memory as it can take, according to the technical specifications.
    If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for some MacBook Air models. For early MBA models, you may need a USB optical drive or Remote Disc. You should have received the media from the previous owner, but if you didn't, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To boot from an optical disc or a flash drive, insert it, then reboot and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    If the machine shipped with OS X 10.7 or later, you don't need media. It should boot into Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    2. You do own another Mac.
    If you already own another Mac that was upgraded in the App Store to the version of OS X that you want to install, and if the new Mac is compatible with it, then you can install it. Use Recovery Disk Assistant to create a bootable USB device and boot the new Mac from it by holding down the C key at the startup chime. Alternatively, if you have a Time Machine backup of OS X 10.7.3 or later on an external hard drive (not a Time Capsule or other network device), you can boot from that by holding down the option key and selecting it from the row of icons that appears. Note that if your other Mac was never upgraded in the App Store, you can't use this method.
    Once booted in Recovery, launch Disk Utility and select the icon of the internal drive — not any of the volume icons nested beneath it. In the Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive.
    After partitioning, quit Disk Utility and run the OS X Installer. You will need the Apple ID and password that you used to upgrade. When the installation is done, the system will automatically reboot into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    Then run Software Update and install all available system updates from Apple. To upgrade to a major version of OS X newer than 10.6, get it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the previous owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed — you have to repurchase them.
    If the previous owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Apple customer service has sometimes issued redemption codes for these apps to second owners who asked.
    If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able to  authorize it immediately under your ID. In that case, you'll either have to wait up to 90 days or contact iTunes Support.

  • Get rid of the initial asterisk when using PasswordField masking in console

    Hi!
    How can I get rid of the initial astrerisk when using the PasswordField script from Sun?
    I've tried to check whether the BufferedReader is empty or not, but with no succes.
    Here comes the code:
    PasswordField.java
    import java.io.*;
    public class PasswordField {
        *@param prompt The prompt to display to the user
        *@return The password as entered by the user
       public static String readPassword (String prompt) {
          EraserThread et = new EraserThread(prompt);
          Thread mask = new Thread(et);
          mask.start();
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
          String password = "";
          try {
             password = in.readLine();
          } catch (IOException ioe) {
            ioe.printStackTrace();
          // stop masking
          et.stopMasking();
          // return the password entered by the user
          return password;
    }EraserThread
    import java.io.*;
    class EraserThread implements Runnable {
       private boolean stop;
        *@param The prompt displayed to the user
       public EraserThread(String prompt) {
           System.out.print(prompt);
        * Begin masking...display asterisks (*)
       public void run () {
          stop = true;
          while (stop) {
             System.out.print("\010*");
          try {
             Thread.currentThread().sleep(1);
             } catch(InterruptedException ie) {
                ie.printStackTrace();
        * Instruct the thread to stop masking
       public void stopMasking() {
          this.stop = false;
    }

    Hello Yajai,
    The example program will use the default value for timeout, 10 seconds. To change this, you will have to set the Stream.Timeout value. I inserted this function into the example and set it equal to -1, and the program will wait indefinitely for the trigger signal without timing out. Please see the attached image to how this was implemented.
    I hope this help. Let me know if you have any further questions.
    Regards,
    Sean C.
    Attachments:
    SetTimeout.bmp ‏2305 KB

  • Is there a way to adjust the frame length when using a FFT

    Is there a way to adjust the frame length when using a FFT?
    Thanks,
    David

    I thought that to have a longer frame rate you just need to have a longer sample set.

  • Adding a Button in the Application toolbar when using LDB for HR programs

    Hi Experts,
    I have a requirement to add a new button after execute button in the Application tool bar for the HR programs when using LDB PNP.
    Normally when we are using LDB in our program we will get a extra button provided by SAP after the execyte button.          When we are creating a new button for this  by using the table fields sscrfields  with the function key as 2 we are not able to see the new button.
    can any one help me in this issue.

    please post your relevant coding with respect to the button
    A.

  • Question about the CSS behavior when using layer 3 sticky and sticky table

    Hi everyone,
    I have a question about the CSS behavior when using layer 3 sticky and sticky table is full.
    If I configure layer 3 sticky and specify the inactivity timeout as below, how does the CSS
    handle subsequent needed sticky requests ?
    advanced-balance sticky-srcip
    sticky-inact-timeout 30
    CSS document says that
    Note:
    If you use the sticky-inact-timeout command to specify the inactivity timeout
    period on a sticky connection, when the sticky table becomes full and none of
    the entries have expired from the sticky table, the CSS rejects subsequent
    needed sticky requests.
    My question is what is the next reaction by doing the CSS if the CSS is in the
    following condition:
    when the sticky table becomes full and none of the entries have expired from
    the sticky table, the CSS rejects subsequent needed sticky requests
    Does CSS just rejects/drops subsequent needed sticky requests ?
    or
    Does CSS does not stick subsequence requests to particular service but CSS forward
    subsequence requests with round-robin basis ? which means if the sticky table is full,
    the CSS just works round-robin load balancing fashion for subsequence requests ?
    Your information would be appreciated.
    Best regards,

    Hello,
    There is a good document explaining this on Cisco web site
    http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_tech_note09186a0080094b4b.shtml
    It depends if the sticky-inact-timeout is used or not. If not, it's FIFO (the oldest entry in the sticky table is removed). If yes, the CSS will reject the next sticky request.
    Rgds,
    Gaetan
    Rgds
    Gaetan

Maybe you are looking for

  • Mail keeps crashing after configure all accounts for the third time all over again.

    Hi, please I need urgent help! I use my mail for business purposes so it's very important that I fixed this really fast :-( After the first crashes... I removed all account from the directory V2 and used the directories from another user... and I hav

  • Why does my iPhone use excessive amounts of data?

    My dad, step-mom, brother, and I are all on a 40gb data plan through AT&T. So that gives us each 10gb to use throughout our billing cycle each month. Over time my phone has gradually started to use more and more data. I was on a 2gb data plan when I

  • Airplay drops after 1 minute with pioneer receiver

    My iPad connects to my airplay enabled receiver pioneer. Connects and plays for about 1 minute then it drops and reverts back to the iPad.  All firmware is up to date The pioneer tab disappears from the airplay screen as a source then comes back.

  • EM Fails. Will scheduled backups be affected?

    Hello. I had a problem to our EM DBControl. It keeps on failing / or dying (issuing command emctl status dbconsole shows EM is not running). So i tried to drop all the repositories and recreate it. (+emca -create dbcontrol db -repos recreate -cluster

  • Coverflow sorting by artist...

    ... for classical music is just nonsense. No one might look primarily for an album sung by Domingo - I shall search for the title of the album, of course,, as I would in my paper box in earlier times... The side effect of splitting albums in as many