Apply it with the rotation. Doesn't matter if before or after rotating [edit: to clarify, it doesn't matter assuming you're scaling by the same amount in both axes; otherwise it does matter]
Challenge rotating around a point
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Challenge rotating around a point
-
- Prole
- Posts: 9
- Joined: Wed Dec 29, 2021 8:01 pm
Re: Challenge rotating around a point
I guess I was thinking subsequent translate and rotate statements were expressed in the "new" coordinate system, but they seem to all be in the original coordinate system. Except...
I just tried it out expecting it to work anywhere, but it only works between the two translations, either before or after the rotation. I just threw in a `scale(2)` for testing.
That confuses me a bit because I thought I just learned that all translate coordinates were in the original coordinate system, but scale would seem to be creating a new coordinate system for subsequent transforms. (Well, new scaling, same origin I think.)
Attaching the updated .love file with the rotation fix and some other improvements if anyone wants to try placing a scale in places in the camera. (It's also updated now in the Itch link I posted earlier.)
Edit: Oh, didn't notice that pgimeno had replied re: the scale, because it went to thread page 2. So cross-posted.
- Attachments
-
- bumpy-road.love
- (31.22 KiB) Downloaded 69 times
Re: Challenge rotating around a point
If you scale e.g. 2x before translating, the translation position needs to be halved in order to be in the same place, so you'd need to compensate by dividing x_offset and y_offset by 2. Remember what Zorg said about the axes. If you scale the axes 2x, the desired position is now at half the original coordinate.JimOfLeisure wrote: ↑Wed Jan 12, 2022 6:08 pm That confuses me a bit because I thought I just learned that all translate coordinates were in the original coordinate system, but scale would seem to be creating a new coordinate system for subsequent transforms. (Well, new scaling, same origin I think.)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests