pheelicks

Recent posts

Dec 14, 2013
WebGL tombstone - part 1 Recently, I’ve been combining 2D Canvas objects with WebGL Canvas objects, and figured it would be nice to put together a demo with some of the techniques used. An obvious application for these techniques is an in-browser tombstone designer, that’ll let us take a nice slab of rock and draw and carve all over it. Beats me why this hasn’t been done before. Today we’re going to look at setting up a 2D Canvas with some basic drawing capabilities, and linking it to a 3D scene.…
Nov 30, 2013
Introduction to images in Go - UI This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. A few posts back, we looked at how to set up a simple HTTP server and also how to communicate with a web page using WebSockets. Today we’ll combine this with the fractal generation code we looked at last time to make an application, with the backend powered by Go, while the frontend is displayed using web technologies.…
Nov 20, 2013
Introduction to images in Go - Fractals This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. The last couple of posts have been more about laying some foundations on how to graphically display output from our Go program in real-time, and have focused primarily on the networking side of things. So I thought it was probably only fair to play around some more with pretty pictures.…
Nov 5, 2013
Introduction to images in Go - Websockets This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. In the last post we looked at how to set up a HTTP server, for serving up an API or static files. Today we’ll do something more real-time, namely using WebSockets to stream data from our Go program and display it visually on a HTML5 Canvas element.…
Nov 1, 2013
Introduction to images in Go - HTTP This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. So far, we’ve pretty much always been using Go to spit out static image files. However, it’d be nice if we could do something a little bit more interactive, like generate images based on user input and the like. So here’s the plan: We’ll look at how to put together a HTTP server first Then we’ll add in some websockets for realtime communication with our Go code And finally we’ll use the HTML5 canvas to display our creations Today we’ll just take a look at the HTTP server, in the process explaining how to build API handlers, serve static files and “decorate” functions.…
Nov 1, 2013
Structuring large Three.js applications with amd & three.js Recently I’ve been building something using Three.js, and started out by basing my code on one of the many excellent examples. Soon enough I was in a world of bliss, full of lights and shaders and all the other niceness gives you. Unfortunately, my JavaScript code quickly started to get a bit bloated and hard to navigate, and I decided that it was to time to split up my code into separate files and modules to make it more manageable.…
Oct 22, 2013
Introduction to images in Go - Concurrency This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. Turns out that despite all the shilly-shallying in the previous posts, we didn’t talk about one of Go’s most useful features, built-in concurrency implemented using go-routines and channels. Today seems like as good a day as any to give it a shot. Concurrency in Go Concurrency in Go is really pretty simple, when invoking a function we want to run in parallel to the execution flow, we just use the go keyword before the method invocation:…
Oct 18, 2013
Introduction to images in Go - Filters This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. Recently I came across a most agreeable app, Instagram, that lets you add filters and what-not to your photos, and I thought it would be remiss not to try something similar in Go. And while we’re at it, why not introduce the concept of Interfaces. Goat Let me introduce you to a sweet goat.…
Oct 13, 2013
Introduction to images in Go - part 2 This post is part of a series. For a listing of all the posts, as well as instructions on running the code, see here. In the previous post we looked at how to create a Canvas type onto which we could draw a gradient. While gradients are all fun and games, to really start drawing we need to be able to draw lines onto our canvas. To do this we’ll need some way of representing points on the canvas.…
Oct 1, 2013
Introduction to images in Go - part 1 This post is the first in a series. For a listing of all the posts, as well as instructions on running the code, see here. It is meant as an introduction to Go, by way of a bit of simple graphics processing. If you haven’t come across Go before, I’d encourage you to head over to http://golang.org to check it out, in particular going through the excellent online tutorial. At the very least you should be familiar with how to run a simple Go program, see here for details.…