Collusion with Triangles? - three actors rotating around a centre point
Bad wolf Guy
Member Posts: 206
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
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
-
Socks London, UK.Posts: 12,822You could also use a timer for the movement (makes any collision you might want to do a little more stable) - Demo attached:
Answers
Let me make you a quick demo . . . . back in a minute . . .
cheers and thanks again for quick demo
This forum software is hilarious, if you mark a post as 'Answer' it deletes any attachments.
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 . . . .
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).
Taken into consideration your advice, "rotation may seem to be more suited" thank
. 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 )
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 ! >-
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
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.