I Don't Watch 3D Fund, But....
Re: I Don't Watch 3D Fund, But....
Well, I Was testing the same code as chili and it did not work, and I don't think that's why.
I could be wrong, so I'll give it a try.
I could be wrong, so I'll give it a try.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: I Don't Watch 3D Fund, But....
Ok, I might see the problem, slope ( m ) and intercept ( b ) should be float, not int which also means dx and dy should be float so you don't lose the fraction part of the division result. Don't just cast the result, you need to make dx and dy floats.
Code: Select all
void DrawLine(int x1, int y1, int x2, int y2, Color c)
{
float dx = static_cast<float>( x2 - x1 );
float dy = static_cast<float>( y2 - y1 );
float m = dy / dx;
float b = y1 - m*x1;
for (int x = x1; x <= x2; x++)
{
int y = m*x + b;
PutPixel(x, y, c);
}
}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: I Don't Watch 3D Fund, But....
What the Heck!?!??!!? I can only draw a horizontal line!!!!!
Last edited by goldengamesTM on December 12th, 2017, 2:29 pm, edited 2 times in total.
Re: I Don't Watch 3D Fund, But....
You should just watch his videos. All of them. Five times.
1. 100% speed and take notes
2. 100% speed and use pause to follow in your own VS studio
3. 50% speed, paying attention to whatever you didn't fully get last time
4. 100% speed with your eyes closed and hand on your joystick
5. 200% speed
These are the rituals of the pure and true Chili Minion.
1. 100% speed and take notes
2. 100% speed and use pause to follow in your own VS studio
3. 50% speed, paying attention to whatever you didn't fully get last time
4. 100% speed with your eyes closed and hand on your joystick
5. 200% speed
These are the rituals of the pure and true Chili Minion.
The greatest joy a man can know is to conquer his enemies & drive them before him.
To ride their horses & take away their possessions. To see faces of those who were dear
bedewed with tears & clasp their wives & daughters to his arms.
To ride their horses & take away their possessions. To see faces of those who were dear
bedewed with tears & clasp their wives & daughters to his arms.
Re: I Don't Watch 3D Fund, But....
Thank You, But I Can't Watch Any Chili Vids Except Old Ones. ( No 3D Fund, Or Normal Tutorials From Beginner No.0 And On)
Last edited by goldengamesTM on December 12th, 2017, 2:32 pm, edited 3 times in total.
Re: I Don't Watch 3D Fund, But....
I think you should reconsider watching chillis videos. However, if you don't want to do that, I recommend uploading a ziped solution for your project to get help.
P.S. I recommend being more respectful as people will be less likely to help if you swear at them when they give you a solution you don't want.
P.S. I recommend being more respectful as people will be less likely to help if you swear at them when they give you a solution you don't want.
Computer too slow? Consider running a VM on your toaster.
Re: I Don't Watch 3D Fund, But....
P.P.S. I recommend being more respectful to people, especially people like DicheBach. I mean, have you seen the dude's signature? That's some Robert E. Howard shit right there.
Chili
Re: I Don't Watch 3D Fund, But....
In the name of Crom and his Archangel Chili of the C++ . . .
https://www.youtube.com/watch?v=OBGOQ7SsJrw
https://www.youtube.com/watch?v=OBGOQ7SsJrw
The greatest joy a man can know is to conquer his enemies & drive them before him.
To ride their horses & take away their possessions. To see faces of those who were dear
bedewed with tears & clasp their wives & daughters to his arms.
To ride their horses & take away their possessions. To see faces of those who were dear
bedewed with tears & clasp their wives & daughters to his arms.
Re: I Don't Watch 3D Fund, But....
Ok, So I Have The Triangles, I Have The Wireframe, But Now I Need To Learn How To Fill The Triangles. I Want To Fill Them One Of 2 Ways:
1. I Want To Keep Drawing Triangles Of Slightly Smaller Dimensions Each Time
2. I Can Make Lines That Fill Up The Triangle And Get Smaller Each Time
But, There's A Problem, I Don't Know How To Detect The Edges Of The Triangle...
1. I Want To Keep Drawing Triangles Of Slightly Smaller Dimensions Each Time
2. I Can Make Lines That Fill Up The Triangle And Get Smaller Each Time
But, There's A Problem, I Don't Know How To Detect The Edges Of The Triangle...