#### Archived

This topic is now archived and is closed to further replies.

# edgebuffer

This topic is 6625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Sorry to bother you guys again..... but my Edge function (the one that fills the edgebuffer) doesnt work, and I cant see whats wrong with it. Please help, thanks in advance here it is:
  void Edge(int leftedge[],int rightedge[],ePixel v1,ePixel v2) { float deltax,deltay; float slope; float x; int y; ePixel temp; if(v1.y > v2.y) {temp = v1;v1=v2;v2=temp;} deltax = v2.x - v1.x; deltay = v2.y - v1.y; slope = deltax / deltay; x = v1.x; for(y = v1.y;y < v2.y;y++) { if(x < leftedge[y]) leftedge[y] = (int)x; if(x > rightedge[y]) rightedge[y] = (int)x; x += slope; } } 

##### Share on other sites
The problem is that ppl do not like debugging someone else''s code.

I always suggest this tip because I learned it in a simple QBASIC class in college around 2 years back.

1) Define what you are going to do..
2) Write down the logic for what you want the computer to do
YOURLOGICLOOP:
3) Break that down even further
4) Analyze logic by playing computer and writing down variables and the outcome on a piece of paper.
5 a) if error then grab an eraser and go back to step 2
5 b) if works jump to YOURLOGICLOOP until all variable limits are valid for the function you are writing
5 c) if error go to step 2 until eraser is gone or brain melts through ears
6) Start translating logic into actual code
7) Have a soda and relax

##### Share on other sites
Maybe I''m missing something, but what exactly is this functions supposed to do? Maybe THEN I can help...

=======================================
A man with no head is still a man.
A head with no man is plain freaky.

1. 1
Rutin
48
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 11
• 16
• 9
• 10
• 13
• ### Forum Statistics

• Total Topics
633003
• Total Posts
3009846
• ### Who's Online (See full list)

There are no registered users currently online

×