Thursday, July 31, 2008

Rotating cubes.

A couple of days ago I got 3 LIS3LV02DQ accelerometers from Sparkfun electronics.
Today I finished a working demo showing a cube that rotates as you rotate the device.
This accelerometer has some good documentation to learn how to use it. There is also a post in some blog with a specific example for the arduino.
That example didn't work for me, but when I wasn't sure about something, it did help to take a peek at it. Reading the datasheet carefully is extremely important.
The arduino has built-in SPI support, which helps a lot since the accelerometer uses SPI (or I^2C) to communicate. However, it is bound to 4 specific pins in the board, and if I'm going to use the 3 accelerometers at the same time without any additional hardware, I am going to have to write a software implementation, since I would be using 12 pins.
The interface to the arduino was written in C++. It uses libSerial, which makes communicating with the arduino almost as trivial as when using Python.




Wednesday, July 9, 2008

Arduino board.

(This devlog used to be on livejournal, but I moved all the entries to blogger using a program I found on the web.)

My new arduino board got delivered today =D. I spent a part of the day doing some electronics experiments. I assassinated my RC Helicopter and a personal fan in order to use their motors. Unfortunately they are not strong enough for my future plans (making an autonomous copter). Turning some LED's on and off was fun for a while too =P.

It's got a nice development environment (it uses a derivative of the C language), but I think I'll be happier using Emacs.

Before it arrived I was starting to incorporate Framebuffer objects into pycave, my little python game. Turns out they're pretty easy to use, and also elegant. The specification is available online and they're a couple of pdf's floating around the web. I'll be using them to improve the shadow effects, and to make them faster.
A couple of days ago I made a model and texture for the ship that according to me looked pretty nice. That hasn't been the general opinion =P
I am also aching to start writing shaders. However, I think that pyCave will stay with a fixed-function pipeline.

CUDA is another thing I would love to get my hands dirty with, but making killer robots is just a bit more interesting right now. Tomorrow I will order some motors (and actuators?) to start doing fun stuff!

I have left the ray tracer alone for now. I do plan to finish it. It's a really basic ray tracer so it shouldn't take long. I have also been gaming a bit too much, I got Call of Duty 4 and it's a kick ass game.

These vacations haven't been as productive as I hoped, since I went on an unexpected trip to the US. But I'm going to squeeze as much time as I can (and as much as COD4 does not take from me) to program =). I will also be managing my time better next semester in order to not be so stagnant.

Saturday, July 5, 2008

SFCave clone update

Last night I didn't sleep since I was at a lan party, so I made a lot of mistakes this morning while working on my little game. I wrote some sprite code to show smoke, after creating a sprite doing some photo-editing in gimp. Then I made a separate display list for the tunnel obstacles so they can cast shadows on the tunnel.
I think it is looking really cool now, so I uploaded a video to YouTube, here it is:



I am still going to put the video on pyCave's website.