Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> How do I rotate a point based on an angle?, A little advanced math is in order here!
Unspecified
Miles
  Posted: Oct 28 2009, 11:18 PM
Quote Post


Y HALO THAR


Group Icon
Group: Members
Posts: 71
Member No.: 1468
Joined: 22-September 05

Status: (0d) [--]


Okay, so I'm working on this platform-carrying thing where you stand on a platform, which is positioned relative to an anchor object that may move at any given moment. The platform itself will swing, which brings up the question: How would I position the platform object based on the angle (or an updating value maybe) of the anchor object?

If you don't get what I'm saying... think about Sonic 1's Green Hill boss (where there's a ball on a chain that swings back and forth, and is attached to Robotnik's ship), or Super Mario Brothers 3 (the nuclear waffles that swing round and round in the castles). How would I make an object swing like that?

This is being done in Game Maker 7 Pro, using a heavily scripted engine of mine.

Any help would be appreciated.


--------------------
No, I'm not that Tails character. Silly you, jumping to conclusions like that!
PMEmail PosterAOL
Top
United States
Xgoff
Posted: Oct 28 2009, 11:21 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


basically whatever gm's equivalent of:

orbiter_x = anchor_x + cos(anchor_angle) * orbiter_distance orbiter_y = anchor_y + sin(anchor_angle) * orbiter_distance

This post has been edited by Xgoff on Oct 28 2009, 11:22 PM


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
Miles
Posted: Oct 28 2009, 11:36 PM
Quote Post


Y HALO THAR


Group Icon
Group: Members
Posts: 71
Member No.: 1468
Joined: 22-September 05

Status: (0d) [--]


Yeah, that's close enough to GML. Thanks a ton, dude.


--------------------
No, I'm not that Tails character. Silly you, jumping to conclusions like that!
PMEmail PosterAOL
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0612 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 2.53 ]