Need some math Help with rotation.

Okay so I have an object I need to rotate with an offset. I just need to pin the rotation spot at the top and do a simple change of angle around that point. Say move it to 20degs and stop. I'd like to use the rotate to angle behavior. @Socks @RThurman

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @Lost_Oasis_Games, afraid I can't offer much help, I'm just writing to say I'm so excited to see that I'm not the only one who needs help with math at times! ;)

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited October 2015

    It's obvious, Dave.

    1. Take the mass of the universe.
    2. Square it
    3. Divide by 0.
  • ArmellineArmelline Member, PRO Posts: 5,421

    Hop on Skype Dave, I have something I made that might help, but I didn't polish up enough to want to post it on the forums just yet. I'm popping out for a few minutes but will be around most of the afternoon.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2015

    Constrain the X position to A *cos( self.Rotation )+BX
    Constrain the Y position to A *sin ( self.Rotation )+BY
    Rotate to Angle / 20° (relative to actor)

    A = radius of the circle, BX and BY are the position for the pivot within the scene.
    When you place the circle in the scene, point it downwards (-90°)

  • SocksSocks London, UK.Member Posts: 12,822

    Example project:

  • SocksSocks London, UK.Member Posts: 12,822

    Here is an automated version, just place the red pivot point where you want in relation to the actor (or move the actor around in relation to the pivot point) and the rotation is worked out for you.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
  • ArmellineArmelline Member, PRO Posts: 5,421

    @Socks just posted pretty much exactly what I was going to offer, so along with @RThurman's alternative method you look well covered now :D

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Well. Don't even try my method guys. I just found out it didn't work.

    ...

    :P

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Ultimately it does @Braydon_SFX , it puts the onus on the user to rotate their phone. :)

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Thanks guys going to try it out now. I totally suck at vector math.

Sign In or Register to comment.