| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| habs vergessen Registriert seit: Feb 2006
Beiträge: 990
| [stuff] 2.5D Motion Ring
Tach zusammen, und hier ein weiterer Script-Schnipsel aus meiner AS3 Sound Visualising Demo für zum ´rumspielen. Das ganze schnell auf AS2 umgestellt, damit das hier auch am richtigen Fleck gepostet ist! Viel Spaß damit - und Feedback ist wie immer sehr willkommen! =) ansehen source-fla ziehen zum schnell ´drübergucken: Code:
/////////////////////////////////////////////////////
// fluid circular motions
// author : frank reitberger
// site : http://www.dasprinzip.com
// copyright 2007
/////////////////////////////////////////////////////
// --------------------------------------------------------------------------------------------------
stop();
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// import flash filter classes
///////////////////////////////////
import flash.display.BitmapData;
import flash.filters.*;
import flash.geom.*;
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// setup fluid circular global vars
///////////////////////////////////
var obj_array:Array = new Array();
var zIndex:Number = 0;
this._lockroot = true;
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// configure canvas
///////////////////////////////////
function initStage() {
efxStage = new BitmapData(Stage.width, Stage.height, true, 0x00FFFFFF);
createEmptyMovieClip("efxClip", _root.getNextHighestDepth());
this["efxClip"].attachBitmap(efxStage, _root.getNextHighestDepth());
paint(efxStage);
}
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// paint fluid circular
///////////////////////////////////
function paint(bmp) {
var i:Number=151;
while(i>0) {
i--;
var px:Object = new Object();
px.x;
px.y;
obj_array.push(px);
}
var p:Number=101;
while(p>51) {
p--;
obj_array[p].x = 250 + 90*Math.sin(0.1257*p);
}
var p:Number=151;
while(p>101) {
p--;
obj_array[p].y = 100 + 90*Math.cos(0.1257*p);
}
_root.onEnterFrame = function() {
var p:Number = 51;
while(p>0) {
p--;
obj_array[p].x = 250 + 90 * Math.sin(zIndex + 0.1257 * p);
obj_array[p].y = 100 + 90 * Math.cos(zIndex + 0.1257 * p);
bmp.setPixel32( obj_array[p].x , obj_array[p].y , 0xffffffff );
}
var p:Number = 101;
while(p>51) {
p--;
obj_array[p].y = 100 + 90*Math.cos(0.1257*p)*Math.sin(zIndex);
bmp.setPixel32( obj_array[p].x , obj_array[p].y , 0xffffffff );
}
var p:Number = 151;
while(p>101) {
p--;
obj_array[p].x = 250 + 90*Math.sin(0.1257*p)*Math.sin(zIndex);
bmp.setPixel32( obj_array[p].x , obj_array[p].y , 0xffffffff );
}
_root.efxStage.colorTransform(_root.efxStage.rectangle, new ColorTransform(1, 1, 1, 1, 1, -1, -1,-1));
_root.efxStage.applyFilter(_root.efxStage, _root.efxStage.rectangle, new Point(0, 0), new BlurFilter(2, 2, 1));
zIndex = zIndex - 0.02;
}
}
initStage(); pwd |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |