User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: rotation and fixed point movement help

  1. #1
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rotation and fixed point movement help

    Ok, this is a rotation problem with the added kicker of being attached to a fixed point on a main object that is also rotating

    Here's what I'd like to do:

    I have the main object, pretend its just a square. There are 4 active objects that I want to effectively affix to the square in specific spots. To these active object I want to affix another set of objects that are like spokes on a wheel, so they just stick out.

    To start, the active objects affixed to the square are at the mid points of the sides (i.e. x=25, x=-25, y=25, y=-25). I then attached the spokes to these points and set the angles to 180, 90, and -90 so they would stick straight out. The object is now set up and the next part is where it gets tricky.

    I want to rotate the main object with the points attached (easy enough), and have everything move with the main object and keep its relation angles (hard!). I know it's a square but lets pretend it's a wheel and as it spins everything should spin with it and stay attached to the correct points.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    660
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I had a semi similar problem recently. The easiest solution is to check the position of the hotspots in all the sprites. Remember that the sprite will rotate around the hotspot, not necessarily the "center" of the sprite. So if you set each sprite's hotspot to the center of the main object as opposed to the center of itself, when you set the objects' angles together, they will rotate in unison.

  3. #3
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think there's a simpler issue that if fixed might do it. The 'affix' points I told to always stay at a specified position on the square aren't moving along with the square as it rotates. As the square rotates, the points (which are active object themselves) stay at x:-25, X:25, y:-25, y:25 as if nothing had changed. I guess that makes sense though since it's still the correct position from the hot spot.

    Any hints on how to make sure the objects are affixed to the square as it rotates?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I think dsilver's solution could be the quickest and easier to code,
    if I understand correctly your needs.

    You could also do that with some trigonometry, but dsilver's solution will do the same with less hassle.

    Se quick example:
    attach_rotate.mfa

    (I've only attached 2 objects to make it quickly...)

  5. #5
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dsilver - I had an idea what you were trying to do. It just felt weird placing the hotspot out from the image itself.

    Schrodinger - thanks for the examples. I know they'll both work. I'll see which one works best for my needs. At least with the math I know I can apply the principal to other images without editing in special animation conditions.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    660
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I know it feels weird to place the hotspot outside the image itself, but it can incredibly useful! For instance, if you have just a one pixel image, say in red, place the hotspot outside the image, and then scale it in just one direction, you get a beam effect! Lots of cool stuff you can do if you just, ahem, think outside the box.

    I'll show myself out.

  7. #7
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    booooooooooooooooooooooooo *throws tomato* I see what you mean though.

    I got an xscale for my beam too. How did you propose using the 'way out' hot spot for a beam effect?

  8. #8
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I may or may not get this figured out by the time you reply, but here it is.

    Schrodinger - On your math example, I got the x axis points working fine with:
    X( "Active" ) + Cos(Angle( "Active" ) * -1.0 ) * 25.0 / X( "Active" ) + Cos(Angle( "Active" ) * -1.0 ) * -25.0
    Y( "Active" ) + Sin(Angle( "Active" ) * -1.0 ) * 25.0 / Y( "Active" ) + Sin(Angle( "Active" ) * -1.0 ) * -25.0

    The above affixes points to the mid points of the square on the X-axis. I'm having trouble figuring out the Y. Inverting the Sin/Cos for the X/Y above does affix the point correctly on the square, but the point will continually move in a circle around the square instead of staying in place. My lack of math understanding is haunting me

  9. #9
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    duh...set the angle to what it would be when the point reaches the desired location

    X( "Active" ) + Cos((Angle( "Active" )+90) * -1.0 ) * 25.0
    Y( "Active" ) + Sin((Angle( "Active" )+90) * -1.0 ) * 25.0

    I see the simplicity of using the hotspots now.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Hello Jarred,
    first "math" example should already affix objects at a square lateral mid-points,
    if each object's hot spot is placed in center position.
    To add 2 more objects you would just have to specify -180 and -270 (angular postions) where now you find "(nothing)" and "-90".

    I've made up another quick and "dynamic" example that allows for unlimited object attaching (evenly placed around the center)
    with instances of same object, so that you don't have to code them singularly.

    Attachment 16886

    Starting setup of 4 may be what you're looking for?

    If any doubt just ask (I'll be a little off-board these days, but I'll check within a day or two)
    Attached files Attached files

Page 1 of 2 1 2 LastLast

Similar Threads

  1. [BUG] floating point rotation
    By SolarB in forum iOS Export Module Version 2.0
    Replies: 5
    Last Post: 2nd December 2012, 01:40 AM
  2. FIXED - Beta 3 - Automatic Rotation
    By RhysD in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 26th October 2010, 11:01 AM
  3. rotation using floating point
    By JimCarter in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th February 2010, 04:52 PM
  4. Rotation From A Different Point
    By variant in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th December 2009, 07:01 PM
  5. Rotation Action Point Bug!
    By dustingunn in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 20th September 2006, 10:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •