Letters from a vector eh?   Leave a comment

#define I_CAN_HAS_CHEESEBURGER “no”

On Monday the 19th I had to do some work. Man! I hate it when that happens. It wasn’t terribly exciting; make one bit of the software load data from another bit, fix a bug that cropped up, that kind of thing.

In the evening I ignored everything else in order to get more coding done. I ignored the washing up; I knocked together a simple (and forgotten) dinner. Code code code!

The evening’s main task wasn’t exciting, but it was necessary. I needed letters (as in alphabet) represented by points in 2D space. So after a couple of minutes’ searching provided no easy answer, I sat down to emulate the constipated mathematician, and drew the characters I needed on a bit of paper so I could work out vertex co-ordinates.

And then I wrote the functions that would generate the points (pushing them onto a vector. I like vectors! std::vectors and ID3DXVECTORs and std::vector<ID3DXVECTOR2>s) by interpolating the lines between the vertices. Thanks to some judicious (hacky) pre-compiler macro usage, it wasn’t as bad as I’d feared. It didn’t even look as bad, although that was because the macros hid most of it.

By the end of the night I had something that wasn’t exactly what I wanted, but that would, in an emergency, just about do. With a whole evening left to work on it, it was looking promising.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s