-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to rotate a plane #351
Comments
Especially interesting here is that we're dealing with non-square cells, erp! |
So the idea of rotating general characters is madness, ain't gonna happen. You can sometimes get a pretty good 180 degree flip, and some characters are even amenable to 90, but in general it's not gonna fly. We'll have to special-case handling of each character either way. So let's enumerate the ones for which square-symmetry rotation is well defined:
Now what about cell aspect ratio? If we have █ and rotate it 180 degrees, that's still █. Rotated 90 degrees, is that ▄▄, or ▀▀, or ▀, or ▄? In the tetrimino example, we have e.g. (2 rows, 6 columns):
██████ an ideal rotation set would yield, i think: (3 rows, 4 columns) (2 rows, 6 columns) ██████ (3 rows, 4 columns)
████ so each cell is definitely becoming the bottom or upper halves of two cells. so the target plane is (⌈columns / 2⌉) rows x (⌈rows * 2⌉) columns if we have 23 this goes to (clockwise) 67 or (counterclockwise) 0A and finally 0A8967 so on clockwise rotations, leftmost becomes topmost, rightmost bottommost, topmost rightmost, and bottommost leftmost. |
We're now working for planes which come in as all top half-blocks. Need to do a little work to handle others, but it's there. ;D |
Add
ncplane_rotate(n, rad)
rotating an ncplane throughrad
radians (0 <=rad
< 2pi). Figure out exactly what it means to do this with a plane full of character graphics. also: Are we rotating around the center? The origin?The text was updated successfully, but these errors were encountered: