Sunday, 7 March 2010
Tower Bridge Panorama in Maya
Thought I'd have a go with Maya this weekend and update some of my Panoramas. Since the Quicktime player isn't everyone's cup of tea (though I'm told there are some cool Flash ones!) I figured it was time to get busy with Maya and create some videos. Generally, the idea is to create a sphere, texture map it, then create a path for a camera object. Once that's done, you export all the JPG shots using Maya hardware and combine them back using something like Quicktime Pro (mencoder didn't work so well sadly). The result is what you see here. Not bad for a first attempt though I suspect my trusty D100 needs a clean.
Maya is a bit of a pain in the arse to use on a Mac I've noticed but the new Blender is looking mighty fine and I'm thinking thats the way forward as it seems they've ditched their utterly pants UI. Good job guys!
Sunday, 28 February 2010
NIN 'Only' Tribute
The best band in the world? For me, certainly. Trent Reznor has had a massive influence on me and the work that I do and it was high time that I got around to making this little experiment. I wanted to work on my shader, graphics and OpenCV computer vision skills and what better way than to try to recreate the NIN Video 'Only'.
The idea is to create a depth map from the brightness of the pixels taken from the camera and then to map these depths to a pin board in real-time. I'd chosen OpenFrameworks as the basis for this as it runs in C++ and contains all the libraries required. To begin with though, I created a couple of tests in both Pyglet and PyGame; two Python libraries that allowed loading of GLSL Shaders and models.
Modelling a pin was quite easy using the free tool, Blender. Although Blender's interface is very hard to learn, the program is fully featured and getting a good object was quite easy. Sadly, however, the OBJ format for 3D objects isn't very robust and doesn't translate well over applications. So, in order to sort this out I settled for 3DS format and managed to find a very good library for OpenFrameworks apps.
Secondly, I need to get hold of some base code to load GLSL Shaders in OpenFrameworks Apps. Fortunately, there exists such a wrapper. Creating a basic Phong Shader is quite easy and with that, the shiny pins could be drawn.
OpenCV has long been a staple of the OF community, so linking that in and processing the video was not hard. Experimenting to get the best results was the trickiest bit of the whole project and I think, there could still be some work to do. Basically, we create a greyscale image, contour it with some threshold value and then create a set of blobs. We then use the original pixel values from the camera with some added background learning algorithm to reduce the background noise. I used a sheet of black material behind me so that I culd get rid of even more noise and the results turned out to be quite good.
Finally, I tried adding some shadows. This was trickier than I thought. OpenGL under OF has some issues, the first being the rather weird scaling factor. The light is several thousand world units away from the scene which means that the accuracy of the Shadow Mapping algorithm is not so good. Also, it appears that anything outside the frustum is classed as 'in-shadow' naturally enough. Using a variant of GL_CLAMP with a white texture border and a blend mode of multiply, managed to alleviate this problem; anything outside the shadow map gets blending with a white texture and therefore is not affected but there still appears to be one or two artefacts here and there.
Nontheless, overall I am quite pleased with the result and there will certainly be more to come!
Sunday, 14 February 2010
Cinema4D meets After Effects
A good combination these two. I've been plugging away at a new ident as I've wanted to relearn a lot of 3D and how such lovely scenes are created. I'm considering a new ident and here is the first stab at it.
Sadly, Vimeo has warped my HD resolution image so it looks a bit odd annoyingly. Nevertheless, its a good start. Different camera angles, different HDRI, lens effects, vignettes and motion blurs need adding. Early days yet but really enjoying it! :D
Sadly, Vimeo has warped my HD resolution image so it looks a bit odd annoyingly. Nevertheless, its a good start. Different camera angles, different HDRI, lens effects, vignettes and motion blurs need adding. Early days yet but really enjoying it! :D
Saturday, 6 February 2010
FTIR Table Progress Part 2
During the Xmas holidays, I began construction on the cabinet with my Dad and had a lot of fun doing it. I left it in his capable hands for painting, sanding, and the installation of the interior frame and handles. Here is the result. Looks rather awesome. The height is important as one needs to make sure the camera can see the entire top of the box. Also, there needs to be space for the various electronics that will be installed in the bottom along with a 4 Gang. the height is also just about right for the table to be used standing.
Here is the EyeToy. I used the PS3 eyetoy as it came recommended by the guys on the NUIGroup Forums. It runs at 640x480 at 30fps, has two aperture settings and space for a filter. There is a problem with removing the infrared filter. Most cameras have one and you need to remove it. On my cheap logitech this was easy because it was simply a piece of plastic that fell out. With the Eyetoy, it's a piece of ground glass, set into the plastic. You need to gouge it out and be careful with it too as the lens is right behind it! There is a good video here on how to do this.
You need to get a filter that matches your LEDs. In my case, I bought a small 880nm filter from eBay. I can't remember the guys name but if you search on eBay you'll find a guy in the states who sells these small, round filters for this exact purpose. It works really well. Once you've put that in, you are ready to go.
The PS3 sits on top of the light that came with the LCD panel. Since this light was obviously right next to the LCD itself, you need to extend the cables that come from this light using solder and some extra wire. It is important that when you take apart the panel, you remember which plug goes where. Take photos at every stage!
Here are the innards of the LCD Panel. Some of the wires needed extending also as they tend to be jam packed inside the original Dell Case. They are mounted on some wood except for the light's power supply which I have yet to attach. The more recessed you can make these the better as they will show up on the screen if you don't which makes the effect a bit naff.
On the left, you can see the wires that go up to the LED arrays. You need to link these to an adaptor. Check out old mobile phone chargers as they are dead handy for this sort of thing. For my circuit, I needed a 5V supply capable of around 1.5 amps. I managed to find a charger that did 5V and up to 2 Amps which turned out to be perfect.
This photo shows the annoying, overlapping PCBs that fall on both sides of this LCD screen. This means that about an inch from two sides of the LCD panel are obscured which is very annoying. The only thing stopping this from being fixed is the current configuration of the box and the small L shaped plastic track that links the two PCBs together. If I could get a longer, flat plastic cable I'd be in business. At the moment, it doesn't affect things to much to be fair but it makes calibration with the NUIGroup tool impossible at present. I'll aim to sort it manually.
Here is the top of the table with the lid attached. Looks good no? The plastic came from a place called Barkstons in Leeds. You need to go to their "plastic people" / yellow site as they will do decent perspex cut to any size you like for a decent price, delivered. Make sure you go for at least 8mm (I used 8mm) and have the edges polished. At first I was unsure whether or not this would make a decent wave guide but it appears that it does.
Lots of people talk about Endlighten and other fancy perspex, or a compliant surface made of silicon. I've had no problems with this cheap stuff and ordered two pieces in case one was damaged. Its still all good.
PS. Ignore the thing on the top left of the photo! :D
With the lid off, you can see the LED arrays. They are arranged on the aluminium frames and connected together. The circuit was designed with the help of this handy calculator. Some people link the whole thing up in parallel; indeed, I did this for the first mini table. The problem with that is that it uses a lot of power and needs a heavy resistor. All you need to know is this:
V = I x R
Yup, that good old equation. Checking the RS Data sheet for my LEDs I found that each one requires 100mA and drops 1.5V. That means, with a 5V supply, we can only have a maximum of 3 LEDs in series (1.5 x 3 = 4.5V). Now, to get 100mA over each one we do some maths. V = I x R . Rearrange to get V / I = R . Substitute the numbers: 0.5 / 0.1 = 5 Ohms. What did we do here? Well, we need to go from 5V, down to 0V after going through 3 LEDs. Since each LED drops 1.5, we are left with half a volt to sort out and 100mA of current to send. So 0.5 / 0.1 = 5 Ohms. The closest rated is 5.6 Ohms and you can buy these cheap from either Farnell or RS Components.
I managed to get my Mum, who is a much better solderer than me to do this bit! :P Shrink sleeving and everything. A quality job well done.
You can get a better view of the internals here. You can see that the LEDs line up quite well with the perspex and that is indeed the trick. With all that done, you need to power it up and grab the software from the NUIGroup and play till your hearts content.
This project was a lot of fun and it still isn't over. There are a few funky things I'd like to add, though I need to do some boring things like putting the shelf in and calibrating the screen but there are many other things in the pipeline.
Total costings:
Bandpass Filter from Ebay: £15.17
54 LEDs from RS: £22.46
Perspex Sheets from Barkston - £31.68
MDF, Aluminium Track, Hinges, Drill-bit, Handles - £23.58
Maplin Wire and Solder - £12
RS Components Resistors - £8
PS3 EyeToy from eBay - £20.51
Grand Total: £133.40p
Of course, I had to scrounge the LCD panel and there is no mac mini involved but damn, its cheap! :D
Overall, it was hard to get solid answers on certain questions like "Is this a good wave guide?", "Is the infrared leaking?", "exactly how good is the eyetoy with this?" etc etc. Generally, the best advice is just go for it with the guides and providers I've mentioned and you can't go far wrong. I guess I got lucky with the plastics and the spacings of the LEDs and the filters etc, but generally, it doesn't seem too hard to get a good result.
But of course, no tutorial would be complete without a proper video showing some funky touch software:
Some Resources
The VIRTTable. If you look at no other page, you should definitely check this guy out.
Hak5 On Multitouch. A good overview though they don't go into specifics as they are keeping it hush hush for business purposes (which I've just blown I guess! :S)
Todd Vanderlin's Table - He doesnt give much away but its a good link
Monday, 1 February 2010
Decode09 - Recode Entry
Recode : Decode Entry - In the Style of Aha's "Take on Me" from Benjamin Blundell on Vimeo.
Really, there was absolutely no reason for me not to enter this compo. In fact, I've had a few more ideas since. Processing is a good little language to play in and the original code is quite a joy to play with. I figured learning a little about a "Sketch" renderer was a good idea. I must admit, there are some impressive Sketch Shaders out there. I settled for using the NPR Quake one. I hope this makes it onto the Underground. If you are in London and you see this being shown on a projector, let me know!
Wednesday, 27 January 2010
Anyone into iPhones and Google Maps?
I've created a small application that will read your Google My Maps direct from Google and onto a map on your iPhone. It was a test and a learning curve for Objective-C and iPhone development. I've attempted to get it into the iPhone store but with little success. It works ok for me but there are still some bugs according to Apple. Nonetheless, I think it might be helpful for some people out there so I've uploaded it to Bitbucket. You can check it out here
Saturday, 23 January 2010
Web Controlled Securi-Webcam
Web controlled, 2 Axis Camera from Benjamin Blundell on Vimeo.
It's taken a while but finally, my little webcam project is done. It was quite a long process and I learnt a lot about streaming media. At the moment, a Java applet is listening to a stream being sent via a small daemon process called webcam-server on my Ubuntu box. In order to control the servos a totally different line of processing occurs with Python and mod_wsgi. Both the servo controls and applet run on top of Apache2 with some HTTPS support to keep undesirables out. Fun times indeed!
Subscribe to:
Posts (Atom)
