Archive for category Programming

Smooth random motions with differentiable random providers

Real-world movements are restricted by the laws of physics. E.g, body is required to move in a continuous motion without any sudden jumps. When modelling NPCs, a realistic movement is essential. Furthermore, mostly is is desirable for the NPC to move randomly. Most programming languages include random number generators, sometimes even for pre-defined probability distributions. […]

, , , ,

Leave a comment

Matching error-prone sequences of numbers (e.g. time codes) to each other

Some form of events are common in most software systems. If those events are logged with a timestamp, you get an ordered number sequence (if the timestamp is interpreted as a number). Sometimes it is desirable to compare two logs to each other and evaluate how similar they are. E.g. two users want to determine […]

, , , ,

2 Comments

Generic Run-length encoding (RLE) for C#

RLE is a very simple form of data compression that deflates repeated elements in a sequence. For a current project, I needed an implementation of RLE in C#. So I looked around on the internet. I was surprised that most implementations were quite simplistic and didn’t nearly fit my needs. One shortcoming of many implementations […]

, , ,

10 Comments

Binding to a 2D-array in WPF

WPF’s binding feature is really great to create user interfaces. However, sometimes it has its boundaries. Binding to multi-dimensional arrays is one of those. In this post I will show an alternate approach how to make the binding work. Binding a UI-control to a one-dimensional array is quite simple. The following code will display the […]

, , , , ,

Leave a comment

The SDX SpriteTextRenderer now supports SharpDX

As already mentioned in several posts, I’ve been developing a library for rendering sprites and text with DirectX 11. Up to now this library was available exclusively for SlimDX applications. Up to now. With the help of the newest member of the STR team, Lior Lahav, the library was able to evolve to a framework, […]

, , , , ,

Leave a comment

Serialize a multi-dimensional array in a dynamic order

When you work with multi-dimensional arrays, sometimes you need to serialize the data into a one-dimensional array. This might be due to several reasons. Maybe some third-party method cannot handle multi-dimensionaly arrays, you want to store the array in a file or whatever reason there might be. There are several situations where multi-dimensional arrays are […]

Leave a comment

Elastic collision of circles and spheres

Inspired by a question on StackOverflow I decided to write a short article about the physics of elastic collisions. The principle is always the same. But for reasons of simplicity I will explain everything by taking the example of sphere collisions. Due to the nature of spheres the algorithms can be used directly for hyper […]

, ,

Leave a comment

SlimDX SpriteTextRenderer Release 1.1

The SpriteTextRenderer is a library that aids in the creation of 2D elements in DirectX 11 (SlimDX) appplications. Thanks to some user posts I was able to improve the SlimDX SpriteTextRenderer. Topmost, some bugs in the font layouting system could be fixed. If you’re still looking for a sprite and text renderer for DirectX 11, […]

, , , ,

Leave a comment

Access the Doodle REST API

Recently I was working on a project that should be able to automatically create Doodle polls. Doodle provides a broad REST web service for this task. However, there is no .Net library that takes care of establishing the connection and so on. So I decided to start one on my own. The library uses DotNetOpenAuth […]

, , ,

Leave a comment

Preserving the context of an operation

In game programming you often have certain parts in your code where you need to change some variables and reset them back afterwards (e.g. render states). This can be necessary in “regular” programs, too. Usually you save the context in some variables, perform the changes you need and revert the changes. In this post I […]

, ,

3 Comments