Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
Originally posted by Greg Roberts:
If the element [w][h] is 0,0 than that element should be at pixels[0]. If it is 0,1 than that value should be placed into pixels[1]. I just need to figure out how to do that...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
Originally posted by Greg Roberts:
... But it doesn't seem to work either.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
I see that this is what getPixels is supposed to do. But how exactly it does this depends on how these "rows" and "columns" are stored in your 2-dimensional array. For example, suppose you have a 2-d array like this (using characters instead of zeros and ones so we can keep track of exactly what's where)...
{ {a, b, c}, {d, e, f}, {g, h, i}, {j, k, l} }
Now, does this 2-d array represent 4 columns and 3 rows? Or is it 3 rows and 4 columns? In other words, do we have array[x][y] or array[y][x]? This isn't so obvious, because the way I would interpret this visually is...
cfil
behk
adgj
Why? First, I'm using array[x][y] -- that is, an array that holds arrays representing columns (not rows). Second, I assume that as y increases, the corresponding position should move upward (not downward).
[ September 19, 2005: Message edited by: marc weber ]
Greg Roberts<br />CIS Student<br />University of West Florida
Greg Roberts<br />CIS Student<br />University of West Florida
Originally posted by Layne Lund:
... I see it this way because of my mathematical background...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
Hmmm, that's interesting. I majored in mathematics, and I thought that was the reason for my interpretation. But I was thinking in terms of a Cartesian system rather than a linear matrix.
Originally posted by Greg Roberts:
... I've got it marking the two endpoints and then marking all points in between, but that can't be right...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by Greg Roberts:
...if (xStart,yStart) and (xEnd,yEnd) are the same point, it should reject the line...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
Sorry, I got that wrong. It should be...
[ September 20, 2005: Message edited by: marc weber ]
Originally posted by Greg Roberts:
<hr></blockquote>
But the problem is, its looking at them as individual int's, instead of looking at the whole picture, which is that they are pairs of int's that represent a point in a coordinate system. xStart can be the same as xEnd, -or- yStart can equal yEnd, but if xStart, yStart, xEnd, and yEnd are all the same, then the start and end points on the graph would be the same point, representing a point instead of a line.[/QB]
Originally posted by Layne Lund:
...Assuming that the endpoints of the line are (xStart, yStart) and (xEnd, yEnd), you had it right the first time. You shouldn't compare x-coordinates to y-coordinates...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
Originally posted by Greg Roberts:
if((xStart != xEnd)&&(yStart != xEnd))
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Or, in Java, if( !((xStart == xEnd) && (yStart == yEnd)) ) {...
Greg Roberts<br />CIS Student<br />University of West Florida
Originally posted by Greg Roberts:
...how would I run a check to see if the line is vertical, horizontal, or diagonal and then tell it how to proceed form there? ...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
I would consider how a function is graphed: As you move along the x axis from xStart to xEnd (or perhaps in the other direction, depending on which value is greater), you determine the corresponding y value.
Note that the slopes of "perfect" diagonals, (yEnd-yStart)/(xEnd-xStart), will always be 1 or -1. And the sign of this number will probably determine how you go about drawing it -- that is, whether you increment or decrement in your code.
Greg Roberts<br />CIS Student<br />University of West Florida
Greg Roberts<br />CIS Student<br />University of West Florida
Greg Roberts<br />CIS Student<br />University of West Florida
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Consider Paul's rocket mass heater. |