I did a couple pv3d tutorials and learned how to make a skybox! I’m not going to go in-depth about how it was coded, but I’ll post the source code ( HERE ).
I think the most interesting concept i learned in this project was this bit of code:
for each(var vertex : Vertex3D in sphere.geometry.vertices){
It iterates through each vertex on a 3D object, gives us its position in 3D space. I think my next project is going to explore the possibilities of this – probably by importing a 3D model and using it to position a bunch of particles (or even 3D objects). This is really cool because it gives us the ability to create and change the texture of an object on the fly.
Songs used:
Wax Tailor – The Tune
Boom Bip – The Unthinkable ft. Buck 65 ( remixed by the Venetian Snares )
I’ve always been interested in using sound to control visual properties of objects, but I’ve never touched it until now.
Check out my visualizer ( THE DANCE MAGNET ) and then we’ll get into how it works. It might take a few seconds to load the song – be patient.
If you’re on a dinky computer, that version might be kinda heavy. Here’s a dinky version.
The first step is putting some objects on the stage that you want to control. I chose to do this with a for loop, like this:
for (var i:int = 0; i < 20; i++){
var bar:barComponent = new barComponent();
bar.x = (Math.random()*21) - 10;
bar.y = (Math.random()*21) - 10;
theGroup.addElement( bar );
bar.addEventListener(Event.ENTER_FRAME, myBarClass.moveByFreq);
}
The bar.x and bar.y serve to randomize the placement of the objects by 20 pixels in any direction. This is optional.
theGroup is the ID of my flex group, and I'm adding all of my objects into it so that I can position everything in the middle of the screen.
Lastly, I'm adding an event listener to each object that runs a function every frame. This function exists in a class ( myBarClass ) and is called moveByFreq. You'll need to create a variable to hold the class so that you can use its functions.
var myBarClass:BarClass = new BarClass();
THIS IS WHERE THE MAGIC HAPPENS. Here's what's in the class:
var sound:Sound = new Sound();
var channel:SoundChannel = new SoundChannel();
var theVolume:SoundTransform = new SoundTransform(0.5);
var ba:ByteArray = new ByteArray();
public function BarFlower()
{
sound.addEventListener(Event.COMPLETE, startSound);
sound.load(new URLRequest("http://positlabs.com/files/danceMagnet2/iccthedral.mp3"));
}
public function startSound(e:Event):void
{
channel = sound.play(0, 2, theVolume);
}
public function moveByFreq(e:Event):void
{
SoundMixer.computeSpectrum(ba, true);
var t:Number = ba.readFloat();
var xTarget:Number = e.target.x + ((Math.random() * 21) - 10) * t;
var yTarget:Number = e.target.y + ((Math.random() * 21) - 10) * t;
var rotTarget:Number = -xTarget/2;
I'm not going over how to load and play sounds - Look at the moveByFreq function.
1. SoundMixer.computeSpectrum takes a snapshot of all 512 frequency values (256 for left and right channels) and puts them into an array. These values will range from 0 to 1, I think.
2. Then we read the first value in the array and assign it to a variable. This is the lowest frequency, so we'll use it to respond to the bass in the song.
3. The target position of the object is randomized (-10 to 10 pixels from its current position), then multiplied by the amplitude of the bass.
4. By making a relationship between the objects x position and rotation, we get this nice magnetic field effect. This was a total accident, but it pays to play with your numbers.
5. I had to constrain the rotation to less than 180 degrees. Otherwise, the objects spin wildly.
6. The last bit is a tweening engine called TweenLite. Check it out if you're not familiar. It's super handy.
I have the source files up if you want to take a look at them. Also, I put up the flash builder project file for the lite version of the visualizer. Some of the names don't reflect what the objects / variables / classes actually are. I started this project just by messing around in flex, and this is where i ended up. Anyway, the source code is super messy. I recommend grabbing the FXP.
My latest project is the development of a 3-D point-tracking system that will let users interact with objects in virtual 3-D space. My first application for the system is going to be a simple 3-D drawing app.
Lately, I’ve been messing around with getting outputs from Wii remotes. This seems like it’s going to be the best method for developing this system because the wiiMote provides such a wide variety of outputs: 12 mappable buttons, pitch, yaw, accelerometers, and most importantly – the infrared camera.
The other up-side to using wiiMotes is that so many people already own them. This will cut costs and hopefully encourage more widespread use and development of the system.
The Proposed Materials
2 Wii Remotes – $35 each
Bluetooth Reciever – $8 (macs and some laptops have this built-in)
Infrared LED pen – $8
5-foot Tripod – $50
Here are some links to some useful Wiimote downloadables:
WiiFlash
Actionscript 3 API. Sends Wiimote outputs to flash!
GlovePIE
Easy button-mapping with the C programming language! If you have the Wii Motion Plus, it comes with a script for a pretty nice gyration air-mouse. It’s so nice that I’m considering replacing my regular mouse with this. (If you want to download this program, click “I already have 100% green power”)
SmoothBoard
This program tracks an IR LED pen and maps it to your display. It was originally intended for projections, but you can use it on monitors too.
—————————–
Sony is coming out with a really elegant solution to 3-D point-tracking: PlayStation Move
It only needs one camera because of the way it interprets depth. The size of the lighted ball tells the system how far away the user is. Genius! However, I don’t think this would work as well for personal computing as it will for a game system.
1. The balls use visible wave-length colors, which means it won’t allow the camera to be pointed at the display because it might get confused about which colored shape is supposed to be tracked.
2. The ball would need to be significantly smaller so that it wouldn’t obstruct the users view of the objects being manipulated.
2a. This probably means decreased accuracy in depth-sensing because the dynamic range of the ball-size would be decreased.
Using a high-definition, wide viewing-angle camera that looks at the user (as opposed to the screen) might solve some of these problems, but it would limit how close the ball could get to the screen…unless it’s a camera with 180 degree viewing angle.
Anyway, I think it’s a great system for interactions at a distance, but I don’t think it’s the right fit for detail-oriented work.
I’ve been planning on getting into photomicrography for a while now, and this mini-vacation gave me some time to do it. I wasn’t sure if it was going to work without a new eyepiece, and I thought I might have to buy a new camera lens – one with a shorter focal length.
Anyway, it ended up working with my current set of equipment, so I’m happy. I may eventually buy new lenses and stuff so that I can get crisper photos. Right now it’s kind of a pain to focus on slides at high-magnification because i have to manually position the camera for every shot. It’d be nice to have something to screw the lens into.
I thought it might be difficult to get a clear picture by manually positioning the camera, so I set up a tripod and took photos with the intention of merging them into a High Dynamic Range (HDR) image. By doing this, I captured all the details in the shadows AND highlights, without compromise.
If you’re interested in photomicroscopy but you don’t feel like dropping a grand on equipment, check out these links:
Last night I was trying to make a 3D gridded cube in illustrator, but I couldn’t figure out how to do it without spending too much time on it. Kelsey kidnapped me from the project, and we watched the newest episode of the office (which was really funny, btw), so I put the project down for the night.
9AM the next morning, I decided to have a look at what the new edition of illustrator had to offer. Lynda.com is free to SCAD students, so I went there for some tutorials.
TWENTY-FOUR SECONDS into the first illustrator video, and I had my solution. It’s the perspective grid tool. EXACTLY WHAT I NEEDED!!!
Anyway, there’s no doubt that CS5 will continue to blow me away. I’m going to watch past the 24 second marker now…
I got NeuroSky’s MindSet a few weeks back. Here are some thoughts on it:
1. It’s $200, but most of what you’re paying for isn’t the brainwave sensor. The sensor itself only costs about $15. The rest of your money goes toward a bluetooth transmitter / reciever, high quality headphones, and a built-in microphone.
2.The bluetooth transmitter is the only way you can get the MindSet to communicate with your computer. No USB (it plugs in, but it’s only for charging)! This is a problem if you have a tower that’s tucked away some place that hinders the bluetooth signal. I can’t listen to music from my desktop because the signal isn’t strong enough! WTH?!
3. It’s a lot of fun to show people what it can do, but I’ve had difficulties switching from person to person. Earrings seem to screw up the signal, but even without them it’s hard to get the MindSet adjusted to a new person. It might just be that they don’t know how it should feel when they wear it. I’m not really sure…
4. The MindSet is a lot of fun to play with, but there doesn’t seem to be any truly useful applications for it yet. I’m hoping to remedy this, but I think its real potential is in a multi-device collaboration. I suppose it could be useful for market research stuff, but that’s not what I want to do with it. I want it to be a controller, not a recorder.
5. Code libraries are free for independent developers! I haven’t looked into it yet, but NeuroSky says that it’s a limited version of their licensed development kit (which costs $10k if I remember correctly).
I’ve been thinking about developing new drawing techniques with new technology. I think having an eye-tracking system in addition to the neurosky MindSet would make for some good times. There are some DIY eye-tracking tutorials out there, but I really want to know how much the scientific-grade models cost.
Ok – so I did some searching, and it looks like this stuff is pretty far out of my price-range
( $7500+ ).
There are a few companies out there that are making dry-sensor USB brainwave headsets: NeuroSky, OCZ, and Emotiv are the ones that I know about. Actually I’m not sure that OCZ’s product is dry-sensor, but anyway, I broke down and ordered one of NeuroSky’s MindSets. They cost $200, but I think it’s a good investment.
The MindSet seems like it could be really amazing, but there aren’t very many uses for it, currently. I mean, you can play NeuroBoy or one of the other apps from the NeuroSky store. That’s cool, but there are only a measly 12 apps available (the up-side is that nine of them are free).
So, the reason I justified spending $200 on this toy is that the NeuroSky development kit is free for independent developers. Their code libraries are on their website, and they have a forum for troubleshooting development snags. They have code libraries for C/C++, C#, ActionScript 3, Java, Max/MSP, and others. There are also some tutorials on how to connect it to Arduino, meaning that you can potentially control anything mechanical with the MindSet.
The MindSet can output a bluetooth signal, so it can communicate with laptops, iThings, and cars…and any other kind of bluetooth device you can think of.
I’m getting a head start on it, but this is going to be my first project after I graduate from SCAD. To start, I’ll make a simple drawing and painting program. I’m not sure how easy it will be to control a cursor with my mind, but I was thinking about looking into some eye-tracking hardware.