Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
zoey-lin-hydra-presentations [2022/12/28 07:45] – created zoey.lin | zoey-lin-hydra-presentations [2022/12/29 03:34] (current) – renick | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Hydra Presentations===== | + | ======Hydra Presentations====== |
Made by: [[zoey-lin|Zoey]] | Made by: [[zoey-lin|Zoey]] | ||
- | ====Kaleid==== | + | ===introduce Hydra=== |
- | ===Simple Example=== | + | Hydra is a computer program, most people use computer programs to make the computer work but now we are using a computer program to make photos or animations in Hydra. |
- | < | + | ↓↓↓ here are some simple Explanation of hydra code ↓↓↓ |
- | <iframe | + | - [[zoey-lin-hydra-presentations# |
- | src = " | + | - [[zoey-lin-hydra-presentations# |
- | </ | + | - [[zoey-lin-hydra-presentations# |
- | </ | + | - [[zoey-lin-hydra-presentations# |
+ | - [[zoey-lin-hydra-presentations# | ||
+ | - [[zoey-lin-hydra-presentations# | ||
+ | ====Kaleid==== | ||
+ | ===Simple Example=== | ||
**Code** | **Code** | ||
< | < | ||
Line 17: | Line 21: | ||
</ | </ | ||
- | **Explain** | + | **Explanation** |
< | < | ||
osc(25, | osc(25, | ||
Line 29: | Line 33: | ||
</ | </ | ||
- | ===Complex Example=== | ||
< | < | ||
<iframe | <iframe | ||
- | src = " | + | src = " |
</ | </ | ||
</ | </ | ||
+ | ===Complex Example=== | ||
**Code** | **Code** | ||
< | < | ||
Line 46: | Line 50: | ||
</ | </ | ||
- | **Explain** | + | **Explanation** |
< | < | ||
osc(25, | osc(25, | ||
.kaleid(5) | .kaleid(5) | ||
- | - over here I set the kaleid to five, so you can see the shape is pentagon. | + | - over here I set the kaleid to five, so you can see the shape is the pentagon. |
.color(3, | .color(3, | ||
- | - 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 | + | - 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 finding |
.rotate(0.9, | .rotate(0.9, | ||
- | - I am still finding what is the first number | + | - I am still finding what the first number |
.modulate(o0, | .modulate(o0, | ||
- | - In this function | + | - In this function, works when you move your mouse. The first number is texture, In hydra, there have 4 different |
.out() | .out() | ||
</ | </ | ||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====Repeat==== | ||
+ | ===Simple Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | shape(4, | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===Complex Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | osc(9, -0.1, 19) | ||
+ | .kaleid(6) | ||
+ | .repeat(2, 4) | ||
+ | .out(); | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====modulateScroll==== | ||
+ | ===Simple Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise(10) | ||
+ | .modulateScrollY(osc(50), | ||
+ | .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), | ||
+ | - 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. | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===Complex Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise(10, 1) | ||
+ | .modulateScrollY(osc([10, | ||
+ | .rotate( () => time%360 ,0.1) | ||
+ | .color(1, | ||
+ | .out() | ||
+ | </ | ||
+ | |||
+ | **Explanation** | ||
+ | < | ||
+ | |||
+ | noise(10, 1) | ||
+ | noice(scale, | ||
+ | |||
+ | .modulateScrollY(osc([10, | ||
+ | - 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, | ||
+ | - 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. | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====Color==== | ||
+ | ===Simple Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | osc().color([1, | ||
+ | </ | ||
+ | |||
+ | **Explanation of color** | ||
+ | < | ||
+ | the reason that the color changes is that I set three different colors, and each square bracket means one color, there are three numbers inside the square bracket the order of numbers is red, green, and blue. So if you look at the first number I set you can see [1,0,0] This is mean I only want red so set red to " | ||
+ | |||
+ | You must be curious here I only set red, green, and blue. But why is there black? This is because in hydra the original color is white and black. White is good to be overshadowed by other colors but black is hard to be overshadowed by other colors, so white is covered by the three other colors I set, black does not. Consequently, | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===Complex Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise(10, | ||
+ | .add(osc(10, | ||
+ | .add(osc(60, | ||
+ | .add(osc(64, | ||
+ | .out(o0) | ||
+ | </ | ||
+ | |||
+ | **Explanation** | ||
+ | < | ||
+ | Just now I talked about setting colors but I only said red green and blue so why are there other colors in this art. | ||
+ | hydra is very cool. It is just like painting, you can make many colors, but you need to make the color yourself. For example, if you want purple you need to add blue and red together, so if you set red, green, and blue at the same time. All the colors will be overlapped so there will be many different colors. | ||
+ | |||
+ | * The setting color in hydra is hard so I am still trying. get me some time🙃. | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====Render==== | ||
+ | ===Simple Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise().color(1, | ||
+ | noise().color(3, | ||
+ | noise().color(0, | ||
+ | noise().color(0, | ||
+ | render() | ||
+ | </ | ||
+ | |||
+ | **Explanation of render and out** | ||
+ | < | ||
+ | usually, we use one out to show the photo but over here I have 4 out. The reason that there have 4 out is that I want hydra to show 4 different photos at the same time. So " | ||
+ | Inside each out, you can put any hydra function. | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===Complex Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | //o0 | ||
+ | noise() | ||
+ | .pixelate(30, | ||
+ | .color(1, | ||
+ | .out(o0) | ||
+ | //o1 | ||
+ | osc(50, -0.1, 10) | ||
+ | .kaleid(5) | ||
+ | .repeat(8, 5) | ||
+ | .out(o1) | ||
+ | //o2 | ||
+ | noise(10, | ||
+ | .color(0, | ||
+ | .add(osc(10, | ||
+ | .add(osc(60, | ||
+ | .out(o2) | ||
+ | //o3 | ||
+ | noise(10, 0.1).color(3, | ||
+ | render() | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====Pixelate==== | ||
+ | ===Simple Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise() | ||
+ | | ||
+ | | ||
+ | .out() | ||
+ | </ | ||
+ | |||
+ | **Explanation of pixelate** | ||
+ | < | ||
+ | First of all, you can see that this picture is made up of many small squares the reason why it worked like this is that I use a code called pixelate, pixelate is kind of like picture quality, If the number in the code is larger, it means the picture quality is clearer. The first number is the mean of the x-position and the second one is the y-position, it is just like normal math. So if I set the x-position to 1000 it means the x-position will have 1000 small squares. | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===Complex Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise() | ||
+ | .color(4, | ||
+ | .add(osc(20, | ||
+ | .pixelate(200, | ||
+ | .out() | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===More Complex Example=== | ||
+ | **Code** | ||
+ | < | ||
+ | noise() | ||
+ | .color(2, | ||
+ | .kaleid(50) | ||
+ | .pixelate(200, | ||
+ | .add(osc(10, | ||
+ | .out() | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <iframe | ||
+ | src = " | ||
+ | </ | ||
+ | </ |