Last active
August 29, 2015 14:26
-
-
Save volkanozcan/c76dbf00acc4e6e2eb35 to your computer and use it in GitHub Desktop.
spiral
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.4/p5.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
var x = windowWidth; | |
var y = windowHeight; | |
createCanvas(x, y); | |
frameRate(100) | |
//noLoop(); | |
} | |
var nokta = 0; | |
var array_x = []; | |
var array_y = [] | |
for (var i = 0; i < 1000; i++) { | |
array_x.push((10 + i) * Math.cos(i)) | |
array_y.push((10 + i) * Math.sin(i)) | |
}; | |
array_x.forEach(function(ss,as){ | |
console.log(ss,as); | |
}) | |
function draw() { | |
nokta += 0.1; | |
noStroke(); | |
drawingContext.shadowOffsetX = 1; | |
drawingContext.shadowOffsetY = -1; | |
drawingContext.shadowBlur = 5; | |
drawingContext.shadowColor = "black"; | |
fill(random(0, 255), random(0, 255), random(0, 255)); | |
imageMode(CENTER) | |
translate(width / 2, height / 2); | |
angle = nokta; | |
rotate(nokta); | |
x = (10 + angle) * Math.cos(angle); | |
y = (10 + angle) * Math.sin(angle); | |
ellipse(x, y, 15, 15); | |
$("h1").text(~~nokta); | |
if (nokta > windowWidth / 2) { | |
nokta = 0; | |
background("white") | |
} | |
} | |
function renkver(x, y) { | |
/*x ten y'ye kadar rastgele sayı ver*/ | |
return ~~(Math.random() * y) + x; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment