I wrote one of those once! It was a nightmare morass of one-pixel errors. Maybe there was some clever simplification I missed that would have made it all easy, but these days I use the libraries. :P
I know that's how stb_truetype's renderer works, incidentally. Don't know if Freetype is the same, but I'd be mildly surprised to find it wasn't.
I like stb_truetype myself. It's C so you'll have to bind it if you're using any other language, but it's a lot simpler than Freetype. (Less features too, but it'll take a .ttf and return a bitmap, which sounds like what you want.)
It's always great to see things that people would consider nontrivial programming tasks being done with a much smaller amount of code than they would expect from looking at the more "mainstream" libraries that do it. Public domain is a big bonus too.
In comparison, Freetype is absolutely monsterous; it is a few times faster according to some benchmarks I've found, but a few orders of magnitude bigger too. Sometimes you don't need the fastest, you just want something simple that works.
The geometry may be flat, but relationships between objects are still arbitrary, so light can still hit things from any angle. Try as you might, you can't escape curves. ;)
That article's a classic; definitely worth a read for anyone interested in graphics.
Whoops, yeah, you caught me. As I handwaved in the post, there's a little bit of implementation detail in the real code that I removed to clarify the algorithm. Fixed now, thanks.
ryg has been at RAD Game Tools for a while now, and mentioned yesterday on Twitter that he's been doing contract work on Valve's hardware experiments. [1]
While at RAD he's also worked on the D3D stack for Larrabee under contract with Intel and on optimizing the low-level graphics layer for Iggy (RAD's Flash-based UI middleware) across several platforms.
Especially of interest to HN readers is Part 3, which is about the economics of streaming anime - the ad-revenue numbers they present are shockingly low.
Yeah, this article seriously rubs me the wrong way. The tone throughout is "Rich Nerd Buys Cool Toy." And in that context a lot of the talk about the clock's "greater purpose" comes off as bootlicking.
If I were Bezos, I'd be particularly upset about what the writer puts into his mouth about the Gates Foundation and other charities - "Well, Bill Gates has already cured AIDS and malaria, so all that's left for me is to build a fuck-off huge clock!"
It's not just that - even when we're talking Warren Buffett here, the scale of the US govt is totally different. Buffett's entire fortune ($50B according to Wikipedia) would only cover a few weeks' worth of borrowing and then we're right back where we started only Warren Buffett has no more fortune. It's silly to say we should expect him to do that.
What he's saying by advocating tax raises is "I will pay more if I know that everyone else will also pay more." He's not interested in paying $XM to reduce the debt by $XM, but he would happily pay a personal cost of $XM if it meant reducing the debt by $XB.
(This is called "collective action," and it's also Groupon's business model.)
Why not? It's not like it's all or nothing. The taxes paid by the others today will be at least somewhat useful to the federal government before the billionaires pay their "fair share". If Buffet pitches in, it's just that much better for the federal government, and an example to set for his friends.
>What he's saying by advocating tax raises is "I will pay more if I know that everyone else will also pay more."
No he isn't. He's saying precisely the opposite:
"I would leave rates for 99.7 percent of taxpayers unchanged and continue the current 2-percentage-point reduction in the employee contribution to the payroll tax...But for those making more than $1 million...I would raise rates immediately on taxable income in excess of $1 million, including, of course, dividends and capital gains. And for those who make $10 million or more...I would suggest an additional increase in rate."
This is the article that introduced me to monofur, which I dearly love even though it seems fairly unpopular. Take a look[1] and you'll either think that lowercase L is a terrible idea or exactly the thing to distinguish it from the number 1. The rounded friendliness distinguishes it from all the other fonts I use; now when I see monofur (in the zenburn color scheme), it says "programming time" to my brain.
More or less, the sexps that define a state-script get run through a maze of Scheme macros - there's even a pretty decent expression language in there which is compiled to bytecode - and the result is big honking C++ structure which is fed to the Uncharted runtime and interpreted.
In particular, note all those wait-blah-blah calls; those are using call/cc to implement coroutines. Which is something you really really want in a game but which C++ of course doesn't have. (GOAL had native coroutines.)
It's also nice to be able to iterate on the language syntax without having to fool with BNF grammars and so on.
I know that's how stb_truetype's renderer works, incidentally. Don't know if Freetype is the same, but I'd be mildly surprised to find it wasn't.