Musings of a Fondue

A Screen for the Computer

I bought this Mcufriend touch screen. It’s the unbranded version of this one sold by Adafruit.



I got it for $10 compared to Adafruit’s price of $40. I came across the screen through this awesome video by Charles Cole where he walks through his FPGA implementation of a Z-Machine. I also bought the Altera mini dev board he recommends ($20 which is a steal) but that’s another post.

My gameplan is

  • To first get it working on Arduino (since there is information available online on how to do so).
  • Once it works on Arduino, convert the relevant files (driver, graphics) from C, Python, or whichever language is used to Hack Computer’s high level language.
  • Then change a few things here and there on the Hack Computer so that it outputs for the LCD screen instead of Tkinter.

Part 1) Getting the screen to work

Particles and SketchUp Shenanigans

Particles are cool! Example,

I had this idea back in 2014 of getting the points from premade 3D models (similar to the video above), and using them to do fancy animations in Threejs. Then I hit a knowledge wall and shelved it. Until today…

Nand to Tetris - Part 1 of 2

I finished the first half of the course.

And here’s a video of what my implementation looks like in action.

It can run programs! Albeit very slowly. The demo above is vastly sped up. In realtime, it took about 37 minutes to run.

The code for the emulator is on Github.

Project MViz - Update 4

I randomly came across this awesome project by makc. At first I thought it was a rendered photo of a model made by dedicated 3D software like Maya and Blender. But no, it was actually running live on the web using Three.js! Wow.

It is basically the explosion effect I’ve been after, whereby the whole country, not just a bar, extrudes outwards to indicate the value of a data point.

I had been working at this problem for sometime, but my results were rather unspectacular. Also my approach of using only the outlines of the countries meant I was limited in how the coutries could be rendered. Getting the countries' surfaces would require using triangulation, a rabbit hole I wasn’t particularly keen on entering.

Learning Shaders

I came across this awesome tutorial series for learning shaders by Omar Shehata of Tuts+.

It is targeted at beginners and has lots of visuals! It also uses ShaderToy, which means you can work through the tutorial online without having to download or setup anything.

If you manage to get through the first bit, you will learn a lot about how photo and video editing software work!

Check it out!

Project MViz - Update 3

How to do picking (i.e. country selection on mouseclick)?

I came across this project by Steve Hall. In it he makes a 3d map using Three.js and D3 that is responsive to mouseover and click events. He also has a great writeup that shares how he tackled the problem.

At the time, I didn't really understand what the article was saying. But two things I did takeaway were,

  1. the use of Three.js’s built-in raycasting to figure out the mouse’s coordinates in 3d space
  2. the use of an algorithm to determine if a point is inside a bounded region