Geiger counter data logging in C#

I got my hands on a Geiger counter the other day. It’s a GMC-300E, they’re affordable, and the build quality is decent.

The device has an unlocked serial interface via USB, and the manufacturer has published the protocol documentation. This allows you to download the logged data and read life data from the Geiger-Müller tube, and with the 320 model also from the temperature sensor and gyroscope.

This is a quick guide on how to access the GMC-300E serial interface in C#.

Continue reading Continue reading

in dev by Comments Off on Geiger counter data logging in C#

Dev Notes: Seamless LODs, pt. 2 – Normal interpolation

It’s been a while since the last post in this series, in which I described how to gradually blend geometric levels of detail. Now that we have seamless geometry, it’s time to compute the geometry normals, so we can tell in which way the terrain is oriented relative to a light source, and calculate the lightness.

Now, this whole article is just a workaround for a very basic problem – a problem that might not even exist if it wasn’t for the strange ways the OpenGL API has grown and mutated over the years. Continue reading Continue reading

Simplicity and software

computerI’m trying to make the things I program simpler. This is true for the graphics stuff I’ve been doing but even more so for UI applications.

Not too long ago, I firmly believed in the mantra: the more settings, the more ways to tweak something, the better. This was important in a world of slow computers, crappy operating systems and overall shittyness. Everything is broken anyway, so if all of the internal workings are exposed, we can at least try and work around it.

I also remember reinstalling my operating system at least once every three months, with ISOs generated with a special tool that allowed me to strip out some of the garbage that came with the vanilla install. Getting a computer to run properly was mostly an exercise of fighting everything from the hardware layer up to the software itself. Hence, the “more settings are better” thing. Continue reading Continue reading

Dev Notes: Seamless LODs, pt. 1

In my previous articles, I’ve often mentioned Levels of Detail (LOD). In a nutshell, it means that things that are further away get rendered with a lower amount of detail. Since there is only limited memory and computational power available, it makes sense to put more effort into rendering things that are closer to the camera.

When rendering terrain, the typical approach is to divide the total area into multiple layers or rings that are centered on the camera position. Each layer will be rendered with about the same detail “count”. That means that they all have the same amount of detail relative to their area, but the bigger, outer layers will have a lower absolute amount of detail. These rings are called Levels of Detail. Continue reading Continue reading

Binary file download in C# .Net with speed limiter

Downloading files over HTTP is easy in C#/.Net – in fact, it’s as easy as writing a single line of code:

new WebClient().DownloadFile("http://your.url", "saveAs_Filename.jpg");

However, there’s no .Net library function that allows you to limit the download speed. Here’s how you can write your own.

What you’ll need is at its core a simple TCP client. It will connect to a HTTP server, send a GET command, then receive the reply packets from the server until the server stops sending. This allows us to add speed measurement and speed limiting.
Continue reading Continue reading

Procedural Planet in WebGL and Three.js

Holger Ludvigsen – Procedural Planet in WebGL and Three.js (part one, part two)

The articles discuss the concepts of cube to sphere transformation by normalizing the vertices, perlin noise, bump mapping and using the GPU to increase rendering speed. If you’ve been following my recent articles, this might be interesting to you as well.

Click “continue reading” for an embedded live demo. Continue reading Continue reading

Dev notes: Creating Worlds, pt. 3

In the last part we left off with a quad that can be subdivided as needed, so there will always be a sufficient level of detail at the spot where the camera is positioned, and depending on how high above the terrain the camera is.

The next step is to create six quads like this and assemble them into a cube. And finally, extrude the quads outwards so the cube will turn into a sphere. Continue reading Continue reading

Dev notes: Creating Worlds, pt. 2

In the first part I explained the difference between an “endless plane” flat procedural world and a planet-type one.

We’ll start with a spherical body with uniform surface details. As the camera gets closer to the surface, more details appear, until we’ve “landed” on the planet, at which point things should look about the same as with a flat world.

There are two important ideas to this. One, the spherical body will be based on an extruded cube, which means that the “one threedimensional body” challenge will actually be a “six slightly curved planes” challenge, and thus much easier to solve. Continue reading Continue reading