« Ihtoa socket server. | Main | MX 2004 listo para probar. »
September 01, 2003, 04:44 PM
de curvas senoidales.
estaba jugando con los valores del seno según van aumentando los grados y me salió esto.
this.angle = 0; this.onEnterFrame = function (){ y = Math.sin(this.angle * (Math.PI/180)) * 50; y2 = Math.sin((-this.angle) * (Math.PI/180)) * 50; this.createEmptyMovieClip("t",1) t.beginFill(0x336699,20) t.curveTo(50, y,100,0) t.curveTo(150, y2,200,0) t.endFill(); this.angle +=5; }
luego me parececió que se vería bonito en un círculo...
tengo que cambiar las coordenadas de dibujo para "cambiar" el centro
for( var n = 0; n < 72; n++){ var clip = this.createEmptyMovieClip("c" + (depth++),depth) clip._x = clip._y = 100; clip._rotation = mainAngle; mainAngle += 5; clip.angle = 0; clip.onEnterFrame = function (){ y = Math.sin(this.angle * (Math.PI/180)) * 50; y2 = Math.sin((-this.angle) * (Math.PI/180)) * 50; var t = this.createEmptyMovieClip("t",1) t.beginFill(0x336699,20) t.moveTo(-100,0) t.curveTo(-50, y,0,0) t.curveTo(50, y2,100,0) t.endFill(); this.angle +=5; } }
bueno, marea pero se ve bonito.
y si cuando se cierra lo hago que cambie de color?
debo tener un "espia" que me esté revisando ( no vale la pena tener a 72 soplones, en este caso con uno basta, que sea mister c0)
randomcolor = function() { var r = Math.floor(Math.random()*255)+1; var g = Math.floor(Math.random()*255)+1; var b = Math.floor(Math.random()*255)+1; return (r << 16 | g << 8 | b); }; setColor = function (){ _global.myColor = randomcolor(); } setColor() create = function (){ y = Math.sin(this.angle * (Math.PI/180))*50; y2 = Math.sin((-this.angle) * (Math.PI/180))*50; var t = this.createEmptyMovieClip("t",1) t.beginFill(_global.myColor,10) t.moveTo(-100,0) t.curveTo(-50, y,0,0) t.curveTo(50, y2,100,0) t.endFill(); this.angle +=5; } createB = function (){ y = Math.sin(this.angle * (Math.PI/180))*50; y2 = Math.sin((-this.angle) * (Math.PI/180))*50; var t = this.createEmptyMovieClip("t",1) t.beginFill(_global.myColor,10) t.moveTo(-100,0) t.curveTo(-50, y,0,0) t.curveTo(50, y2,100,0) t.endFill(); this.angle +=5; if( !(this.angle % 180)){ _root.setColor(); } } for( var n = 0; n < 72; n++){ var clip = this.createEmptyMovieClip("c" + n,depth++) clip._x = clip._y = 100; clip._rotation = mainAngle; mainAngle += 5; clip.angle = 0; if ( n == 0){ clip.onEnterFrame = createB; }else{ clip.onEnterFrame = create; } }
si se hace a 24 fps se vé bonito.
en mac no creo que corra por mucho tiempo =D
si no sabes que hacer, copia y pega en las acciones de un frame en una película nueva.
salu2
Posted by kada
Comentarios
1Fernando , (September 1, 2003 05:08 PM):
jajajaja!! que cool se ve! :D:D:D:D
En verdad se ve bastante bien :)
Salu2
2sangles , (September 1, 2003 10:46 PM):
Luego viene el primo hermano del seno, coseno que desfaza 90 grados
this.angle = 0; this.createEmptyMovieClip("cube",0); this.cube.lineStyle(1,0x000000,100); this.cube.moveTo(-5,0); this.cube.lineTo(5,0); this.cube.moveTo(0,-5); this.cube.lineTo(0,5); this.onEnterFrame = function (){ this.cube._x = Math.sin(this.angle * (Math.PI/180)) * 50; this.cube._y = Math.cos(this.angle * (Math.PI/180)) * 50; this.angle +=5; }
y asi podemos seguir
3Alejandro , (September 2, 2003 07:11 AM):
Excelente te felicito.
(Tucuman) Argentina
4Tmeister , (September 3, 2003 01:38 PM):
Vamo´a ver....
Partiendo de la formula para crear un Circulo que es esta:
cont = createEmptyMovieClip("c", 10); this.onEnterFrame = function() { x = 50*Math.sin(a++*.1); y = 50*Math.cos(n++*.1); cont.createEmptyMovieClip("mc", 1); cont.lineStyle(1, 0x000099, 20); cont.lineTo(x, y); cont._x = 200 cont._y = 200 };
jugamos con lo valores para crear una espiral no exacta pero el efecto se ve bien y mas uan si le agragamos rotacion algo asi......
cont = createEmptyMovieClip("c", 10); this.onEnterFrame = function() { b -= 0.1; x = b*Math.sin(a++*.8); y = b*Math.cos(n++*.8); cont.createEmptyMovieClip("mc", 1); cont.lineStyle(1, 0x000099, 20); cont.lineTo(x, y); cont._x = 200 cont._y = 200 cont._rotation += 10 };
Ahora Jugando mas con las Coordenadas creamos un circulo por medio de lineas que crean formas geometricas....
Esto es por medio de un Triangulo
cont = createEmptyMovieClip("c", 10); this.onEnterFrame = function() { x = 50*Math.sin(a++*4.179); y = 50*Math.cos(n++*4.179); cont.createEmptyMovieClip("mc", 1); cont.lineStyle(1, 0x0099FF, 20); cont.lineTo(x, y); cont._x = 200; cont._y = 200; };
este ultimo se ve mejor con fondo Negro...
Bueno hasta aqui me quedo....
Enjoy
Saludos!! 8)


