to decide on completely overhauling my multi-user authoring project with a brand new concept, all from scratch. but it’ll definitely be worth it in the end.
i don’t know. i just wasn’t digging the entire “spiral” interface. it was becoming too bland for me. one search bar where you input a keyword and return results from both youtube and flickr in a sort of dna/helix shape? that was the best i could come up with?
well my designer’s block finally cleared a path for that project and i will be working on something completely new and fresh. something with twitter and perhaps flickr. something that i can integrate into my phidgets touch panel project for next quarter. interface screens will be posted soon, hopefully by week eight.
anyways, check out the project here. first 20 placeholders should be populated with flickr images. i’ve commented my code with some pointers if you want to give the experiment a shot. you can check out the code below:
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var planes:Array = new Array;
var currentPlane:int = 0;
//youtube strand
var con:MovieClip = new MovieClip();
con.x = stage.stageWidth/2;
con.y = stage.stageHeight/2;
addChild(con);
var scene:Scene3D = new Scene3D(con);
var cam:Camera3D = new Camera3D();
cam.zoom = 4;
var pc:Plane = new Plane();
pc.visible = false;
cam.target = pc;
var num:int = 100;
var numOfRotations:Number = 6;
var anglePer:Number = ((Math.PI*2) * numOfRotations) / num;
var yPos:Number = 0;
var pa:Array = new Array();
var cm:BitmapAssetMaterial = new BitmapAssetMaterial("youtube");
cm.oneSide = true;
for(var i:uint=0; i<num ; i++)
{
var p:Plane = new Plane(cm, 100, 100);
p.x = Math.cos(i * anglePer) * 550;
p.z = Math.sin(i * anglePer) * 550;
p.y = yPos += 35;
p.rotationY = (-i*anglePer) * (180/Math.PI) + 270;
scene.addChild(p);
}
addEventListener(Event.ENTER_FRAME, render);
var angle:Number = 0;
function render(e:Event):void
{
var dist:Number = ((stage.mouseY) - stage.stageHeight * 0.5) * -0.3;
var dist2:Number = ((stage.mouseX) - stage.stageWidth * 0.5) * 0.0003;
//these are the speed values for camera movement on the X and Y axis
angle += dist2;
cam.x = Math.cos(angle) * 1000;
cam.z = Math.sin(angle) * 1000;
//modify these to change the zoom of camera
cam.y += dist;
if(cam.y <369) cam.y = 369;
if(cam.y> 4755) cam.y = 4755;
pc.y = cam.y;
scene.renderCamera(cam);
}
//flickr strand
var con2:Sprite = new Sprite();
con2.x = stage.stageWidth/2;
con2.y = stage.stageHeight/2;
addChild(con2);
var scene2:Scene3D = new Scene3D(con2);
var cam2:Camera3D = new Camera3D();
cam2.zoom = 4;
var pc2:Plane = new Plane();
pc2.visible = false;
cam2.target = pc2;
var num2:int = 100;
var numOfRotations2:Number = 6;
var anglePer2:Number = ((Math.PI*2) * numOfRotations2) / num2;
var yPos2:Number = 315;
//this changes the position of the flickr elements
var pa2:Array = new Array();
var cm2:BitmapAssetMaterial = new BitmapAssetMaterial("flickr");
cm2.oneSide = true;
for(var i2:uint=0; i2<num2 ; i2++)
{
var p2:Plane = new Plane(cm2, 100, 100);
planes.push(p2);
p2.x = Math.cos(i2 * anglePer2) * 550;
p2.z = Math.sin(i2 * anglePer2) * 550;
p2.y = yPos2 += 35;
p2.rotationY = (-i2*anglePer2) * (180/Math.PI) + 270;
scene2.addChild(p2);
}
addEventListener(Event.ENTER_FRAME, render2);
var angle2:Number = 0;
function render2(e:Event):void
{
var dist2:Number = ((stage.mouseY) - stage.stageHeight * 0.5) * -0.3;
var dist22:Number = ((stage.mouseX) - stage.stageWidth * 0.5) * 0.0003;
//these are the speed values for camera movement on the X and Y axis
angle2 += dist22;
cam2.x = Math.cos(angle2) * 1000;
cam2.z = Math.sin(angle2) * 1000;
//modify these to change the zoom of camera
cam2.y += dist2;
if(cam2.y <369) cam2.y = 369;
if(cam2.y> 4755) cam2.y = 4755;
pc2.y = cam2.y;
scene2.renderCamera(cam2);
}
//con.addEventListener(MouseEvent.MOUSE_OVER, magnify);
//con2.addEventListener(MouseEvent.MOUSE_OVER, magnify);
//con.addEventListener(MouseEvent.MOUSE_OUT, shrink);
//con2.addEventListener(MouseEvent.MOUSE_OUT, shrink);
//
//function magnify(e:MouseEvent):void
//{
// cam.x = Math.cos(angle) * 700;
// cam2.z = Math.sin(angle2) * 700;
// trace("magnify");
//}
//
//function shrink(e:MouseEvent):void
//{
// cam.x = Math.cos(angle) * 1000;
// cam2.z = Math.sin(angle2) * 1000;
// trace("shrink");
//}
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
var request:URLRequest = new URLRequest("URL goes here");
var variables:URLVariables = new URLVariables();
variables.tags = "beach";
variables.format = "rss_200";
request.data = variables;
loader.load(request);
function onComplete(e:Event):void
{
var data:XML = new XML(loader.data);
var ns:Namespace = new Namespace("http://search.yahoo.com/mrss/");
var items:XMLList = data.channel.item;
for each(var item:XML in items)
{
var thumbnails:String = item.ns::thumbnail.@url;
var titles:String = item.ns::title.text();
var container:Sprite = new Sprite();
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest(thumbnails);
loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
// this lets the loader fully load the images first
loader.load(request);
}
}
function onInit(e:Event):void
{
var container:Sprite = new Sprite();
var image:Bitmap = e.target.content;
var data:BitmapData = image.bitmapData;
var material:BitmapMaterial = new BitmapMaterial(data);
Plane(planes[currentPlane]).material = material;
currentPlane++;
}
Related posts: