This is an old revision of the document!
Hydra Presentations
Made by: Zoey
Kaleid
Simple Example
Code
osc(25,-0.1,0.5).kaleid(50).out()
Explanation
osc(25,-0.1,0.5) osc(frequency: like how many line in one round, speed, color) .kaleid(50) - The number inside the parentheses is mean how many corners for the shape ,so if i set corners to 3 it will return triangle .out() - out is mean tell the Hydra to return the function and show the photo.
Complex Example
Code
osc(25,-0.1) .kaleid(5) .color(3,0.91,0.39) .rotate(0.9, 0.1) .modulate(o0, () => mouse.x * 0.0003) .out()
Explanation
osc(25,-0.1) .kaleid(5) - over here I set the kaleid to five, so you can see the shape is pentagon. .color(3,0.91,0.39) - This color function is hard for me. Because the color function over here is different from SVG.js and p5.js So i am still find the answer .rotate(0.9, 0.1) - I am still finding what is the first number mean, but the second number is mean how fast the rotate should be. .modulate(o0, () => mouse.x * 0.0003) - In this function it is work when you move your mouse. The first number is texture, In hydra there have 4 different texture, ex.o0,o1,o2,o3 .out()
Repeat
Simple Example
Code
shape(4,0.8).repeat(6.0,7.0).out()
Complex Example
Code
osc(9, -0.1, 19) .kaleid(6) .repeat(2, 4) .out();
modulateScroll
Simple Example
Code
noise(10) .modulateScrollY(osc(50),0.1,0) .out()
Explanation
noise(10) noise is one kind of texture, and the number inside parentheses is the mean scale so the bigger the scale, the more it returns. .modulateScrollY(osc(50),0.1,0) - modulateScroll you can set it for Y-position or X-position. - Because I set osc to 50 so the number of scrolls will be 50 times. - If I set modulateScroll the Y so the second number is how much move in Y-position. The last number is speed, number bigger is faster. .out() - out is mean tell the Hydra to return the function and show the photo. So at the end of code need to have this.
Complex Example
Code
noise(10, 1) .modulateScrollY(osc([10,100]),0.1,0) .rotate( () => time%360 ,0.1) .color(1,0,3) .out()
Explanation
noise(10, 1) noice(scale, movement speed) .modulateScrollY(osc([10,100]),0.1,0) - over here I set osc to 10 and 100, It is mean the modulateScrollY will return two time one time is 10 the other time is 100. .rotate( () => time%360 ,0.1) - 360 is mean rotate 360 degree, and how fast it return each time. .color(1,0,3) - The three number here is mean Red, Green and Blue, But I am still confused about how to use the color function, I will ask Dr.bell. .out() - out is mean tell the Hydra to return the function and show the photo. So at the end of code need to have this.