Saturday, January 9, 2010

Base Raleigh Library is out

In these days I've rewritten parts of my Raleigh Library, that I use for my work-in-progress file-system (RaleighFS). The Library provides the basic Abstraction mechanism for read/write data from devices, client-server communication, threading and various data structures like Hashtable, Sets, In-Memory Stream (Chunk), Red-Black Tree, B*Tree and other things.

I've published the base source code, with BSD license, at google code (http://code.google.com/p/raleigh). You can download it using Mercurial.

hg clone https://raleigh.googlecode.com/hg/ raleigh


The usage is very simple, and the source code contains Test Cases and Examples that shows how to use all the "classes". For more information feel free to send me a mail.

Sunday, December 13, 2009

Qt4/OpenGL: Pose Editor

Last week I've published an automated "Puppet Animation" to show how Skeletal Animation and OpenGL works. Today, I've made something more to help you in the Animation Design Process.

The Qt code is really simple, it was just an UI with some slider connected to the Model Bones Matrix to performs Rotations and Translations and a QGLWidget that displays the OpenGL that you've already seen in the last post. I've also added a Useful ListWidget to display textures that are loaded by the model.

To get some cool models you can start by checking Blender's Open Projects that allows you to download models from Elephants Dream (see the screenshot above), Big Buck Bunny or Yo Frankie!. I'm still working on a better way to export Bones from Blender, If you've already tried and want to share some information, give me a mail! (thanks).

For this example, I've made a Big Package that contains the OpenGL engine that allows you to load and drows models and the Qt4 Pose Editor Tool that you can easily find in tools/ folder. The Source code is available here: Qt4/OpenGL Pose Editor Source Code.

Saturday, December 12, 2009

Backups and Files Deduplication

Yesterday, I've heard about a "No Space Left" on Backup Machine, obviously the first solutions arrived was like "Buy a new disk, they don't cost so much" or "Try this ultra branded backup product"... and then there's my custom and easy solution that was rejected. :)

So, If you're a little bit brave and you're able to write a couple of lines in Python you can have a very flexible backup system with files deduplication.

The main idea is...

  • Foreach home directory that you've to backup, store a key/value list with file_path/shasum (or an hash function that you trust).

  • Foreach file in the home directory check if the file is already on the backup server (Store files on Backup Server with shasum as name). If the file was not present upload it.


In this way on the Backup server there're "two folders" one that contains all the backed-up files (storing by shasum, means that one file was on server just once), and one that contains home-th30z-10-Nov-2009.list, home-th30z-11-Nov-2009.list, and so on.

In this way you can say... Hei, fully restore my home at "specified date" or just peek a file that you've in another specified date.. and maybe all the features that you want.

This is a easy and flexible way to store your backup, without wasting space and have a great granularity level of restore...

If you've really groked the idea, you can start your start-up company focused on backups. :D

Sunday, December 6, 2009

OpenGL: Skeletal Animation

Drawing meshes with OpenGL is really nice, but animating it's even funnier!


I've published the source code at gitHub git://github.com/matteobertozzi/GDEngine.git it's incomplete and buggy but it works for this kind of experiments.

Sunday, November 22, 2009

OpenGL: Collision Detection

Still experimenting with OpenGL, Today's example is about Collision Detection. As you can see from the screenshot... There's two crates and a wire sphere (I've no texture for that).. from the post title, you can imagine that the sphere moves in the direction of a crate and when it collided with the crate it changes its direction.
All the magic is under the hood, in the hit.c engine file. I've implemented a couple of methods that test collision between Box and Box, Box and Sphere, Box and Point, Sphere and Sphere, Sphere and Box, Sphere and Point. In this way you can easily handle the most common meshes, just checking glDataHitCollision(obj1, obj2).

The Source code is available here: GLData Collision Detection Example Source Code. Just type python build.py to build and run (Linux, Mac).

Nokia Certified Qt Developer!

Friday, I've received the congratulations mail to have successfully passed the Qt Essential exam, with the nice logo that you can see below... so, this post is just to place this sticker somewhere. I still prefer the Qt T-Shirt and the QtCentre paper of the Qt Centre Programming Contest.


Thanks to Giovanni Bajo and Develer, for the opportunity.

Sunday, November 1, 2009

OpenGL: Walk Around Camera

Again, another week spent on OpenGL. I don't know why but I cannot stop to experiment with Meshes, Vertexes, Faces and Textures. It's too amusing! But Todays, post it's just an update of GLData, the small gl data library that I use for my experiments.

The new features, for this update are: Speed-up in GL throughput, and Camera. I've adjusted data structure to use directly glVertexPointer() and related gl*Pointer() functions. The main.c file was adjusted to handle direction keys (Up, Down, Left, Right) to allows you to walk in your 3d world, like any First-Person shooter video game.

You can download the GLData Walk Around Source Code it. (Mesh not Included)

PS: For my Qt followers, and for those which they are waiting for my File-System/Distributed Computational System: I haven't forget Qt and the lovely memset(); I'm just exploring a bit (give me some week), a world that I've completely ignored.