# How do I rotate an object from a non-origin image point?

Get help using Construct 2

### » Sun Aug 09, 2015 8:59 am

This is what I'm pretty much trying to achieve. The origin point and the axis to which the sprite rotates at need to be separate image points. How do I accomplish this? Can Pins be used if there's not a simple function?
B
23
S
5
Posts: 111
Reputation: 1,554

### » Sun Aug 09, 2015 4:57 pm

Set X (DesiredX)+20*sin(Sprite.angle)
Set Y (DesiredY)-20*cos(Sprite.angle)

This example will make it rotate around a point 20 pixels below the origin. Hopefully you can adapt the concept to what you need.
B
38
S
10
G
4
Posts: 203
Reputation: 5,361

### » Sun Aug 09, 2015 7:23 pm

What do I put in for DesiredX?
B
23
S
5
Posts: 111
Reputation: 1,554

### » Sun Aug 09, 2015 7:56 pm

This could be a way to do it:
viewtopic.php?f=147&t=146141&p=935879&hilit=rotate#p935879
Just replace centerx/centery with the imagepoint x/y.
B
100
S
38
G
134
Posts: 5,555
Reputation: 85,323

### » Sun Aug 09, 2015 8:19 pm

General J wrote:What do I put in for DesiredX?

Whatever position you want the object to take. Rojohound's solution is better, though.
B
38
S
10
G
4
Posts: 203
Reputation: 5,361

### » Fri Dec 09, 2016 2:18 pm

Message: shubhamrathi9 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
R0J0hound wrote:This could be a way to do it:
viewtopic.php?f=147&t=146141&p=935879&hilit=rotate#p935879
Just replace centerx/centery with the imagepoint x/y.

Dear Rojohound,
I loved what you have shared here and it have helped a lot but i am not able to solve the same equation if i want rotation to be anti-clockwise.
i have replied to the post in the link you shared, i thought i was not clear there so i m posting here
can you please post an equation that would do the same but for anti-clockwise rotation
it would be a real help as my game mechanism depend completely on it.
B
20
S
7
Posts: 117
Reputation: 1,767

### » Fri Dec 09, 2016 2:47 pm

never mind ! got it! just had to change some angles to negative!
B
20
S
7
Posts: 117
Reputation: 1,767