0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

lazeの作法 その2

Posted at

概要

lazeを見つけたので、やってみた。
sin波、やってみた。

写真

image.png

サンプルコード

function: main() => () {
	captureMouse();
	Scene: world;
	Vector3D: color(1.0, 0, 1.0);
	double: PI = 3.14159265398979315;
	Array<int>: cubeIDlist;
	int: numberOfTimes = 100;
	Vector3D: initialPosition(0.0, 0.0, 0.0);
	repeat(numberOfTimes)
	{
		cubeIDlist.push(world.addCube(0.100000000000000006, color, initialPosition));
	}
	loop
	{
		double: w = 0.100000000000000006;
		repeat(cubeIDlist.length())
		{
			double: x = w * counter - 5.0;
			double: y = sin(x + getTime() / 300.0);
			Vector3D: position(x, y, 0.0);
			int: id = cubeIDlist.get(counter);
			world.sprites.get(id)->setPos(position);
		}
		world.draw();
	}
}

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?