Comment

Comment by furyofantares

I wish I still had one of the earliest programs I wrote. It would have been 1996, I was 16, and I had a linear algebra book which had an appendix entry on computer graphics. I had taken a programming class the prior quarter.

I got hooked writing a program to draw rotating wireframes of a few different shapes. I almost failed the class because I was so distracted by this.

I didn't know about arrays yet. Every vertex was its own variable with a hardcoded default. Every entry in the rotation matrices was its own variable. The code to do matrix multiplication therefore didn't have loops, just a long list of calculations. Which had to be duplicated and adapted to every vertex.

I did know about pointers, I had to draw to the screen after all, which was done by writing to memory starting at a known address. So at least I had loops rasterizing the lines between vertices.

Which means I definitely had the concept of arrays and indexing into them, I just didn't know enough to make my own.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton