// each node gets its properties here in the Constructor
xpos = tempX;
ypos = tempY;
} // Constructor
//
void display () {
stroke(255, 0, 0);
fill(70);
smooth();
int radius = (400);
// use the individual properties to draw one node
ellipse (xpos + radius, ypos + radius, 8, 8);
//links to .txt file to draw bezier splines between nodes
//if
} // func
//
} // class
What I am essentially trying to do is create an inner and outer circle comprised of points (and the number of points need to be able to change) and then connect certain points using a bezier when I rollover those points.
I am trying to create a class and then reference objects from that class.
I've created a class called nodes (the points).
I've made a large inner and outer circle out of these nodes.
I can find the x and y position of each individual node using this part of the code.
Node node = (Node) nodes.get(1);
println (node.xpos + 400);
println (node.ypos + 400);
Then I can individually input each of these coordinates and create a bezier spline to connect certain nodes to each other using a string to read information from a .txt file where I have manually input all of the node locations. The biggest problem with doing it this way is that if the number of nodes changes, then I have to go back and find the x and y position of each node again and then manually input all of the information again.
Here is an image of what it should look like:
It seems that there should be a way to say draw a bezier between one node and another node without having to go through all of this manually input.
If anyone can help, thanks! If you need more information of if you need the .txt files, I can send them to you but I can't find a way to attach them on this forum.
Does anyone know if I can use the text in a .txt file as text in a processing sketch? For example, say I want to have a paragraph of text show up in my processing sketch. Can I link it from a file so I don't have to type it all in to the sketch? Also, if I can do this, can I edit bits of the text separately or will processing read it all as one file?
I'm trying to create a class called node that will draw a series of circles that can then have functions. I want this series of circles to be drawn around a larger circle. I'm having trouble setting up the class. It also tells me I'm switching between active and static modes. Help, can anyone tell me what I'm doing wrong?
I'm trying to create a large circle composed of a variable number of points ( or smaller circles ). I can do this by making each smaller circle individually, but it seems like I should be able to create an array. I want to be able to access each of the smaller circles and make changes to it (color, etc.) without affecting all the smaller circles. Does anyone know how to do this? I'll include the code I've written to create each circle individually and the code I wrote that is much shorter and works, but I don't know how to access each smaller circle individually in this code. Please help!!!
//first code where I create each smaller circle individually