Source: NSIDC
Code: https://github.com/kjpluck/GlobalSeaIceCylinder
Tool: processing.org
[Edit] Posted, went to bed and woke up to this! :-) Thanks everyone!
[Edit 2] Add tool
There's not really an easy way to do it. There are some plug-ins for adobe AE (around 10$), but that's about it.
Processing has a piece of software, where you can apply pixel sorting algorithms to images.
Here's a link for a basic tutorial. I used the ASDF algorithm for my image too. Just started playing around with it about 2 days ago.
Have fun!
This is why I typically recommend Processing (https://processing.org) for beginners.
At its heart it is Java modulo some extra syntactic sugar. You can start by writing programs that execute line-by-line, then start writing functions, and if you wish you can even use OOP. Processing is easy to install, runs on all popular desktop OSes, can easily produce standalone executables for sharing with your friends, and it is a general purpose language whose semantics and syntax are readily transferrable to other mainstream languages.
I have been streaming on twitch for a few months and want to step up my game. I wanted to add something interesting to my stream and had the idea of adding a heart rate monitor. I know I am not the first to do this but I think I might be the first to have the actual graph of my heart rate! I am using an Arduino Nano clone and a AD8232 Heart Rate Monitor board. Right now I just have it on a breadboard but I need to solder up a more permeant solution. For the heavy lifting it's using the programming language/IDE Processing. Right now it the sketch is looking for a fall in the graph and adds the time of that fall to an array, divides it by 60 seconds and outputs that as the beats per minute heart rate. I think this isn't the best way to calculate it, but it's working right now. One of the issues it has is if I move around the graph wigs out and the BPM calculations can get thrown off really bad giving inflated heart rates. The code isn't ready for review, I would like to find some more official ways of calculating BPM but have been unable to find any white papers or anything.
void definitelyPossible(boolean i) { boolean fact = i; if (fact == true) { print("Big"); } else if (fact == false) { fact = true; } }
^^^^^Processing
The strange optical effect from staring at it was completely accidental! Let me know if you get the same effect from staring then looking away.
Instagram: @toebeeben
All made in Processing. Source Code
ARIEL: I learned how to program in my introduction to CS class at UCSC (CMPS5J), which uses Processing. It's easy to install and start writing and running code. It also fits neatly with arduino to start building physical projects.
A couple of years ago I learned html/css/java on codeacademy
> actually working with it
By the first day you should be able to do the following things: * processing- simple computer animations * arduino - build a circuit that flashes an led * codeacademy - boring website with colors and lists
I'd suggest checking out Processing. It is a free, Java-based language (shares syntax and libraries etc) that is geared towards teaching graphics and audio programming. It is a great way to sidestep a lot of the work you'd have to do to get up and running with most engines/frameworks. After you experiment with working with shapes and colors, you can decide if you're still interested enough to try something more sophisticated (Unity, Unreal, etc). It would also be entirely possible to create a game in Processing.
I found graphics programming to be MUCH harder than I anticipated - as it requires a different kind of mental abstraction than working with text and data. It is also very satisfying to get some cool looking animations running.
Not OP but answer here
>I'm using processing to capture the screen and detect the color of the pixels on the area of the health bar. It then sends signals to the arduino, that controls the LEDs placed behind the screen.
https://www.reddit.com/r/arduino/comments/3i5bud/ambient_light_dota_2_health_bar/cudgwfa
Any other method would end up with a VAC ban. Like this guy who was reading from the memory
https://www.reddit.com/r/DotA2/comments/27wj1c/vac_banned_for_arduino_experiment_looking_for/
No jerk thrown or captured, "creative coding" - in the "make pretty pictures with processing" sense or "make horrible noise with MAX/MSP" sense, not "I made the instagrammest instagram yet" - is one of the few places where being sloppy and even mostly incorrect is totally acceptable.
These guys just use sort of the same tools as we 10x fullstackers do, but there's actually little in common otherwise. It's basically perpetual prototyping, you don't want to have to obtain a safety certificate before you turn on the first piece of crap you solder together. The real problem is the guys who insist on shipping stuff they cobbled together in their garage and then jerk to how quickly they got a product to the market.
>Say I'm making a game. I wanna load a character sprite from an image file and draw it on the screen. Do I really need to handle all the possible ways that file could fail to load right now, before even seeing a preview of what it should look like? Hell no!
Now this is kinda stupid but still understandable, immediate feedback is 100% necessary for creative work,
>It's like having an assistant who refuses to do anything unless you specify everything! Hey assistant, get me a coffee. "I refuse to get you a coffee because you didn't specify what I should do in case the coffee machine is broken." Aargh!
Now we're jerkin
First, you have to evaluate if the teen is even remotely interested in programming because otherwise it's just wasted effort.
Then, I'd recommend to evaluate the direction they want to go and based on that, I'd search for resources.
Still, some general resources that could be of use:
Maybe, you could also try to kickstart the teen with some Game Creator software. Directly, <em>Unity3d</em> comes to mind. There are plenty other, maybe even simpler ones, but I don't know if they are free or have a free tier.
Pixel Sorting is essentially a processing script (unfortunately mostly encrypted) which selectively orders the pixels in the rows/columns of an image.
I applied it blindly by using Processing 2.2.1 and running the script from Kim Asendorf, the "inventor" of Pixel Sorting.
Here's a tutorial on how to do it.
This method is very limited though, if you want to move pixels on only certain parts of a picture you would have to use code.
It doesn't take that long to type... jk https://processing.org/reference/PrintWriter.html
PrintWriter output;
void setup() { output = createWriter("trap.txt"); for(int i = 1; i <= 500; i++){ output.print("["+i+"]trap "); } output.flush(); output.close(); }
void keyPressed() {
output.flush();
output.close();
exit();
}
Cheers!
I made this using processing.org (Which I forgot to add as a "tool" in the above comment, will fix soon). It's an animation development system which uses Java as the base language. Can also use JS and Python.
Check out their tutorials, they're actually really good! hello.processing.org
Um, what went wrong? There are languages specifically designed for graphical animations, e.g. Processing.
Very simple, no-bullshit code, e.g. animated line:
float a;
void setup() { size(640, 360); stroke(255); a = height/2; }
void draw() {
background(51);
line(0, a, width, a);
a = a - 0.5;
if (a < 0) {
a = height;
}
}
It also supports interactivity and can be used to implement really amazing things. And there are in-browser IDEs, e.g. Sketchpad so you can use it without installing anything.
Languages like C++ aren't designed specifically for animation. There is no notion of animation within the language, obviously, but you can always use a library. If you use a good library making animation code in C++ will be about as easy as it is in any other language. (I.e. the body of animation code can be as simple as in Processing, but you also need an initialization code.)
Python's pygame is somewhere in the middle, you need just two lines of code to initialize it:
import pygame pygame.init()
and then you can write your animation code e.g.
pygame.draw.line(screen, GREEN, [0, 0], [50,30], 5)
You can also do graphics in JS quite easily:
var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.moveTo(0,0); ctx.lineTo(200,100); ctx.stroke();
That's hardly complex and intimidating.
Heck yeah! We had OOT (Object Oriented Turing) in my high school and it provided excellent foundations for both procedural and object oriented programming. I found it to be a super accessible language with simple syntax that could yield exciting results for a new coder - like easily getting user input, drawing graphics/animations to the screen, etc. I think these days something like processing.org could provide a similar experience, but has the advantage of many powerful libraries available.
Source: The Antarctic Iceberg Tracking Database
Tool: processing.org
Animation: me
Artwork: /u/PolarBirdie
We are PixelMoversAndMakers.com
The projects and skills I learned on freeCodeCamp definitely helped me get the job. I graduated in April 2017 with a BFA in New Media. I only had a little bit of experience with with creative coding (using Processing, JavaScript based). I'm pretty terrible with math, but not too bad with logic and solving problems.
Combining the 100 days of code with freeCodeCamp's Frontend Development certification modules over the summer of 2017 was an excellent experience. It not only taught me ample JavaScript to build some simple web apps, but it teaches you to be resourceful online, and how to leverage the amazing freeCodeCamp community for help. It definitely changed my mindset coming in from "coding seems too out of my league to ever get anywhere" to "I'm excited to work on this problem and see where it goes"
I used Processing for this one. It's an easy to use programming language for visual artists. And its free. Openprocessing is a portal where you can find many examples for generative art/design provided with code.
You are better off setting up a regular Java project and including Processing's JAR as a library from your project. Here's instructions for doing it in Eclipse.
Well, it's for my university. The requirements are the use of an Arduino and a webcam. I came up with the concept of a marble run game you can draw yourself. I'm using Processing and its video libary to capture the image of the webcam. With OpenCV for Processing I found the contours on the paper and with Box2D I created the platforms and the marbles.
When I'm done with the software, I'm going to add the Arduino with a bunch of buttons and potentiometers to change settings and overall controls.
You can try Processing which is a Java-based environment made for learning to code within the context of visual arts. You can read about it here: https://processing.org/ Additionally, there are libraries for Javascript (p5.js) and Python (p5py).
i'm a fan of p5.js. their online editor is still in alpha but has worked great for me so far.
for those who don't know it's basically a direct port of a load of the stock graphics functions of processing (java-based) to js.
i find it to be currently lacking on the 3d side of things however
I'm using processing to capture the screen and detect the color of the pixels on the area of the health bar. It then sends signals to the arduino, that controls the LEDs placed behind the screen.
A lot of these interactive art installations are made with openFrameworks or Processing.
openFrameworks has bindings to several languages - such as Python - but was written in C++. It is a bit more powerful than processing, but the documentation for it is essentially zero - at least that I could find on their site when I had to work with it.
Processing has an editor that is very similar to Arduino's. It's default syntax is based off of Java, but there is a python mode for it as well. With Processing, you can make a pretty neat artistic within a couple of hours if you follow some tutorials.
Both openFrameworks and Processing will allow you to interface with microcontrollers such as an Arduino.
What a cute bear!
In general when you want to rotate something you have to translate into the center of whatever you want to rotate around and then call rotate with some changing parameter based on time, like frameCount*.1 and draw your thing after that.
Keep in mind that translate changes the meaning of all coordinates after it, so after translate(width/2, height/2) calling ellipse(0,0,20,30) will actually draw the ellipse in the center of your canvas rather than the corner.
I made you a simple robot face to illustrate the general idea:
void setup() { size(400, 400); }
void draw() { float t = frameCount*.05; background(200); rectMode(CENTER); rect(width/2, height/2, 300, 300); //robot head as background
pushMatrix(); //save original matrix translate(width/3, height/3); //move matrix to center of left eye rotate(t); //rotate based on time rect(0, 0, 20, 20); //draw rectangle centered at 0,0 popMatrix(); //load original matrix
pushMatrix(); //do the same thing for the other eye translate(width-width/3, height/3); rotate(-t); //rotate backwards rect(0, 0, 20, 20); popMatrix();
rect(width/2, height-height/4, 200, 20); }
You know... I thought it was actually running in MacOS Terminal.
: |
For anyone else that is wondering it is made with Processing.
> Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. There are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning and prototyping.
There goes my weekend.
To run at home:
Download all the source files OP has Kindly shared (one-by-one or with git)
Download the free, open-source Processing.
Use Processing to open the .pde file.
Thanks OP : D
If you are seasoned with Java, you may want to check out Processing.org. It has a nice library for visualizing graphics, 2D and 3D.
It is designed to write small apps that run in their environment though, so if you have 60,000 lines of code it may not work for you.
If your serious about getting into it, check out processing
Follow the tutorials but make your own project to work on. So if the tutorial is how to make x kind of photo filter, use what you learn to make y kind of photo filter.
The same goes for other types of tutorials as well.
Hello. CS degree holder here. Your friend is generally correct.
Rigorous or not, maths like trigonometry, geometry, calculus, linear algebra, and a lot of discrete math don't have any practical purpose in front-end dev and even in a lot of backend dev.
There's application development and there's systems development.
There is an endless stream of application development work that are focused on business logic and business process optimization. None of these require those maths. You can have a long and fruitful career just doing these and not touch any of the maths above.
The maths start to become relevant in systems dev and optimization work that deals with graphics, ML, AI, BigData, FinTech, protein folding, cosmology, particle physics. etc. But you don't even have to know how to actually do numerical programming because a lot of frameworks (like Processing, MapReduce, Matlab) will do them for you. But a basic understanding of CS maths will help you appreciate how those frameworks and engines are working in the background. So only if you want to pursue these fields, like customizing or making new and better algorithms yourself then, yes, you would need CS math; both basic and advance.
It was created using Processing: https://processing.org
So, it’s all code, but Processing makes this kind of thing easier than many other languages/environments. I’ve been using it for just under 3 years now. It’s lots of fun.
basically yes! look at classes — you could make a new Wall
class (containing whatever variables a wall needs: x position, y position, width height, colour etc.), and a function that draws the wall.
then make as many Wall
objects as you want!
Processing code can't run on a gpu. A gpu runs things called shaders, which are programmed in it's own programming language. You'll need to learn something completely new to work with them.
It's a ternary operator. It essentially acts as a shortcut for writing an if else statement. You can read more about it here
strokeWeight(special ? random(0.75, 3) : 0.75);
is equivalent to
if(special){ strokeWeight(random(0.75,3)); } else { strokeWeight(0.75); }
For anyone not familiar Processing is a learning / programming environment originally built off of Java. Its goals are for artists to learn to code, and for programmers to create art, and in general, teach visual programming to non-programmers. It's not too dissimilar to being a library, however it comes with an extremely simple IDE, a powerful drawing API with OpenGL support, and a friendly and supportive community.
People generally use Processing to create "sketches" of interactive programming ideas. Some have also built small-ish games with it. Others have used Processing to build interactive installations at museums and airports. Valve has also mentioned Processing in one of their papers as a tool they've used during prototyping.
Personally I've learned how to program originally from using Processing, and seeing it continue to be supported all these years is really amazing. There's now also P5.js which is Processing with Javascript, and Processing with Python.
EmDriven is correct. Mine is pixel position. The pixel coordinate system traditionally has an inverted y-axis. (see the following image: https://processing.org/reference/environment/images/coordinates2D3D.png)
Because of this reversal, mine could be interpreted as representing frustum position (with the units left unspecified).
Judging from his tags and the appearance of his work, he also uses Processing. Processing is a language/development environment built for designers, there's also a javaScript and Python library.
On the processing website there are links to examples and tutorials in the tutorial section
If you want to write this kind of game I'd suggest looking into https://processing.org/ as it will let you make lots of simple experimental things like this. Or you could use PyGame, or something similar.
As it stands your game is an impressive accomplishment, but using C with no build system and the archaic OpenGL dialect you've been is rapidly going to become limiting. For instance, if you add a single additional source file using the same header you're going to start getting link errors.
Unless your intent is to spend the next month learning about build systems and linking, instead of actually making things, I'd find a framework to play with.
Sketch out your idea with pen and paper, then translate it to code.
Seriously, just draw a rectangle that represents the canvas, draw your diagram idea, then pull out labels of the lines/heptagon/etc... that you want to draw/be affected by your input data. Post your diagram here with questions on how to achieve a certain thing you're trying to do. People here are super kind and will give pointers on how to do it, or refer you to something in the reference
Get into creative coding and doing digital media installations. That melds art and CS pretty nicely, and gives you pretty marketable skills. I know some schools are starting to offer specializations in digital media.
Check out Processing out for a place to start: https://processing.org/ ... Paper.js is another popular library: http://paperjs.org/
This really depends on what you want to create, and what language you want to use to create it. (In reality, generative art can be created in any environment, with any language!) A good one to get started in is called Processing. https://processing.org/
Based off of Daniel Shiffman's excellent implementation of Boid flocking. My resolution for this year is to create more work - good or bad - and post it. I'll post tutorials and write-ups for my work later - I still have some family in town and I want to maximize my time with them.
It doesn't matter much, really.
But I would advise against C++ as a first language - it's definitely important and worth knowing, but it's not the simplest language to start with.
Rather, since you mention an interest in video games, why not give Processing a try? It's pretty great for playing around with graphics and interactivity, and the language is essentially Java-lite - in fact, once you have grown comfortable with it, I'd suggest ditching it and just loading Processing as a Java library.
> ... and I'm a middling artist
You could try to get into programming with <em>Processing</em>, then...
>Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. There are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning and prototyping.
Thanks! I used Processing, which is just Java, to program the animated bar graph myself. I actually have a lot of other examples of me using the same program on other subjects as well.
I use Processing. It's essentially a java library that makes it incredibly easy to draw stuff to the screen. It's super flexible and great for experimentation. It comes with it's own IDE that makes it really easy to just jump in and immediately start coding without worrying about project structure or anything, which I find is perfect for messing around with CA and whatnot.
You could start by trying to read the source code for those animations - is it given? I recall seeing a site with images like those, but can't remember the address, though I'm pretty sure it had source code.
Plotting the Mandelbrot set would be a nice way to apply what you've learnt about complex numbers (if you've got that far).
There's a programming language called processing which makes it quite simple to plot pretty animations. The syntax is similar to JavaScript if I remember correctly. There's also a large collection of examples and some tutorials.
Tumblr Source: http://patakk.tumblr.com/tagged/processing
Looks like it's been done with that 'processing' programming language made to create graphical animations. Not sure thought.
There's a line strokeCap function in processing, first of all. Start there, so you don't have those rounded-looking lines.
Other than that, it looks fine to me. If it does the job you want it to do, good job!
That is such a fun library.
Reminds me a lot of writing Processing code to create visuals. Have had a ton of fun with it over the years.
I would like to point out that there is also a settings() method which runs just before the setup() method. It lets you do some nice stuff like setuping the window's dimensions using calculations!
int w = 200; int h = 200; int x = 0;
void settings() { size(w, h); }
void setup() { background(0); noStroke(); fill(102); }
void draw() { rect(x, 10, 1, 180); x = x + 2; }
Really underappreciated!
Sorry but I'm not analyzing code formatted like this. Please, use a code block next time. I'll give you general pointers just in case it'll help:
​
class Delay { int limit;
Delay (int l) { limit = millis() + l; }
boolean expired () {
if (millis() > limit) { return true; }
return false; } }
I can answer questions about these concepts if needed. Have fun!
Depends on what you want to do. For example Autocad can be scripted via Lisp or VBScript (which can also be used in MS Office). Archicad uses GDL to create dynamic elements. For visual things there is processing.
For general purpose office tasks I'd say python (or excel, lol)
For an absolute beginner with no previous experience...hard to tell, most likely not so much. Maybe you want to start out with something like Processing, which allows you to quickly and easily get something on the screen and play around with that before moving on from there.
Pretty hacky sollution in processing, it's java lib for drawing stuff. My method is N^2 , but Nlog(N) should be doable, /u/tomekanco seems to have the right idea.
To run my code you have to paste it in Processing3 and pres go, it will draw the points and lines differently each time since I randomize the order of my input array. This is one result.
Thank you for supporting your student's interest. The kids who really love rule based games are ideal audiences to introduce to Computer Science.
If you want the student to try something more open ended, let them loose with something like processing. It is a programming language that lets students make artistic projects. https://processing.org/
Hey! I just delved into pixel sorting myself, and I have already tried many ways to do it. For this image I used an older version of processing (2.2.1). And I ran the famous Kim Asendorf pixel art code to create the pixel sorting.
It's not ideal tbh, because it's not really intuitive. So I'm still figuring out to write my own code or find a better template in the near future. But for now Kims code will do fine!
processing 2.2.1 download: https://processing.org/download/
kim asendorf code: http://kimasendorf.com/data/ASDFPixelSort.zip
Little tutorial on the matter: http://datamoshing.com/2016/06/16/how-to-glitch-images-using-pixel-sorting/
Hope that helps!
EDIT: for the Kim asendorf code you need the 2.2.1 version of processing to get it to work.
Variables go without quotation marks when used inside text(), while anything else needs to be quoted.
Following your example:
text("score : score2", 0, 0);
will display score : score2 at 0,0. However,
text(score + ":" + score2, 0,0);
will display 3:7 at 0,0 instead.
Here's the reference if you want to check it out.
Oh man, have I got the best early birthday present for you. BAM!
Processing is a free program for developing Java applications. I made my first dozen games using it. It's not a game engine, it's really just a bunch of helper code that you can use to make the window/drawing part much simpler. They have an amazing one page reference guide and fantastic examples and tutorials.
Couldn't you put the code inside the keyPressed function outside the draw loop?
e.g.
draw(){ Code }
keyPressed(){ if key is s Your code }
At some point, I'd think Processing starts to make more sense as a developmental stage. No linguistic or syntactic compromises, it's "real Java", but with a beautifully supportive API. And performant -- a lot of the "code in your browser" tools (like Scratch) seem to bog down, shear, flicker, etc., which robs my kids of some of the joy.
What you want is an object that keeps track of its own X and Y coordinates. This can be something as simple as a PVector object or a custom class of object that holds its own coordinates and other information.
That is interesting, my implementation was quite a bit more complicated (a recursive approach: calculating the total length, and interpolating each pair of vertices accordingly) I'm astonished you can do this so efficiently, but I do not really get yet how these work. (Do you perhaps know somewhere where this is explained?) Yeah the basic idea is that you can parametrize the curve continuously (which is not true for the inverse). So once I had the parametrization set up, it was only a matter of choosing how many places in what spots. This was basically just a first exercise in order to get into processing, a relatively easy language for visualizing stuff.
EDIT: Oh my god, I just realized who I'm talking to! Just wanted to say that I love your work on Wikipedia!
Trying to learn to code by looking at books sucks. Don't do it that way (IMHO). Get started with practical, hands on, trial and error. jsforcats is a good place to learn basic syntax (which is roughly the same between all languages). Start there, then move on up. I would recommend Processing next. I am a computer science major with coding skills to rival (or at least match) most of my collage professors. I didn't even finish the first chapter of a book on Python, it just sucked too much. No, I got started with Game Maker. You really need to learn to code by experience.
Alright, here you go: https://github.com/MLanghof/Multithreaded32/tree/master/sketch_32BitThreading
Step 1: Download Processing from https://processing.org.
Step 2: Grab the code from github and open it in Processing.
Step 3: Click the arrow to start or press Ctrl+R.
It has no issue running on 32 bit Java, and you can clearly see the effect of threading (toggle it by pressing t while the sketch is running). I merely hacked in some threading code into one of the Processing example sketches, it's not like it takes a lot to notice there were multithreaded applications before 64 bit Windows became a thing.
Start by writing a mouseClicked() function. You can use Processing's mouseX and mouseY variables to find out the current mouse location.
Since you know each square is "tile" pixels wide, you can use integer division to determine the column (and similarly, the row) that was clicked. For example, the user clicks at position (107, 53). That would be column = 2 (since mouseX is a little more than two hops of 50 ("tile") pixels) and row = 1 (since mouseY is a little more than 50).
The code is in a language called Processing.
To get it to run, do the following:
Download processing;
Put the source file in a folder called distorted_image (because the file is called distorted_image.pde);
Open the source file with processing. You will get an IDE window with the source code;
At the top of the file there is a line: String IMAGE_FILE = "input_file.jpg"; Put an image in the program directory and change "input_file.jpg" to be the name of the image;
Click the run button at the top of the IDE window;
Look at the bottom of the source file to see the different key commands. It is not super user friendly at the moment, you have to hit keys like 'n', 'i', ... etc. to change options. The space bar will write an output image.
Good luck!
1010 teaches you basic programming using something called Processing, which is Java but you draw 2D objects. 1012 teaches you basic programming using Python. 1020 teaches you OOP and other intro topics using Java.
Well, you'll need video as input. The entire idea behind slit scanning is that you're delaying portions of the frame over time, and thus you need video input. You can't slit scan an image.
The basic formula would be:
Read a frame of video, draw it to the screen. Read a second frame, and draw it- but clip off the top row of pixels, draw it on top of the last frame. Repeat until you hit the bottom of the render area.
To handle the cropping, you'd use get. To get the video, you'd need to use some of these objects.
Finally, to save an image- like say, when you hit the bottom- you use the saveFrame
method. When in the process you call that is up to you- it could be in response to a key press.
Looking forward to see how you modified it. Happy Coding.
You will need to install Processing and Java runtime to open the "*.pde" files. Also you have a folder OUT, that is the output of the generative piece.
Doesn't really matter since your communications will likely be serial, any language should handle that no problem. https://processing.org/ is geared towards doing what you're talking about, and uses java. Might be worth starting with that then branching out if you feel the need later.
Also web dev here and also starting to learn Kotlin more. But I do come from a more traditional language background (Java, C++)
​
Sorry things are frustrating :( I certainly understand the feeling. For example I started learning Clojure awhile back and I had(and to some extent still have) some frustrations in wrapping my head around functional programming and the Clojure syntax.
​
If Javascript is the only thing you've known, there's quite a bit that's going to take some adjusting to when it comes to a more substantial language like Kotlin. I think your example though is more indicative of how Android is structured vs the language itself. It has been some time since I've done Android work I'll admit so I could be totally wrong here; but that looks roughly what you'd have to write even in Java; I wouldn't get discouraged about things just yet in regards to Kotlin itself!
​
I know it's tempting to try diving into things with an actual project but it sounds like it might make sense to take a step back and take the time to learn about the language a bit more - Kotlin is pretty much interoperable with Java; I might start with some simple Java tutorials or if you're more visually minded, I started learning Java through Processing , used Kotlin and Processing to pull down some images from Mapbox for a personal project a couple months ago.
Have you seen gradients using beginShape and endShape? You can set color on a per vertex basis and the shape interpolates the color between the vertices for you. Blew my mind when I was told about it.
​
void setup() { size(800, 800, P2D); }
void draw(){
beginShape();
fill(255);
vertex(0, 0);
vertex(width, 0);
fill(0);
vertex(width, height);
vertex(0, height);
endShape(CLOSE);
}
​
Edit: This also works for the various shape types described in the beginShape reference page. Also there's a more involved way to achieve cool effects including gradients, you could be using shaders to texture your shapes. It's actually what happens behind the scenes for the above example anyway, you'd just be doing it manually with a lot more control.
I'd probably look at how to connect a serial connection from processing to your arduino over serial connections.
https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all
Then, as a separate prototype, create a processing to excel solution.
https://processing.org/reference/saveTable_.html
Then build a new solution based off of the two existing prototypes.
PImage.get
is an accessor method. Its purpose is to retrieve sections of the image as an array, which you can then do other things with.
.copy
is multipurpose. If you call it with no parameters, it allows you to simply duplicate the entire image. With lots of different parameters, it allows you to copy a part of an image onto another part of the same image.
get
lets you check what's in the image. copy
allows you to copy/paste all over the image.
If I'm understanding you correctly, the solution would be to reimplement your ball code as a Java class and create new balls as instances of that class. This way you can just call your class constructor function [say, new BouncingBall()] in mousePressed() to spawn new balls at runtime instead of hardcoding each one in, which will probably spare you a lot of memory/performance/development headaches.
Here's a good primer on using objects and classes in Processing that shows how you can translate your current program design into an object-oriented one: https://processing.org/tutorials/objects/ -- /u/GoSubRoutine's tutorial links also break this down in a really good way for beginners.
Best of luck!
The name doesn't make it clear the way they used it, but Processing is a programming language for manipulating images. If you search for "Processing pixel sorting" you'll find tutorials.
Also note that most images like OP's selectively merge the sorted image with the original using Photoshop.
Ask and ye shall receive:
https://processing.org/reference/pixels.html
my humble example: https://gist.github.com/KrabCode/292d1b51db7d6b15fb509648e8448ade
allow me to direct your attention to these methods:
modifyPixels() which prepares the stage with calls to loadPixels() and updatePixels as per the reference page
shiftL() which uses swapPixels() which uses getPixel() and setPixel()
I know many people don't share this opinion, but I would highly encourage people to build their own engine for smaller (non 3d games). I've found amazing graphics libraries in most languages that assist in drawing the window and handing frames and rendering and such. But that's about all they do. Then you can completely customize that how you want and don't have to deal with the bloat of an engine.
For a text based game, I've done a Text RPG that's done entirely in the console with C++ cin & cout statements. This could be done in almost any language since they usually have a method of writing and reading from the console. If you want the game to be a little fancier and actually have a UI that's all text, then you can use one of those graphics libraries that I mentioned earlier and use it to draw text to the screen.
Depending on what language you want to use, there are different suggestions. From my experience, if you want to use Java, then check out Processing. If you want to use C++, check out SFML. If you want to use JavaScript, your browser already has everything built in with HTML and the canvas.
While I don't believe you would have to spend months learning an engine to find out it isn't right for you, there are probably better options than using an engine for a game like you talked about.
For 3D and javascript you cannot beat threejs, but for more 2d and data visualization processing is likely the best, it natively uses java, but has bindings for javascript and python. Also processing has a 3D renderer but I highly recommend threejs if that's the route you wanna take.
Back when I was still puzzling out programming, the thing that made me click the most with a lot of programming concepts was Processing (https://processing.org/).
It's a very simplified offshoot of Java with its own integrated IDE (another thing that always bugged me about learning programming, all these tutorials always gloss over the sheer amount of pre-requisite and weird knowledge you need to have just to setup for programming.)
Follow its tutorials, it starts with stringing simple commands together and slowly eases you into various concepts. By the end you're more or less learning proper programming. There's also a neat community site called OpenProcessing (https://www.openprocessing.org/) with lots of user snippets that let's you inspect the code, great for learning.
The easiest way would be to use the split() function. Split() takes a string and returns an array of strings split up by user a character or string as a delimiter. In your case it would be very simple.
String text = "Your text goes here."; String words[] = split(text, " ");
This will however keep punctuation attached to any words. It may beyond your skill right now, but these sorts of problems are very easily solved by what is called a regular expression, or regex. As always, Shiffman has a pretty good video and guide on them. Essentially regex's are like using "find" in Word but on steroids.
Edit: just realised this is only half the answer.
To select a random word from our new words array we can simply do:
String word = words[int(random(words.length))];
This might be a bit complicated looking at first but all we're doing is randomly generating a number between 0 and the size of the words[] array. Random generates a float number so we need to cast it as an integer by wrapping random inside of int(). The. We can display that word on the screen:
text(word, x, y);
Where x and y are the coordinates of where you want to display. There are some ways to adjust textSize() as well as loading a textFont() but for now this is enough.
Pick up processing at https://processing.org/ its a super easy to use interface for creative coding then look at http://natureofcode.com/ Its a textbook that teaches you the basics of procgen type stuff. Its super intuitive and easy to follow.
> So when I make a variable without declaring public or private, what does it make it?
Depends on the language. This documentation here indicates that if the private
keyword is omitted, then the field or method is public
. (assuming this is the correct language and version that you're using)
> I'm currently making a very simple little game in Processing and a large number of variables in the various classes should only be manipulated through the methods in those classes. Should I be making these variables specifically private in these instances?
In general, yes they should be made private
. Especially if your intent is to have those variables/fields should only be manipulated through those methods. If there is no good reason they should be exposed, then don't expose them. This is basically the concept of Encapsulation or Information Hiding and has various worthwhile benefits. If your simple little game is simple enough and you're the only one using it, it probably doesn't matter as much. It's as complexity increases and you intend to have other people use the code that defining a nice public API for it really pays off. If you like, a good exercise might be to complete your game as-is (with all the public variables), then refactor it to hide all those variables/states.
https://processing.org/reference/
Check out mouseX and mouseY. Good luck with the cheating. (http://www.reddit.com/r/processing/comments/36manz/requesting_the_aid_of_a_processing_legend/)
If you can't bother reading, check out these videos : http://funprogramming.org/ He pretty much walks you step by step and you would be able to finish your assignment today.
Right, visuals on arduino are always....annoying. you basically need to read the arduino data and plot it on your computer. There are a few ways to do this.
Your method from here depends on which one of these you choose. Start googling "processing GUI", "Processing graph" if you are unsure of the second and third options
If it weren’t for the tablet/phone requirement I’d recommend Processing—which is basically a stripped-down, graphics-oriented version of Java aimed at visual designers.
But for mobile devices you’d need to use either Objective-C (for iOS) or Java (for Android), which doesn’t seem realistic to learn in that timeframe.
Edit: Actually, it looks like there might be some solutions for using Processing to create Android apps.
Just figured it out, download
https://processing.org/download/
which is the program used to compile this and just copy paste the code into the program and run. From there you can edit as you please.
I didn't mean it works. I'm just not getting an error message. That's actually a problem. But referring to what u/davebees and u/AGardenerCoding said, it doesn't seem to be a bug, PGraphics objects just need to be made one at a time.
Also, using createGraphics() in draw-loop is quite wasteful as you need to make them only once. It'd be better to create them in setup() as in this example.
ARTG 2260 is meant to teach art and design students who have zero coding experience so you'll be in good company. It can be overwhelming at times when you're starting out but there are a ton of online resources you can access to help you if you get stuck. I took the class last year online and it's mostly just a series of projects where you need to demonstrate basic proficiency in coding concepts, they don't have to be flashy. I'm ultimately really glad I took the course because it gave me a good baseline in programming and it made learning stuff like HTML/CSS and game design much easier. If you have any other questions or need help at any point next semester lmk, I'm happy to help :)
I'd start by learning some Processing (yes, unfortunately that's what it's called).
https://processing.org/
See the examples and the Getting Started.
You can dive right in and get results online here:
https://editor.p5js.org/
This uses javascript. Personally I use the Python libraries since that's the language I'm more proficient in, but it does require setting up a coding environment on your computer which can be a pain.
> my hobbies lean more towards art/writing/exercise
you can make digital art! have a look at processing and subs like /r/glitch_art, r/generative, /r/cellular_automata
also /r/adventofcode is coming up soon, that's fun to do
I suppose that your problem is how to move several different shapes as one? This createShape() reference page should be helpful when creating a shape from multiple parts to work as one.
I don't know the Chladni equations but it definitely sounds possible. Break the problem down into its individual steps, adding as many as needed. Might be something like:
I also don't know anything about working with audio. But I do know there's an audio library for Processing.
Well the PGraphics itself inherits from PImage and can be drawn as an image onto another canvas. If you want the pixels themselves you'd want to use myNewImage.loadPixels()
and then access its pixels
array.
Try recreating each individual element as separate class -> https://processing.org/reference/class.html
​
A starfield
The noise
The rings
​
Combine everything and add the pixellook.
If I understand correctly: You're looking to make a 2D side-scroller. I'd start with the language named Processing. It's the Java syntax; just more visually based.
Plenty of tutorials here: https://processing.org/
This may be what you're looking for: https://youtu.be/Ouza_4SsbLc
Happy coding, this whole path will be research, trial and error, implementation and finally, success.
You will build your skyscraper, one brick at a time.
In case you are dying to try out Sketching, but don't have any inspiration: pick an example from the Processing web-site and port it to Sketching.
https://github.com/soegaard/sketching/projects/1 https://processing.org/examples/
The jump from terminal based programs to GUI is a very difficult one in most languages. From personal experience, I'd recommend Processing which is a Java library/tool that is designed specifically for writing graphical applications like 2d games. You can totally build a calculator or whatever else you might want. It has great documentation, tons of videos and examples and a very low barrier to entry.