pivotX and PivotY

How to use actually?
I need an example.
Help, please.

It also uses the pivot point to rotate the image along the circle. If you change the pivot to something else than the control center point then rotation will br executed on new point of pivot. Take a look at the image in the URL provided above to see how the pivot point is used for rotation.

Tags: BlackBerry Developers

Similar Questions

  • How to use the property PivotX and PivotY in cascades

    Hello

    My goal is to rotate the line on my angle.

    1 I received two points: A(x1; y1) and B(x2; y2).

    2. I calculated the size of the vector AB and angle of point A:
    AB = Math.sqrt (Math.pow ((x2-x 1), 2) + Math.pow ((y2-y1), 2));
    Alicia = 44 *.

    3 I put in place the line on the terms of coordination (width = AB, height = 3px):
    myLine.layoutProperties.positionX = x 1;
    myLine.layoutProperties.positionY = y1;

    4 I turn the line on the angle that was found.
    The starting point of the line must be the point A, endpoint - point B. But I have no =)
    I try to use the rotationZ, but I do not know how to work with his propertyes PivotX and PivotY.
    Default 0 PivotX and PivotY = 0. When I try to set up PivotX = x 1 and y1 = PivotY I get the incorrect result.

    With PivotX = 0 and PivotY = 0 I get it (myLine.rotationZ = 44):

    Please, help me =)

    That could happen, because the pivotX and pivotY zero definition makes the rotation around the center of the element. In the case of this image, which is equal to its center point (300, 1.5), but no, it is top left. Try to set the pivotX to-(image.width/2), which will be:-300; pivotY to the-(image.height/2), which is - 1.5; and then turn again.

    Please see the details on this subject here:

    http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__visualnode.html

  • How to position a foreignwindowcontrol

    Hi all

    How to position a foreignwindowcontrol.

    Here is my code. I thought pivotx and pivoty would work, but after the addition of these two properties, I found the image is cut off at the bottom, but it is positioned correctly.

    Page {
        Container {
            ForeignWindowControl {
                id: foreignwindow
                objectName: "foreignwindow"
                visible: true
                preferredWidth: 720
                preferredHeight: 520
            }
        }
    }
    

    You would like to move from the position and dimensions to the container above and use a LayoutUpdateHandler to size the control ForeignWindow correctly. This document gives a detailed explanation on how to manage the changes in the layout with ForeignWindows...

    http://developer.BlackBerry.com/native/documentation/Cascades/graphics_multimedia/opengl_es/tutorial...

  • rotation and translation cut image

    Hello

    I have an image that needs to be turned on a semicircle.

    {Of container

    horizontalAlignment: P

    ImageView {}

    imageSource:"asset:///images/straight.png".

    pivotX: 0

    pivotY: 56

    translationY: 0

    rotationZ:-90.0

    }

    When rotationZ is undefined is displayed correctly, but by applying a rotation it is cut. How to set the translation so that it shows not entirely

    Hey there...

    Your problem is perhaps not your translation.  It may very well be the container that you have your ImageView.  The ImageView is turned, while the container size remains fixed. Increase the horizontal size of your container and see if that helps...  Maybe use minWidth or preferredWidth...

    -Edit-

    Or same rotationZ container itself and see if the ImageView inside spins too... eh...

  • How focus a JavaFX Group properly and set the pivot (reverse) by using translations in 3D space?

    Description:

    I m referring to the Oracle tutorial http://docs.Oracle.com/JavaFX/2/transformations/jfxpub-transformations.htm using the transformations.zip source code, which is available for download on this page. I Don t understand why they Center the xylophone in space 3D like this and why they calculate the pivot (reverse) using translations. So they are creating a large number of groups, including rectangles, representing the xylophone, in addition to finally to a group called "cam".    

    class Cam extends Group {     
         Translate t  = new Translate();     
         Translate p  = new Translate();     
         Translate ip = new Translate();     
         Rotate rx = new Rotate();     
         { rx.setAxis(Rotate.X_AXIS); }     
         Rotate ry = new Rotate();     
         { ry.setAxis(Rotate.Y_AXIS); }     
         Rotate rz = new Rotate();     
         { rz.setAxis(Rotate.Z_AXIS); }     
         Scale s = new Scale();     
         public Cam() { 
              super(); getTransforms().addAll(t, p, rx, rz, ry, s, ip); 
         }     
    }    
    
    final Cam camOffset = new Cam();    
    final Cam cam = new Cam();    
    ...    
    camOffset.getChildren().add(cam);    
    ...    
    final Scene scene = new Scene(camOffset, 800, 600, true);    
    ... 
    

    The Group "cam" is added to another group called "camOffset", which is added to the 'scene' as root the node.

    Until there , everything is understandable to me, but there is a method, called "frameCam (.)" which calls 4 other methods: ""

    public void setCamOffset(final Cam camOffset, final Scene scene) {         
         double width = scene.getWidth();         
         double height = scene.getHeight();         
         camOffset.t.setX(width/2.0);         
         camOffset.t.setY(height/2.0);     
    }    
    
    //=========================================================================    
    // setCamScale    
    //=========================================================================    
    
    public void setCamScale(final Cam cam, final Scene scene) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;         
         final double pivotZ = bounds.getMinZ() + bounds.getDepth()/2;         
         double width = scene.getWidth();         
         double height = scene.getHeight();         
         double scaleFactor = 1.0;         
         double scaleFactorY = 1.0;         
         double scaleFactorX = 1.0;         
    if (bounds.getWidth() > 0.0001) {            
         scaleFactorX = width / bounds.getWidth(); // / 2.0;        
    }        
    if (bounds.getHeight() > 0.0001) {            
         scaleFactorY = height / bounds.getHeight(); //  / 1.5;         
    }        
    if (scaleFactorX > scaleFactorY) {            
         scaleFactor = scaleFactorY;         
    } else {            
         scaleFactor = scaleFactorX;         
    }        
         cam.s.setX(scaleFactor);         
         cam.s.setY(scaleFactor);         
         cam.s.setZ(scaleFactor);     
    }    
    
    //=========================================================================    
    // setCamPivot    
    //=========================================================================    
    
    public void setCamPivot(final Cam cam) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;        
        final double pivotZ = bounds.getMinZ() + bounds.getDepth()/2;         
    
    //*1*        
         cam.p.setX(pivotX);         
         cam.p.setY(pivotY);         
         cam.p.setZ(pivotZ);         
    //*1*        
    
    //*2*        
         cam.ip.setX(-pivotX);         
         cam.ip.setY(-pivotY);         
         cam.ip.setZ(-pivotZ);         
    //*2*     }    
    
    //=========================================================================    
    // setCamTranslate    
    //=========================================================================    
    
    public void setCamTranslate(final Cam cam) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;         
         cam.t.setX(-pivotX);         
         cam.t.setY(-pivotY);     
    } 
    

    If the method ' setCamScale (...) 'is understandable,' setCamOffset (...) ' puts the root node ('camOffset') in the center of the screen, but I Don t understand the 2 following methods at all. Of course, the child ("cam") is not centered, by putting just the root node ('camOffset') in the center of the screen, but how they focus the xylophone / "cam" and set the pivot, using translations:

    Questions:

    1. Why they use 3 different translations (', 'ip', 'p')?
    2. Referring to ' setCamPivot (...) ': Why they are the first translation of 'cam.p' to "pivotX", 'pivotY' and 'pivotZ' and then 'cam.ip' to '-pivotX', '-pivotY' and '-pivotZ' (marked in the source code with * 1 * and * 2 *)? Should he not just put the Group at his position, where it has been positioned before, as if the method has never been called? That would be my guess, because I expect that an object is placed in the same position as before, if I first move with the values X, Y, Z and then return with the same values - X, - Y, - Z in the opposite direction.
    3. Even with the method ' setCamTranslate (...) ' ': Why use another translation "cam.t", moving the Group ("cam") with the same values "-pivotX', '-pivotY' (and not '-pivotZ'), which they used in the"setCamPivot (...) method `?

    Annotations:

    Of course it works, the xylophone is located in the center of the screen and could turn perfectly, without change of rotation point / pivot point, but I Don t understand how they did it. I read everything about layoutBound, boundsInLocal, boundsInParent, blogs about page layout and page layout goes into javaFX https://blogs.oracle.com/jfxprg/entry/the_peculiarities_of_javafx_layout and http://amyfowlersblog.wordpress.com/2011/06/02/javafx2-0-layout-a-class-tour/ and finally a large number of questions to stackoverflow, but I still Don t understand the meaning behind the methods stated.

    Before the call of ' frameCam (...) ', they ask:

    double halfSceneWidth = 375;  // scene.getWidth()/2.0;     
    double halfSceneHeight = 275;  // scene.getHeight()/2.0;    
    cam.p.setX(halfSceneWidth);    
    cam.ip.setX(-halfSceneWidth);    
    cam.p.setY(halfSceneHeight);    
    cam.ip.setY(-halfSceneHeight); 
    

    I deleted these lines, because it doesn't change anything.

    The base in place, is that there are three defined different rotations, one around each axis. Of course, these could be combined into a single rotation, but doing so would make the geometry in the mouse dragging very complex managers. As it is, the degree of rotation around each axis can be calculated and changed independently.

    In general, the rotations are defined by an angle, an axis and a (pivot) point. The axis is a 3D vector and goes through the pivot point; the rotation is around this axis through that point.

    In the configuration in the example, the pivot of each of the individual rotations is set to the default (0,0,0). Because we really want the rotation to be around the center of the group, not the original, the Group translates first point appropriate pivot (ip), the rotations are applied then (around (0,0,0) after translation by ip), then the group is reflected in its location of origin (p). These operations are not commutative, yes show ip, then the rotation, then p is not the same as when you run ip, then p, then the rotation (in the second, ip and p would cancel and rotation would be about (0,0,0) instead of around the Center).

    For good measure, there is a scale, that is also applied after ip (so that scaling occurs from the Center, not the original) and then a final translation.

    The final effect is that there is a lot of transformations that can be controlled independently. There is a scale (s), a rotation about each axis (rx, ry, rz), and a translation (t). The p in translations and its inverse ip are just "housekeeping" to ensure that rotation and scaling are done from the center of the screen, instead of (0,0,0).

    So:

    1. Why they use 3 different translations (', 'ip', 'p')?

    p and ip are translations for the rotation and scaling are done from the Center and not to the origin. t is a general translation, the user sees.

    Referring to ' setCamPivot (...) ': Why they are the first translation of 'cam.p' to "pivotX", 'pivotY' and 'pivotZ' and then 'cam.ip' to '-pivotX', '-pivotY' and '-pivotZ' (marked in the source code with * 1 * and * 2 *)? Should he not just put the Group at his position, where it has been positioned before, as if the method has never been called?

    He puts the group to its original position, but other changes are between p and ip. These transformations behave differently (in a planned way) because the group is translated when they are applied.

    Even with the method ' setCamTranslate (...) ' ': Why use another translation "cam.t", moving the Group ("cam") with the same values "-pivotX', '-pivotY' (and not '-pivotZ'), which they used in the"setCamPivot (...) method `?

    The t values are changed in the mouse Manager (with alt-middle mouse button-drag, which I can't test actually using my trackpad...). As you have noted, the effect of p and IP translation cancel out, so we end up with t, which can be changed by the user. They could have combined t and p a single transformation, but updated since the mouse Manager would have been more delicate, and the intent of the code would be less clear.

  • I have an ipod touch 128 GB... but I'm almost to reach its maximum.  I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with other copies

    I have an ipod touch 128 GB... but I'm almost to reach its maximum.

    I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with the other copies of the other.

    is this possible?

    What should I do?

    Matt

    When you get the new iPod, you can use iTunes on your computer to select and synchronize the music you want on it, in the same way that you synchronize your current iPod - your iTunes will recognize them as different devices and will remember your choice of synchronization for each, it will not (unless, for example, you restore the backup of your current on her iPod) put the same content on both.

    (I asked for your post be moved to the iPod Touch forum, where you have posted is the iPad forum use.)

  • Why my notes sync between my Mac and iPhone?

    I have my MacBook Pro with Mac OS X 10.9.5 Mavericks and my iPhone is running iOS 10.0.1 and used to synchronize my notes! Is it because of the huge gap in operating systems? I SHOULD update my Mac to Mac OS 10.10 + for this problem? Thank you!

    In order to synchronize Notes between your Mac and iPhone, you must configure iCloud > http://www.apple.com/icloud/setup/

    But this requires macOS Sierra 10.12, the latest available version and the last iOS available for your iPhone.

  • Photos, iCloud and OneDrive sync

    Hi all

    I have a question on how to better organize my photo library.

    For the moment, on my space OneDrive (mapped to a partition on my MacBook SSD), I have a folder called 'Images' containing just about all of my photos and organized by folders.

    Since my tech ecosystem is roughly marked Apple (iPhone, iPad and MacBook), I would use the power and versatility of the Photos and iCloud, so that everything remains in all of my devices and free space memory iPhone sync.

    Here's the question: I want to keep my pictures saved on OneDrive, then put the Photos on my Mac to view photos from this folder and use iCloud to share through my devices.

    -I see the same folder structure on iPhone and iPad a synchronization is complete?

    -More important, if I take a picture with my iPad, it will be placed not only on iCloud but also automatically added pictures on Mac which, in turn, puts it in the folder of photos on my OneDrive?

    -Finally, take pictures of my iDevices will store them in the film. If I move them into folders, photos will be mapped (copied to iCloud) on my other devices constantly (in the folder)?

    I would like to notice I'm not trying to avoid using iCloud premium space - I already have a subscription plan of 50 GB that I don't mind mounted. I just keep having just all my photos on OneDrive.

    Thank you in advance for any comments you may have!

    Paul

    The answer is simply not

    The photo library can not be stored on a basic system to pictures not work will have a referenced library, so you may not have a local library references photos on a disc - the photo library can be on a local drive connected directly to the Mac OS Extended format

    You can synchronize between the Mac and IOS devices using iCloud library that synchronizes the photos and the structure of the album/folder between devices

    When you import pictures you can export them to your OneDrive record and have a copy (not associate Photos somehow) on a disk

    You can not have the same physical pictures in Photos and on one disc - each must have its own copy of the Photo

    http://www.Apple.com/icloud/photos/

    LN

  • Video and photos of backup

    Hello

    Anyone know the best way to back up photos and videos I took Iphone 6 my mom.

    I just got a new Iphone 6 more and have an icloud account, she has one more.  I don't know how to proceed.

    Thank you

    This article can help you:

    The backup of your iPhone, iPad and iPod touch - Apple Support

    You get free 5 GB of storage iCloud. If you want to save more than 5 GB, you buy more storage iCloud.

  • I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    You can use it with your TV.

  • I need to change my security issues and said we do not have enough information to reset your

    I need to change my security but said Questions we have insufficient information to reset security of your apple ID questions.my is [email protected] I want to slove this problem please help me

    You should contact the account of Apple security team. To join, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (145174)

  • Updated for Sierra and cannot import images

    I upgraded to Sierra and my camera, a Canon EOS 20 d is is properly recognized.

    Prior to the upgrade:

    When I plugged the camera would open automatically. I close and open Photoshop. PS I would like to select Import-> device and my camera would be identified. When I select the camer displayed thumbnails of photo.

    After the upgrade:

    When I connect the camera pictures only opens automaticall. If I open the pictures is not a camera attached.

    PS when I select Import-> my camera device is represented, but the icon is an external drive. When I select the icon nothing is displayed.

    Hello ChuckSto,

    Thank you for using communities Support from Apple. I know have a problem with your Mac and your camera is not what you expect. The good news is that the next steps will be useful for your problem of your camera is not recognized:

    If nothing happens when you connect your digital camera

    Try the following:

    • Make sure that the USB cable is properly connected to your camera and computer. If your computer has a USB port, try connecting the cable inside.

    • Check your camera to make sure he turned on and set to mode suitable for importing the photos. See the instructions that came with your camera.

    • Check the memory card of your camera for damage. See the documentation that came with your camera for more information on this page or other potential problems.

    Photos for Mac: import pictures from a camera or a mobile device

    See you soon!

  • Speeches and a .key file cannot be opened

    I'm unable to open or work on Keynote documents. I get an error popup image that says: cannot open 'FILE.key' because it is not a valid document to Keynote. I'm assuming that the same problem will occur in numbers and pages so I have not used either of these programs in a very long time so I do not have a file to test on.

    I know that the file is indeed a valid Keynote document. I recently had to reinstall my package iWork 09 since the original software discs - I have them have not purchased through the App store or my iCloud account. I have a software key. I can't move my OS to Sierra right now because I have other software that I use for work and tech support as we said we cannot go immediately. My current OS is El Capitan 10.11.6, and I have a MacBook Pro 15 "retina.

    Any advice on obtaining Keynote works again until I can make the upgrade to Sierra?

    Thanks in advance.

    Sounds like you are trying use Keynote 09 to open a file created by Keynote 6.

    Keynote 09 cannot open files of version 6 because they are a different file format.

    If this is the case, buy and install Keynote 6 from the Mac App Store.

  • Universal SE Clipboard and iPhone

    Universal Clipboard will work between a MBP of the retina and an iPhone SE?

    Hello curly1,.

    Thank you for using communities of Apple Support. It is my understanding that you want to use the universal Clipboard between your MacBook Pro and the iPhone OS. This is a great feature. I'm happy to help you.

    Universal Clipboard

    Universal Clipboard works with these devices and operating systems:

    iOS 10 macOS Sierra
    • iPhone 5 or newer
    • iPad Pro
    • iPad (4th generation)
    • iPad Air or newer
    • Mini iPad 2 or newer
    • iPod touch (6th generation) or newer

    • MacBook (early 2015 or newer)
    • MacBook Pro (2012 or newer)
    • MacBook Air (2012 or newer)
    • Mac mini (2012 or newer)
    • iMac (2012 or newer)
    • Mac Pro (end 2013)

    Requirements for continuity on Mac, iPhone, iPad, iPod touch and Apple Watch

    Have an amazing day!

  • USB disabled after the update of the Sierra (a short circuit and a work)

    Hi, when I bought my mbp 13 inches mid2012 (used, not new) I noticed that a USB port did not work. In the Yosemite sometimes I noticed that a USB port consumed too much energy and have been disabled. (I think because the usb port has been short-circuited. Year when it was time to update the mbp to El Capitan I had a few panic the kernel and the newspaper was shown as the last driver loaded the USB driver, so I kept the mbp with Yosemite. A few days ago, I updated for Sierra but only usb which used to work stopped working. It has enabled and turned on but Finder and disk utility does not see the drive. In an Apple dealer they said that could be established relationships with some oxide and next week will take it and see what the problem is.

    If there is someone with the same problems, please tell me what to do! I don't want to put in the trash my mac just for a flash drive... but I need!

    Hi Supermene,

    Thank you for using communities of Apple Support. Based on what you said, it appears as a USB device is not recognized in one of the USB ports. There are a few things that can cause this. I recommend you read these articles, which may be able to help solve the problem.

    macOS Sierra: If a USB device does not work

    Reset the management system (SCM) controller on your Mac.

    See you soon.

Maybe you are looking for