Collusion with Triangles? - three actors rotating around a centre point

Hello

In my attempts to make a collusion with triangles, I can not figure out how to make a centre point that 3 straight line actors can rotate around.

A triangle consists of three sides, hence three straight lines, when they are placed in an equal triangle, the centre of that should be the rotational point so to speak. And then they rotate around it, keeping the shape of the triangle perfect the whole time.
I am pretty sure i had a demo on this a few years back but can't seem to find it?
Anyone know how to begin this to get me started? Or the maths behind it?

Cheers

Best Answers

  • SocksSocks London, UK.Posts: 12,822
    Accepted Answer
    Demo attached:
  • SocksSocks London, UK.Posts: 12,822
    Accepted Answer
    You could also use a timer for the movement (makes any collision you might want to do a little more stable) - Demo attached:


Answers

  • SocksSocks London, UK.Member Posts: 12,822
    @123App

    Let me make you a quick demo . . . . back in a minute . . .
  • Bad wolf GuyBad wolf Guy Member Posts: 206
    @Socks Give us a sec to look at them.... Back in a minute...
  • Bad wolf GuyBad wolf Guy Member Posts: 206
    @Socks - Great, thanks- just by taking a quick look at the code. How would one change it if a player has control on the rotation of it. Thinking this might have something to do with the self.time attribute and change it to players oration or something- any ideas?

    cheers and thanks again for quick demo :)
  • SocksSocks London, UK.Member Posts: 12,822
    @123App

    This forum software is hilarious, if you mark a post as 'Answer' it deletes any attachments. :D

    Yes, your thinking is spot on, 'sin' and 'cos' derive their angle from self.time - but you can use anything you want for their angle - all you are doing is providing an angle, then the 'sin' and 'cos' of this angle is used to position the triangle sides (their angles are offset by 120° from each other).

    But I'd avoid using a player's 'oration' as the angle, mainly for grammatical reasons.

    Let me make another demo, I'll map the angle to an attribute . . . .
  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2013
    @123App

    Left and Right arrows on keyboard control rotation:

    (it's a bit thrown together, I am sure you can code it a bit more elegantly, maybe dump the timers, but it should give you the general idea).

  • Bad wolf GuyBad wolf Guy Member Posts: 206
    @123App

    This forum software is hilarious, if you mark a post as 'Answer' it deletes any attachments. :D

    But I'd avoid using a player's 'oration' as the angle, mainly for grammatical reasons.

    So looks like the forum doesn't promote people giving correct answers, looks like going to have to reject your answers @Socks. Its nothing personal, its just business.

    Taken into consideration your advice, "rotation may seem to be more suited" thank
    . :)
    @123App

    Left and Right arrows on keyboard control rotation:

    (it's a bit thrown together, I am sure you can code it a bit more elegantly, maybe dump the timers, but it should give you the general idea).

    Great, i figured it would be something along those lines. Thank you.
    If your up to the challenge, a square one using four lines would follow along the same process would it not?

    So instead of 120 degrees i would be looking for a 90 degrees. Will have to take a better look tonight and start experimenting, but in a sense, i should be able to add more lines i, adjust the code and it should work? or would it become more complicated?

    Cheers @socks for fast and effective reply and demos. Very easy to learn from here.

    (For consideration of others i will not accept this as an answer- hope you understand :) )
  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2013
    @123App
    So looks like the forum doesn't promote people giving correct answers, looks like going to have to reject your answers @Socks. Its nothing personal, its just business.
    I'm only here for the 'awesomes', I sell them on ebay.
    . . . a square one using four lines would follow along the same process would it not?

    So instead of 120 degrees i would be looking for a 90 degrees. Will have to take a better look tonight and start experimenting, but in a sense, i should be able to add more lines i, adjust the code and it should work? or would it become more complicated?
    No, not complicated at all, exactly like you say, make a fourth line actor, chuck him into the scene - then reconfigure the lines so their offsets are 0° 90° 180° and 270°.

    Same deal with a 5 sided shape or a 6 sided shape or as many sides as you want.

    Plus, don't forget to adjust the rotation value as well (not just the X and Y values).

    . . . . . . . . .

    Sin and Cos are easy to work out once you realise that they don't rotate the actor but simply move it in a circular path, once you get your head around that a whole world of circular fun opens up ! :)>-
  • Bad wolf GuyBad wolf Guy Member Posts: 206
    @Socks thank you for your time, should make it very easy to work on tonight.
    Good to hear your making a living by using Ebay :)
    Oh whats that.... an "Insightful".... i hear they are rare these days unless i am mistaken.
    Well deserved :)


    Cheers
  • SocksSocks London, UK.Member Posts: 12,822
    @123App
    @Socks thank you for your time, should make it very easy to work on tonight.
    Here's (attached) a square version, just took a couple of adjustments . . .
    Oh whats that.... an "Insightful".... i hear they are rare these days unless i am mistaken.
    That's an easy £12 on ebay. :)
  • Bad wolf GuyBad wolf Guy Member Posts: 206
    @Socks - Great as per usual :)
    Its going to need a bit of fine polishing to get it up to spec but other than that, insightful work and nothing i can't fix in a few hours work. Makes it a lot easier to work with collusions with non square or circle objects enhancing the players experience. Thank You! I doubt you would ever need my help, but if ever do feel free to PM me.
  • SocksSocks London, UK.Member Posts: 12,822
    @Socks - Great as per usual :)
    No problem.
Sign In or Register to comment.