
I call it Studio Vibe. It shows off quite a bit of functionality I've been able to create. The main technology here being an algorithm to determine the main color of any dynamically loaded image. It then creates a pretty studio like background that inherits the loaded images main color.
My good friend Josh Pate helped me out a lot by telling me what functionality was good to leave or take out after I had round 1 finished.
This is using Papervision 3D of course, to accomplish the 3d effects you see going on with the camera. The application also uses my bitmapSlicer class, you can see demonstrated whenever you click on the picture, each papervision plane rotates on the x-axis.
The tricky part was resizing the Papervision planes when I load an image of a different size. I had to actually tween each planes verticies to stretch or shrink them to the appropriate size and constantly update the bitmapMaterial while doing so.
It was a bit more math than I had hoped, but I was able to figure it out:)
The images are all images I've taken myself and done some post processing in photoshop. You can find my images at my flickr page.
This Studio Vibe application serves best as a concept image gallery. I'd be glad to sell one to anyone who's interested:)
Now for some code
//I was able to get really close without googling for help
but thanks to blog.soulwire.co.uk for some missing pieces!
//this part finds the median hex color value of any image
public function get_median_hex(bd:BitmapData):uint{
var pixelValue:uint;
var red:Number = 0;
var green:Number = 0;
var blue:Number = 0;
var count:Number = 0;
for (var i:int = 0; i < int =" 0;" pixelvalue =" bd.getPixel(j,">> 16 & 0xFF;
green += pixelValue >> 8 & 0xFF;
blue += pixelValue & 0xFF;
count++;
}
}
red /= count;
green /= count;
blue /= count;
return red << update =" true;" number =" (slices[0].width" number =" (slices[0].height" int =" 1;" number =" -(loaded_content.width" number =" (loaded_content.height" vertex3d =" p.geometry.vertices[0];" vertex3d =" p.geometry.vertices[1];" vertex3d =" p.geometry.vertices[2];" vertex3d =" p.geometry.vertices[3];" vertex3d =" (p.getChildByName(" vertex3d =" (p.getChildByName(" vertex3d =" (p.getChildByName(" vertex3d =" (p.getChildByName(" index ="=""> 1 && index % num_sections == 0) {
yPos -= slices[0].height;
xPos = -(loaded_content.width / 2) + ((loaded_content.width/num_sections)/2);
}
index++;
}
}
0 comments:
Post a Comment