But bob ross does programming twitter.com/bobrossgamedev
@valshaped
7 жыл бұрын
Kristian Pedersen Happy Spheres
@256k_
7 жыл бұрын
my life is made
@Kino-Imsureq
7 жыл бұрын
ive seen this 2 times wut
@kpunkt.klaviermusik
Жыл бұрын
I couldn't imagine what's possible just with a few lines of code. This programming language is really amazing. And Dan's way of explaining things is even more amazing!
@Amr-Ibrahim-AI
4 жыл бұрын
This whole series of supershapes was fun to watch!
@ritikkhatri
6 жыл бұрын
17:25 made my day !
@joakin8535
3 жыл бұрын
Absolutely
@LAvocat
6 жыл бұрын
I laughed so much when you paused ! "What are these values ? .... Oh my god I don't know .... PAUSE !"
@unjust87
5 жыл бұрын
Thank you for this series! I just got reintroduced to processing and I love these. You the man Dan X-D
@DanielKierkegaardAndersen
8 жыл бұрын
Gotta love that ending :D
@TheCodingTrain
8 жыл бұрын
heh, thanks!
@LhwanPSilva
3 жыл бұрын
best programming teacher!
@visaac
4 жыл бұрын
17:25 epileptics have started a foam party. Even this is a training video, no one is against if you are fooling around with your own code :) Also, add some sliders, so, you would make your own super shape
@prestonblumhagen8626
8 жыл бұрын
Daniel me and my friends would love it if you did a coding challenge on pong
I recreated this in unity. had some issues because the mesh was being rendered backwards but I figured it out eventually.
@JarppaGuru
2 жыл бұрын
3:00 lat and lon reversed last video to get color this way. also pi half_pi two_pi changes
@brauliodominguezgodoy3782
7 жыл бұрын
Thanks dude! you rock!
@coffeecatrailway
7 жыл бұрын
if you do it looks really cool! m = map(sin(mchange), -1, 1, 0, 10);
@TheCodingTrain
7 жыл бұрын
oh, nice suggestion!
@eemelilehtonen8628
7 жыл бұрын
Oh! NO NO NO, yes 13:18
@OG_CK2018
4 жыл бұрын
Why is it so underrated
@Mr.Whiskers
4 жыл бұрын
🤯 It's okay! I never used it much, anyway!
@agorafobicoMusica
7 жыл бұрын
You should be in fox prime time!
@Disasembledsunflower
5 жыл бұрын
Quick question: is there a way I can manipulate a supershape like this one with minim? Like can I have it morph along to a song?
@ritaschnee5167
5 жыл бұрын
trying to do the same haha haven't found a good way yet, but tell me if you find one :)
@ritaschnee5167
5 жыл бұрын
import peasy.*; import processing.pdf.*; import ddf.minim.*; import ddf.minim.signals.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; PeasyCam cam; Minim minim; AudioMetaData meta; AudioPlayer sound; FFT fft; BeatDetect beat; PVector[][] globe; //two dimensional array to calcute triangleshapes between points int total = 75; //anzahl punkte //export boolean record = false; void setup() { size(600, 600, P3D); cam = new PeasyCam(this, 500); colorMode(RGB); globe = new PVector[total+1][total+1]; //columns and rows for triangles; +1 to correct triangle arrange minim = new Minim(this); sound = minim.loadFile("milchschäumer.mp3"); // sound = minim.loadFile("herz.mp3"); sound.loop(); fft = new FFT( sound.bufferSize(), sound.sampleRate() ); } //konstanten form r2 int tresh1=3; int tresh2=30; int tresh3=5; int tresh4=10; float m = 0; float mchange = 0; float n2 = 0; float n2change = 0; //konstanten form r1 float m2 = 0; float m2change = 0; //konstanten für formeln float a = 1; float b = 1; float supershape(float theta, float m, float n1, float n2, float n3) { //supershape formel //konstanten float t1 = abs((1/a)*cos(m * theta / 4)); t1 = pow(t1, n2); // pow=multiplying numbers by themselves float t2 = abs((1/b)*sin(m * theta/4)); t2 = pow(t2, n3); float t3 = t1 + t2; float r = pow(t3, - 1 / n1); return r; // radius value umkehren } void draw() { background(255); noStroke(); //lights(); ambientLight(153, 102, 0); smooth(64); //farben geometrie noStroke(); //stroke(225,235,237); fill(237, 106, 74); //noFill(); //export if (record) { beginRaw(PDF,"output/sphere" +frameCount+".pdf"); } fft.forward( sound.mix ); //// loop to calculate everything //lat,lon float r = 200; //radius for (int i = 0; i < total+1; i++) { float lat = map(i, 0, total, -HALF_PI, HALF_PI); //mapping points within range; PI etc comes from formula float r2 = supershape(lat, m, 10, n2, 10); //konstanten der supershapes for (int j = 0; j < total+1; j++) { float lon = map(j, 0, total, -PI, PI); //mapping points within range float r1 = supershape(lon, m2, 0.5, 1.7, 1.7); //funktionen für formengeneration float x = r * r1 * cos(lon) * r2 * cos(lat); float y = r * r1 * sin(lon) * r2 * cos(lat); float z = r * r2 * sin(lat); globe[i][j] = new PVector(x, y, z); } } ////putting calculation into two dimensional array; //using array to set points - set triangles instead of points for (int i = 0; i < total; i++) { beginShape(TRIANGLE_STRIP); for (int j = 0; j < total+1; j++) { PVector v1 = globe[i][j]; vertex(v1.x, v1.y, v1.z); //map the pints for triangles PVector v2 = globe[i+1][j]; //next vertex vertex(v2.x, v2.y, v2.z); } endShape(); } ////shapeshifting //m = map(mouseX, 0, width, 0,7); if(mchange
@ritaschnee5167
5 жыл бұрын
I tried this but it's not really smooth or anything
@ReevansElectro
7 жыл бұрын
It is amazing what you can program without much prep or a lesson plan. Is this how so called 'spaghetti code' is written?
@Bunny99s
6 жыл бұрын
No, this is far from spaghetti code. Most of the code is linear and he uses not too many nested control structures. Putting the "supershape" code into it's own method actually shortens the nested loop body. As a programmer this is something that should immediately pop into your mind. Whenever you have some complex code that is longer than 2 lines and you need that code more than once, it most likely should be a seperate method. Everyone has different limits in mind when something should go into a seperate class / method. Actually for performance it's actually better to have everything inline as method calls are rather expensive. However you need to have a feeling for how expensive it really is. Always keep in mind premature optimisations are always bad. If you do an optimisation from the very beginning there has to be a huge improvement. Improvements in the range of 0% to 50% could be done later when you actually run into performance issues. First get it working, then it might be time to improve it. Outsourcing duplicate code has several advantages. First if there's an error in the outsourced code it only need to be fixed at one place. The same is true when you want / need to change it for other reasons. Seperate methods could be tested independently of the code where they are used.
@eotikurac
8 жыл бұрын
float supershape() ? i've never seen you do that before. what's the difference between float supershape() and void supershape() in this case?
@streamware7746
8 жыл бұрын
do you know how to code '
@lex224ification
8 жыл бұрын
float function() returns a float, void function() returns nothing.
@Bunny99s
6 жыл бұрын
And that's the reason why so many people call a method wrongly "a void". Everytime i read that my hair stands on end. "void" is just a "pseudo type" which represents no type / value. So a method that has a return type of "void" simple doesn't return anything. It seems as many people have learned something like javascript they expect some sort of introduction keyword like "function" so the compiler knows you create a function. However in C, C++, C# and Java methods are simply declared by having brackets behind the method name. Of course a method declaration has a strict syntax so the parameter brackets have to be followed by the method body RETURNTYPE MethodName () { // method body } There can come access modifiers before the return type (public, private, protected) or virtual control keywords (final in Java, virtual in C#, C, C++). Keep in mind this is all about type safety. If you declare a method with a return type of "float" you HAVE to return a float value or the compiler will complain. Likewise if you try to call a method that returns void and assign or use the result somewhere the compiler will complain as well. Some people seem to fear compiler errors, however they are actually a tool which makes you spot errors right where it's produced. In dynamic scripting languages like javascript you can do all sorts of calculations and weird stuff until an actual error happens at runtime. Typesafety avoids many trivial errors already at compile time which are otherwise hard to debug at runtime.
@realcygnus
7 жыл бұрын
why doesn't processing have simple sliders like in p5?
@user-or2gl9sq5d
5 жыл бұрын
Probably because p5 uses html and the sliders are out of the canvas, while in processing there is nothing out of the canvas. The whole thing is a canvas.
@alesandra1794
4 жыл бұрын
god bless you
@BernardBernouli
7 жыл бұрын
I don't think the range and formula changes from x = r * sin(lat) * cos(lon) , 0
@Bunny99s
6 жыл бұрын
You mean sin(x) = -cos(x + pi/2). Note the "-" ^^ sin of 0 is 0 while cos of 0 is 1. increasing the angle makes cos to go down from 1 to 0 after 90° (PI/2). So adding PI/2 to x makes cos to return 0 for x==0. However as x increases sin(x) goes up but cos(x + PI/2) goes negative. Alternative relationships would be sin(x) = cos(x - pi/2). cos(x) = sin(x + pi/2).
@Paulo_Dirac
Жыл бұрын
Good old Paul Bourke
@urgisjot
Жыл бұрын
Does anyone know how would one modify this to create a shell shape?
@imfromzbs
8 жыл бұрын
Hi Dan, thank you very much for the videos, they are very helpful! I have a remark for this lecture series, I noticed that most of the other forms (the ones you did not make) from the Patreon website do not work on the sketch you uploaded, do you know what the problem may be? The result of the form is different than from the website.
@imfromzbs
8 жыл бұрын
I meant from Paul Bourke's website
@TheCodingTrain
8 жыл бұрын
Hmmmm, there must be a mistake in my code! I will try to investigate.
@jeffcummings3842
2 жыл бұрын
@@TheCodingTrain Hey, I just added an abs() around the: abs(cos(m * theta / 4.0f)). This was messing up most of the supershapes for me (I ported to c++ opengl, so kinda different for me, but I went over the code explanation on Paul's website and found that one abs() function around the trig functions missing). I realize this is like 5 years later but I just found this code tonight! rofl Anyways, hope it helps someone in the future!
@Pedozzi
3 жыл бұрын
20:23 Dan ascends to the supershapes dimension
@woahdaggies
7 жыл бұрын
I would like to make a version that uses text boxes or sliders to change the values for the different variables. I'm new to p3 and I'm wondering if it is even possible to create user input!
@40deekree
8 жыл бұрын
โอ้!!เจ๋งมากเลยพ่อหนุ่ม
@WildAnimalChannel
6 жыл бұрын
super
@halvorhansen
7 жыл бұрын
Does super shapes crave a lot of processing power? If so how much?
@chrisrodden
7 жыл бұрын
Anyone know the best way to export these 3D shapes to .stl?
@ritaschnee5167
5 жыл бұрын
Has anyone tried to do control a super shape with audio yet?
@JarppaGuru
2 жыл бұрын
9:18 back again lol
@JarppaGuru
2 жыл бұрын
6:51 r2=r?
@emoryallen6866
7 жыл бұрын
Why must peasy not work in Processing 3!?
@dashl5069
7 жыл бұрын
yah
@masterflamaster6377
7 жыл бұрын
there is a processing 3 peasycam version, it works for me
@dashl5069
7 жыл бұрын
MasterFlamaster oh thats nice thanks for the help!
@edwardianmaidsama7276
8 жыл бұрын
the code does not seem to work for the shapes in the section that says non intergers of m in pualbourk page.
@TheCodingTrain
8 жыл бұрын
hmmm, i'll have to look into it, feel free to file a bug at github.com/CodingRainbow/Rainbow-Code/issues
@edwardianmaidsama7276
8 жыл бұрын
Thank you, sorry if I misinterpreted the data input.
@giusepperomeo1862
8 жыл бұрын
hi, I have a question: what language is?(scuse me for my ignorance,but I am a beginner)
@TheBassHeavy
8 жыл бұрын
Hello. This is Processing (processing.org/)
@giusepperomeo1862
8 жыл бұрын
ok,thank you so much!
@JarppaGuru
2 жыл бұрын
10:32 not smart would just change r1->r2 r2->r1
@JarppaGuru
2 жыл бұрын
4:25 not so smart would just move website where you put images duh
@ZekeTaylor1
7 жыл бұрын
you really loss me with that theta,abs,cos,sin, and that abs((1/a) crap im sorry im just not good at math
Пікірлер: 77