Math Pros- I need help with Tshirt's Orbit Demo

giacomopoppigiacomopoppi Member, PRO Posts: 914
edited November -1 in Working with GS (Mac)
Hi everyone, I am having problems with Tshirts Orbit template which you can find here: http://gshelper.com/?p=176

basically I need to be able to get the orbiting object to start in another position during the orbit.
Is it possible to start the orbit from here: (for example)

http://imageshack.us/photo/my-images/600/schermata20110629a42337.png/

or here:

http://imageshack.us/photo/my-images/835/schermata20110629a42341.png/

?

Here is tshirtbooth's math from the demo:
100*cos( self.Time *-200%360)+ game.sunX
100*sin( self.Time *-200%360)+ game.sunY
vectorToAngle( game.sunX – self.Position.X , game.sunY – self.Position.Y )

thanks!

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You need to add an offset to the angle within the cos/sin functions.

    100*cos(self.OffsetAngle+ self.Time *-200%360)+ game.sunX
    100*sin(self.OffsetAngle+ self.Time *-200%360)+ game.sunY

    This is assuming the self.Time starts at 0.

    So set the self.OffsetAngle to 135 for the first image and 315 for the 2nd image. Or some angle close to those.
  • cmw333cmw333 Member Posts: 76
    Hi the send me your email as I think I have worked it out. What angle do you want to start at?

    Code Monkey beat me to it. It's really easy.

    Chris
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Thanks CodeMonkey, exactly what i needed ;)

    @cmw333 Thanks, I got the answer ;)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    cmw333 said:
    Hi the send me your email as I think I have worked it out. What angle do you want to start at?

    Code Monkey beat me to it. It's really easy.

    Chris

    I've noticed you telling people to email you instead of helping them right here on the forum. Please try to solves peoples problems on the forum instead of immediately going to email. It will most likely be something others need help with in the future.

    Thanks
    Aaron

    ___________________________________________________________________________________
    TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • cmw333cmw333 Member Posts: 76
    Sorry tenrdrmer just trying to help but your right. Probably the only time I was able to figure something out myself and jumped to the chance at helping another member.

    Chris
Sign In or Register to comment.