This is a serious noob question, but can I use Processing's XML importer to import files like based on the XML schema. Like if they use the an XML Format. Such as this .gexf file
http://gexf.net/format/
If so, would I just have to provide the 'xmlns=' and the 'version=' line or something?
I'm really stumped on how to incorporate the functions of external libraries into my own sketchs. Im think this is super easy, but Im just totally totally stumped. Here is my problem;
I do not understand what pieces of the external library I need to include in my sketch to gain its functionality (besides
import.theLibrary*; ). And then, how to use them with my own data (or parameters).
Every tutorial site says, "look at the examples provided and that will show you" but like, I dont get it. There are so many lines of code in the example files, which lines of code do i need to include in my sketch to gain functionality, and then, how do I incorporate my own variables into the library on my shit? I have read and watch everything I thought that might have the answer, but Im still missing it...
I watched awesome Joes' awesome PeasyCam tutorial
http://vimeo.com/18325690 (he is the man btw (thank you Jose)).
But I dont understand how to find out the name of the thing you need to Declare (bascially what you need to include in your sketch for the library to start working for you). In the case of the PeasyCam provided example, its right there at the top. But so is all this other stuff. How do you discern what elements you need to include to get it to work in your sketch. He only includes
PeasyCam cam; then
cam = new PeasyCam(this,100); but there is all this other stuff in the PeasyCam example file.
So, what if I wanted to use a different library, there are so many and not all of them are nearly as clear how to initialize in your sketch... For example, Im looking at Toxiclibs provided example PolarUnravel in Geometry.
If I wanted to make a bar chart thing of mine do the same thing as the awesome Toxiclibs PolarUnravel example. Which lines of that code/library to I need to include to get the lines in my sketch to do that same cool unravel thing? And, which from the example file do I not include in my sketch file. Then, how do I tell it to work? Like, to start the unraveling not by clicking the mouse (which is how it works in the example file), but rather start the unravleing by hitting the "u" key. How would I do that?
This is the way Jose did it in his tutorial for PeasyCam. How would I do this for Toxiclibs PolarUnravel.
import peasy.*;
PeasyCam jCam; //1 DECLARE INSTANCE OF the PEASY CAM CLASS
void setup() {
size(600, 600, P3D);
jCam = new PeasyCam(this, 100); //2 INITLIZE PEASY CAM
}
void draw() {
background(100);
box(600);
}
So if I wanted to make my bar chart (example below) do the exact same thing that happens in the PolarUnravel; what would i need to include in my sketch?
void setup() {
size(680, 380, P3D);
smooth();
}
void draw() {
int x = 50;
stroke(111);
for (int i = 0; i < 50; i++) {
line(x, 250, x, i*2);
x+=10;
}
}
Any advice would be much appreciated. Thank you all so much for your time, and enjoy the weekend.
Yes, I know this is like the most simple thing ever. However, I have spent literally hours searching for a simple answer. I've read and re-read the Learning Processing book, and the Visualizing Data (Fry) book. Yet the examples they describe use, like a 'class', or there is another tab in their file which the import process refers too, and there is no explanation on how or why.
All i am trying to do is learn how to use and import the data that is in that file. Ideally to make a visualization (ie, bar chart, or something simple like that).
Here is an example of how my data looks (either comma separated txt file, or comma separated .csv, or .tsv). the idea is the same;