Unit Tests in C with the constructor attribute

In one of my project, I used GNU constructor attribute to add some simple unit tests to any C file. I liked this approach, but I don’t see many open source projects using anything similar, so I though I’ll describe it here. Here is an example of a C file containing a function: ... // Test if a string ends with an other string. // If any of the string if NULL, return false....

2016 September 2

Keeping notes in unformatted text files

For years I have been looking for the best way to keep organized notes on my computer(s). I tried a lot of different approaches, from web based tools to emacs org mode and desktop wiki. Now I think I can say that I found the best way (for my personal case) to do it: I keep all my notes as unformatted text files, in a single flat directory. Here is how it works: I have a directory Notes in my computer home folder....

2016 July 25

Goxel 0.3 Released

I just released the version 0.3.0 of my open source voxel editor Goxel. This release brings: Import/Export support for the popular editor Magica Voxel. Render shadows. Better shapes support, specially when we use marching cube rendering. Multiple palettes. Better UI, with new tools icons. Here is a video of the laser tool:

2016 July 9

OpenCV Camera to OpenGL Projection

I am sure some people are hitting their heads trying to solve this simple problem when doing augmented reality with OpenCV and OpenGL: How to get the proper OpenGL projection matrix from the OpenCV camera calibration values? For the simple common case where the OpenCV camera matrix has the form: |fx 0 cx| |0 fy cy| |0 0 1| The corresponding OpenGL projection matrix can be computed like this:...

2016 March 23

Goxel 3D procedural rendering

In this post I introduce a new experimental feature I am adding to goxel: procedural voxel generation. For this I created a mini language specifically designed to describe drawing operations. Think of it as the logo language, but in 3D. Note: this is still experimental at this point, so anything in the language could change in the future. I will try to keep this page up to date as a reference documentation....

2016 March 10

Lambda expressions in C

C does not have built-in support for lambda expressions, but if you are using gcc, it is actually quite easy to implement them using a simple macro. This trick relies on two C extensions: nested functions and statement expressions. Both are available in gcc (but not in clang!) Here is a small program that could benefit from lambda expressions, written in conventional C: // A function taking a function pointer as argument....

2016 January 13

How I made my parallel self win the lottery

While I was in France recently I decided to make one of my parallel self a millionaire. It’s very easy and you too can do it if you want. How to do it? First you have to check how the national lottery of the country where you are works. In France, a lotto ticket costs 2 euro, you have to pick five different numbers from 1 to 49 (included), and one ’lucky’ number from 1 to 10 (included)....

2015 December 20

Goxel, an open source 3D voxel editor

Goxel is a new project I have been working on since last month. It’s an open source 3D editor to create voxel images (in the style of minecraft, or crossy road). It works on Linux and Windows. Features: 24 bits RGB colors. Unlimited scene size. Unlimited undo buffer. Layers. Smooth rendering mode. Export to obj and pyl.

2015 October 5

Voxel Snake 3D

I just released a small game on google play: Voxel Snake 3D. This is basically a snake game played on a 3D cube, using voxel rendering. Let me know what you think!

2015 July 28

Blowfish Rescue 1.0 Released

Just a small post to announce the release of my new video game: Blowfish Rescue. This is a 2d action/puzzle game using a fluid simulation solver. Most of the graphics are procedurally generated. The game is available for free on google play and iTune. Here is a promo video I did: In the following week I will open source the procedural generation code, as I think this is an interesting part of the code, and can probably be reused for other games....

2015 July 6