Graphics, Duh!
-
I've been programming for many years but only recently found Qt. I'd never needed graphics for my projects but Qt seemed to have a nice system so I had a go. All was well until I stepped a way from the straight up and down Cartestian Grid. Despite reading everything in sight I just couldn't get my head around the transforms. Until suddenly, just the other day, it dawned on me what was going on.
I needed to print something upsidedown. So, how to do that? Well, there's no way that you can print the text itself upsidedown on a normal grid. and there's no way to turn the screen upsidedown either. The answer, of course (and there's the 'Duh!') is to turn the grid upsidedown and print 'normal'.
So I finally worked out what drawing graphics is all about: keep the paper/screen where it is and draw normally on a transformed grid.
Why did it take so long to understand this? To an old-timer like me the idea of rotating a grid which you draw on over a piece of paper/screen which is where you're supposed to do the drawing just didn't make sense. You draw on the screen, don't you? No, you draw on the grid and it shows up on the screen like a shadow of the drawing.
So there you go. I finally cracked it. I just wonder if other people ever had this kind of brainblock where nothing made sense until suddenly it did.
-
All the time. It is really helpful when drawing things that radiate out to draw them as a vertical line, then rotate that to an angle. I was drawing a wait display (circles going around) and found it easier to draw several objects with vertical coordinates and then rotate.
-
No worry. Working with different coordinate systems and switching between them gets a lot of people, so you're not alone :) I work with graphics a lot and see that all the time when people start to work with model/view/projection/texture spaces and coordinate transformation matrices.
My such moment was when I first learned pointers and pointer arithmetic. For the life of me I couldn't get the difference between a pointer and a pointee. Why do they have different addresses and when to modify which? Is a pointer a real place in memory or is that just some language abstraction? I was learning programming in Pascal and I hadn't much access to learning materials or examples back then, so I just avoided the topic or sticked to mindlessly copying what I knew worked without much understanding. One day, out of the blue, it just hit me (I don't think I was even doing anything with pointers at the time) and it felt obvious ever since, which made switching to C and then C++ a lot easier.
I guess there are just things obvious in hindsight, but they take a moment to rewire your brain when you first see them :)