Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
seasea1
seasea1's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
please help nub with arrays and for()
[2 Replies]
16-May-2013 03:15 AM
Forum:
Core Library Questions
why i cant see diagonal line, instead i see only last rect (300,300)
this my code
Ring myRing;
void setup(){
size (700, 400);
background(0);
myRing = new Ring();
}
void draw() {
myRing.Massive();
myRing.display();
}
class Ring {
int numPoints;
float[] x;
float[] y;
float offset;
Ring(){
numPoints = 300;
x = new float[numPoints];
y = new float[numPoints];
offset = 8;
}
void Massive() {
for (int i = 0; i < x.length; i++) {
x[i] = i;
y[i] = i;
}
}
void display() {
for (int i = 0; i < x.length; i++){
rect(x[i], y[i], 5, 5);
}
}
}
«Prev
Next »
Moderate user : seasea1
Forum