Counter: 0, today: 0, yesterday: 0

FrontPage




akita?


kazushi?
int ad = (sx + x) * (sy + dy) * 16;
int ad = (sx + x) + (sy + y) * 16;

//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------

#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules
#include <math.h>

#define W 16  //ROW
#define H 16  //COL

void raiseWave(int, int);
void ripple();

char array1[W*H];
char array2[W*H];
char* data;
char *a1, *a2, *at;

void main()
{
	//initialize
	for(int i=0; i<W*H; i++)
	{
		array1[i] = 0;
		array2[i] = 0;
	}
	a1 = array1;
	a2 = array2;
	data = a1;

	// ALL LED OFF
	PRT0DR = 0xFF;    

	PWM8_1_EnableInt();
	PWM8_1_Start();
	PWM8_2_Start();
	PWM8_3_Start();
	PWM8_4_Start();
	PWM8_5_Start();
	PWM8_6_Start();
	PWM8_7_Start();
	PWM8_8_Start();
	PWM8_9_Start();
	PWM8_10_Start();
	PWM8_11_Start();
	PWM8_12_Start();
	PWM8_13_Start();
	PWM8_14_Start();
	PWM8_15_Start();
	PWM8_16_Start();

	PGA_1_Start(3); // Start AMP
	PGA_2_Start(3); // Start AMP
	PGA_3_Start(3); // Start AMP
	SAR6_1_Start(3); // Start ADC
	SAR6_2_Start(3); // Start ADC
	SAR6_3_Start(3); // Start ADC

	M8C_EnableGInt;

	// main
	raiseWave(8, 8); //invoke a wave from center

	int wait_count = 10;
	int w = 0;
	while(1)
	{
		//get input value
		//char v1 = (SAR6_1_cGetSample()+32)/2; //-32 ~ +32 to 0 ~ 32
		//char v2 = (SAR6_2_cGetSample()+32)/2;
		//char v3 = (SAR6_3_cGetSample()+32)/2;
		//for(int i = 0; i < N; i++)
		//{
		//	data[i] = v1;
		//}

		if(w > wait_count){
			w = 0;
		}
		ripple();  //wide a wave	
	   	w++;
	}
}

void raiseWave(int x, int y)
{
	//set area which can make waves
	if(x < 3 || x > 13 || y < 3 || y > 13)
	{
		return;
	}

	int c = x+y*W;
	a1[c] += 16;
	a1[c-1] += 8;
	a1[c+1] += 8;
	a1[c-W] += 8;
	a1[c+W] += 8;
}


void ripple()
{
	for(int i=0; i<W*H; i++)
	{
		int x = i % W;
		int y = i / W;

		char sum = 0;
		if(x > 0)  {sum += a1[i-1];}
		if(x < W-1){sum += a1[i+1];}
		if(y > 0)  {sum += a1[i-W];}
		if(y < H-1){sum += a1[i+W];}

		//wave equation
		char v = (sum >> 1) - a2[i];

		//dissolve a wave
		v -= (v >> 3);

		//cut out of brightness and set brightness to LED
		a2[i] = v&0x1f; // 0~31
	}

	//exchange array
	at = a1;
	a1 = a2;
	a2 = at;
	data = a1;
}

int col = 0;

#pragma interrupt_handler PWM8_1_INT
void PWM8_1_INT()
{
	if(col >= 16){
		col = 0;
	}

	// ALL OFF
	PRT0DR = 0b00010000; // port0_4 = High -> G1

	// ON
	int a = col*W;
	PWM8_1_WritePulseWidth(data[a+15]);
	PWM8_2_WritePulseWidth(data[a+14]);
	PWM8_3_WritePulseWidth(data[a+13]);
	PWM8_4_WritePulseWidth(data[a+12]);
	PWM8_5_WritePulseWidth(data[a+11]);
	PWM8_6_WritePulseWidth(data[a+10]);
	PWM8_7_WritePulseWidth(data[a+9]);
	PWM8_8_WritePulseWidth(data[a+8]);
	PWM8_9_WritePulseWidth(data[a+7]);
	PWM8_10_WritePulseWidth(data[a+6]);
	PWM8_11_WritePulseWidth(data[a+5]);
	PWM8_12_WritePulseWidth(data[a+4]);
	PWM8_13_WritePulseWidth(data[a+3]);
	PWM8_14_WritePulseWidth(data[a+2]);
	PWM8_15_WritePulseWidth(data[a+1]);
	PWM8_16_WritePulseWidth(data[a]);
	PRT0DR = col;

	col++;
}



/*====================================
桦ץ
====================================*/

#include <stdio.h>
#include <math.h>

#define N 256  //LEDο

/*====================================
ȴؿ
====================================*/
void wait(unsinged long n)
{
	while(n--){} //ˤʤޤǥ롼
}


/*====================================
򵯤ؿ
====================================*/
void raiseWave(int x, int y, short *array1)
{
	int i;
	short array[N];

	for(i=0; i<N; i++)
	{
		array[i] = array1[i];
	}

	//򵯤ϰϤ
	if(x < 3 || x > 13 || y < 3 || y > 13)
	{
		return;
	}

	int sx, sy;

	//Ⱦ£礭򵯤
	for(sx=-4; sx<4; sx++)
	{
		for(sy=-4; sy<4; sy++)
		{
			double r = sx * sx + sy * sy;
			int ad = (sx + x) * (sy + dy) * 16;

			if(r < 16)
			{
				 array[ad] += (cos(sqrt(r) / 4 * pi) + 1) / 2;
			}
		}
	}
}


/*====================================
ưؿ
====================================*/
void ripple(short *array1, short *array2)
{
	int i, j;
	short led[N];

	for(i=16; i<N-16; i++)
	{
		int x = i % 16;

		//üη׻
		if(x == 0 || x == 15)
		{
			continue;
		}

		//ư
		array2[i] = ((array1[i-1] + array1[i+1] + array1[i-16] + array1[i+16]) >> 1) - array2[i];

		//ξ
		array2[i] -= (array2[i] >> 5);

		//ͤLED뤵Ѵ
		double a = array2[i] + 10;

		//LED뤵θ٤
		if(a > 15)
		{
			a = 15;
		}
		else if(a < 0)
		{
			a = 0;
		}

		//LED뤵Ϳ
		led[i] = a;

	}

	//ξ
	short array0[N];
	for(j=0; j<N; j++)
	{
		array0[j] = array1[j];
		array1[j] = array2[j];
		array2[j] = array0[j];
	}
}


/*====================================
ᥤؿ
====================================*/
int main(void)
{
	int i;
	short array1[N];
	short array2[N];

	//ν
	for(i=0; i<N; i++)
	{
		array1[i] = array2[i] = 0;
	}

	while(1)
	{
		wait(30000);             //30000Ԥ
		raiseWave(8, 8, array1); //򵯤
		ripple(array1, array2);  //򹭤
	}
	return 0;
}





kazushi?
http://nonchansoft.at.infoseek.co.jp/k99_1.htm




























































http://ccnet.dip.jp/devassist/exam/algorithm/wave/index.html




MovieClip?
















http://mysketch.jp/blog/2008/05/as202.php#extended



URL:http://www.instructables.com/id/Laser-show-for-poor-man/





http://casualplay.net/blog/2005/12/_draw.html http://www.newgrounds.com/portal/view/306531 http://casualplay.net/blog/2005/11/_blendmode_1.html















masaki?



masaki?


masaki?

URL:http://1art.jp/flash9/index.html


masaki?


masaki?

FLASH MATH CREATIVITY
http://www.levitated.net/bones/flashmath/photos.html


masaki?


masaki?


masaki?


masaki?
http://kazushi-lab.c.fun.ac.jp/pukiwiki/index.php?2%20PHOTO%20FLASH


masaki?


2 Photo Flash

masaki?


masaki?
2 PHOTO FLASH
http://kazushi-lab.c.fun.ac.jp/pukiwiki/index.php?%B2%DD%C2%EA%A1%A72%A4%C4%A4%CE%BC%CC%BF%BF


masaki?


masaki?


URL: http://www.nintendo.co.jp/wii/rmcj/handle/index.html

URL:http://youtube.com/watch?v=RQphfVeZB5E&feature=related


masaki?


masaki?









http://volcanic-penguin.deviantart.com/art/LineTo-experimental-14080073 http://mysketch.jp/blog/2008/05/as202.php


masaki?

http://gascon.cocolog-nifty.com/blog/2007/07/flash8_0372.html http://wellflat.raindrop.jp/main/flash/flash_html/mandelbrot.html YouTube? http://www.youtube.com/watch?v=MaozI6rCRHo


masaki?

http://www.procreo.jp/labo.html


masaki?
http://www.fractalartcontests.com/2007/ http://ja.wikipedia.org/wiki/%E3%83%95%E3%83%A9%E3%82%AF%E3%82%BF%E3%83%AB http://gigazine.net/index.php?/news/comments/20060603_complexification/ http://gigazine.net/index.php?/news/comments/20060618_fractal_recursions/ http://www.javac.jp/flash/fractal/index.html


masaki?


masaki?


masaki?
http://www001.upp.so-net.ne.jp/seri-cf/ http://www.ne.jp/asahi/h/machida/ http://gigazine.net/index.php?/news/comments/20061203_amazing_flame_fractals/



トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS