Thursday, April 15, 2004
Introduction?? to Programming class
So far I have enjoyed this class as it has been pretty laid back even with an assignment every day. The daily assignments so far have consisted of nothing more that check a website and report on what you think of it. This week we had our hands off programming lab where we actually had to come up with the code on our own. I had no major problems (once I got my calculation formatted correctly) but it seems others did so I decided to think like a true beginner programmer to see why.
As I look back at what we have done so far in the book and in online lessons I realize that we have not really learned why you do anything in the code yet. This seems strange to me as it is the end of the second week and we are being asked to write code on our own already without being taught this. I can now see why those that are truelly new to programming are having a problem with this lab. The first question that another student posted about this lab was one that shocked me at first until I thought back to the lessons.
The question was:
"I'm having a problem with Lab#2. I don't understand the codes enough to write them on my own. Is there something that explains the code section in more detail?"
My first response was a quick one thinking that he just did not understand where to start:
"If you look back at the first lab you should be able to fill in the missing information.
The Constants are already defined and the code to calculate Gross Pay is already in the PDF so you already know some of the assignments that need to be created."
It was his next question though that really got me thinking and made me look back at what we had learned already:
"Thanks for the help! But, alas, I need more. With the code, I don't understand what it means. Like the line, "Dim sngCost As Single" from the first lab. I think if I know exactly what this meant, I'd have more luck with writing on my own, but I don't understand what "Dim" or "sng" or "As Single" mean."
Now this is a very important thing to understand when you are starting to code. You really should know what you are doing when you are creating your variables yet the lessons have not covered what that line means at all. I went through and explained what each part meant then rewrote the line using English (Create a variable of type Single and name it sngCost) and that seemed to help. It also brought a lot of others that were having problems into the discussion.
All of a sudden I am like the only one posting in the class forums (15% of our grade is our posts) that understands any of the coding needed to Declare variables and then use them to Calculate and Display the results. I realize now that I am in the minority in the class since I have previous programming knowledge.
Anyway, hopefully I can help the others learn a lot from this class even if we are being asked to do stuff before we have been taught how to do it.
John Winkle
|
So far I have enjoyed this class as it has been pretty laid back even with an assignment every day. The daily assignments so far have consisted of nothing more that check a website and report on what you think of it. This week we had our hands off programming lab where we actually had to come up with the code on our own. I had no major problems (once I got my calculation formatted correctly) but it seems others did so I decided to think like a true beginner programmer to see why.
As I look back at what we have done so far in the book and in online lessons I realize that we have not really learned why you do anything in the code yet. This seems strange to me as it is the end of the second week and we are being asked to write code on our own already without being taught this. I can now see why those that are truelly new to programming are having a problem with this lab. The first question that another student posted about this lab was one that shocked me at first until I thought back to the lessons.
The question was:
"I'm having a problem with Lab#2. I don't understand the codes enough to write them on my own. Is there something that explains the code section in more detail?"
My first response was a quick one thinking that he just did not understand where to start:
"If you look back at the first lab you should be able to fill in the missing information.
The Constants are already defined and the code to calculate Gross Pay is already in the PDF so you already know some of the assignments that need to be created."
It was his next question though that really got me thinking and made me look back at what we had learned already:
"Thanks for the help! But, alas, I need more. With the code, I don't understand what it means. Like the line, "Dim sngCost As Single" from the first lab. I think if I know exactly what this meant, I'd have more luck with writing on my own, but I don't understand what "Dim" or "sng" or "As Single" mean."
Now this is a very important thing to understand when you are starting to code. You really should know what you are doing when you are creating your variables yet the lessons have not covered what that line means at all. I went through and explained what each part meant then rewrote the line using English (Create a variable of type Single and name it sngCost) and that seemed to help. It also brought a lot of others that were having problems into the discussion.
All of a sudden I am like the only one posting in the class forums (15% of our grade is our posts) that understands any of the coding needed to Declare variables and then use them to Calculate and Display the results. I realize now that I am in the minority in the class since I have previous programming knowledge.
Anyway, hopefully I can help the others learn a lot from this class even if we are being asked to do stuff before we have been taught how to do it.
John Winkle
Tuesday, April 13, 2004
Switching back to C++ after years of C# is not as easy as I thought
While it is not hard to do, I have hit a few stumbling blocks switching back to coding in C++ for my class after coding in C# the past few years. While a lot of the syntax is still the same I keep hitting the little things like the new enhancements to C# that I am used to using that are not always available in C++. This combined with the fact that most of the sample code was written for C++ 6.0 and I am using Visual Studio.NET makes it so I have to go back to some of my old books to remember certain little things.
There are some things though that I originally did not understand when I first learned C and C++ but now I completely understand after using C# for so long. One of these things is using Classes. When I first started coding in C++ I did not fully understand classes and the benifits of using them. Now that I have been using C# I found myself trying to use classes even before I got to the lessons on using them in this course.
Tonight I plan to find more blogs out there with people new to game programming and see if I cannot learn from their questions and maybe help them and myself at the same time.
|
While it is not hard to do, I have hit a few stumbling blocks switching back to coding in C++ for my class after coding in C# the past few years. While a lot of the syntax is still the same I keep hitting the little things like the new enhancements to C# that I am used to using that are not always available in C++. This combined with the fact that most of the sample code was written for C++ 6.0 and I am using Visual Studio.NET makes it so I have to go back to some of my old books to remember certain little things.
There are some things though that I originally did not understand when I first learned C and C++ but now I completely understand after using C# for so long. One of these things is using Classes. When I first started coding in C++ I did not fully understand classes and the benifits of using them. Now that I have been using C# I found myself trying to use classes even before I got to the lessons on using them in this course.
Tonight I plan to find more blogs out there with people new to game programming and see if I cannot learn from their questions and maybe help them and myself at the same time.
VB.NET is ok, I still prefer C#
Ok, I have now finished the second Lab in my Intro to Programming with VB.NET class and I must say that I still prefer C#. It could be simply that I am used to coding in C# but I think it is more along the lines of how some of the stuff is written. I keep forgetting that in VB.NET I need to add the " _" before I move my code to a new line or it will consider that statement as ended. I prefer having every statement end with the semicolon so you can seperate it onto multiple lines for readability easier.
I am enjoying the class so far and am not having any problems with anything assigned yet. So far the daily homework has consisted of "Check out XYZ website and then post on the class forums what you think of it" where the website has something to do with VB.NET. The 2 labs so far were fairly straightforward and the first project was quickly finished.
|
Ok, I have now finished the second Lab in my Intro to Programming with VB.NET class and I must say that I still prefer C#. It could be simply that I am used to coding in C# but I think it is more along the lines of how some of the stuff is written. I keep forgetting that in VB.NET I need to add the " _" before I move my code to a new line or it will consider that statement as ended. I prefer having every statement end with the semicolon so you can seperate it onto multiple lines for readability easier.
I am enjoying the class so far and am not having any problems with anything assigned yet. So far the daily homework has consisted of "Check out XYZ website and then post on the class forums what you think of it" where the website has something to do with VB.NET. The 2 labs so far were fairly straightforward and the first project was quickly finished.
Monday, April 12, 2004
Finally a Math Challenge
I have finally found a Math class that is a challenge. Ok, to say that I guess I need to give some background info. Until High School I got straight A's in every Math class I took (even High School math I took in Middle School). Once I hit High School they actually wanted me to do the homework to get an A. I learned the material so fast that the homework to me was very boring as I understood it the first time (let alone the other 10+ times) the teacher explained it to the class. Even with the sparse amount of homework I actually did in high school math, I still had one of the top 3 scores on every math test and passed each of them with at least a C+.
Last quarter I had to take Math 90 (pre-calc) as it had been 10 years since school and so I had forgotten all the formulas needed for a lot of the questions on the placement test. I breezed through it getting 95-100% on all the pretests and passing with a 4.0 in the end.
Now I am in Game Mathematics and I have to actually use all of the stuff I have learned and apply it to situations that I would never have thought of. This is the first time that I have ever had to actually study to understand math concepts and I am loving it. I am already working on the work for the fourth week even though the second week started today but that is standard for me. The first issue that really has me thinking is an issue that almost nobody encounters anymore as all the software does all the work for you now. This was one of the exercises at the end of the third week that I am working through even as I continue on. I will be heading over to my buddy's house, Justin Rogers, either tomorrow or Wednesday and he is going to assist me with this and a few other things that I am sure to encounter tonight and tomorrow but I figured I would also toss it up here to see what input others have.
Texture mapping is the process of mapping a bitmap onto a polygon. You are given a two dimensional polygon described by n points (ordered pairs). With each point, you are also given another ordered pair that specifies a location on a bitmap corresponding to that point. In order to map the texture onto the polygon, as you display each pixel of the polygon you must find out which location in the bitmap corresponds to that pixel. Describe how you might use binomials to solve this problem.
Now this is all about the Math in figuring this out. This class focuses just on the Math and not on the coding itself as that is for another class. After first mentioning this to Justin his was, "I could probably code the solution faster than figuring it out mathematically. I have done this hundreds of times but that was years ago." Since that is not the way they are asking me to solve it, we are going to sit down together and work through this.
My teacher gave me an explanation that I am starting to understand as I work through it and the "answer" sheet that we are given also explains it but neither is a way that makes complete sense to me.
Exercise Answer: You can use binomials as follows: interpolate the texture coordinates down the edges of the polygon, and then across the rows. You need two binomials per texture coordinate (one for the x component, one for the y).
Teacher Explanation:
This process is twofold. You draw the polygon one horizontal row at a time.
For the given row, you need to compute the texture coordinates for left and right side.
Once you do this, you need to loop through all the pixels in the row, computing the texture coordinate for the current pixel.
Two binomials f(x) = ax + b can be used for the two texture coordinates (u and v) to find the texture coordinates for the left side. Two more for the right side. Then two more to determine the texture coordinate at a given pixel in the row.
I am sure once I sit down with Justin and work through it with someone that has done this before, I will be able to understand it and then rarely use it but at least I will understand what the current software does for me already.
John Winkle
|
I have finally found a Math class that is a challenge. Ok, to say that I guess I need to give some background info. Until High School I got straight A's in every Math class I took (even High School math I took in Middle School). Once I hit High School they actually wanted me to do the homework to get an A. I learned the material so fast that the homework to me was very boring as I understood it the first time (let alone the other 10+ times) the teacher explained it to the class. Even with the sparse amount of homework I actually did in high school math, I still had one of the top 3 scores on every math test and passed each of them with at least a C+.
Last quarter I had to take Math 90 (pre-calc) as it had been 10 years since school and so I had forgotten all the formulas needed for a lot of the questions on the placement test. I breezed through it getting 95-100% on all the pretests and passing with a 4.0 in the end.
Now I am in Game Mathematics and I have to actually use all of the stuff I have learned and apply it to situations that I would never have thought of. This is the first time that I have ever had to actually study to understand math concepts and I am loving it. I am already working on the work for the fourth week even though the second week started today but that is standard for me. The first issue that really has me thinking is an issue that almost nobody encounters anymore as all the software does all the work for you now. This was one of the exercises at the end of the third week that I am working through even as I continue on. I will be heading over to my buddy's house, Justin Rogers, either tomorrow or Wednesday and he is going to assist me with this and a few other things that I am sure to encounter tonight and tomorrow but I figured I would also toss it up here to see what input others have.
Texture mapping is the process of mapping a bitmap onto a polygon. You are given a two dimensional polygon described by n points (ordered pairs). With each point, you are also given another ordered pair that specifies a location on a bitmap corresponding to that point. In order to map the texture onto the polygon, as you display each pixel of the polygon you must find out which location in the bitmap corresponds to that pixel. Describe how you might use binomials to solve this problem.
Now this is all about the Math in figuring this out. This class focuses just on the Math and not on the coding itself as that is for another class. After first mentioning this to Justin his was, "I could probably code the solution faster than figuring it out mathematically. I have done this hundreds of times but that was years ago." Since that is not the way they are asking me to solve it, we are going to sit down together and work through this.
My teacher gave me an explanation that I am starting to understand as I work through it and the "answer" sheet that we are given also explains it but neither is a way that makes complete sense to me.
Exercise Answer: You can use binomials as follows: interpolate the texture coordinates down the edges of the polygon, and then across the rows. You need two binomials per texture coordinate (one for the x component, one for the y).
Teacher Explanation:
This process is twofold. You draw the polygon one horizontal row at a time.
For the given row, you need to compute the texture coordinates for left and right side.
Once you do this, you need to loop through all the pixels in the row, computing the texture coordinate for the current pixel.
Two binomials f(x) = ax + b can be used for the two texture coordinates (u and v) to find the texture coordinates for the left side. Two more for the right side. Then two more to determine the texture coordinate at a given pixel in the row.
I am sure once I sit down with Justin and work through it with someone that has done this before, I will be able to understand it and then rarely use it but at least I will understand what the current software does for me already.
John Winkle
This weeks coding exercise for my Introduction to Programming with VB.NET class looks like it will be pretty easy but I thought I would still share it here. At this point the labs are more to get you used to the Visual Studio IDE which I am already familiar with so I am spending time enhancing the code the best I can. I have actually already finished the first Project in the class (finished it on the second day of class last week) which is not due until 4/22 and keep updating the code with little tidbits I read about or remember.
Here is my lab for the week that I get to make (or get to finish as I have made most of it already):
Employees at XYZ company get $28 per hour regular pay for a 40-hour workweed and are paid time and a half for overtime. Withholdings from the gross pay include federal tax = 20% * (gross - dependents * 48.60) and state tax = 3.2% * gross pay. Draw a flowchart to determine the net weekly pay for an employee. Assume input of Hours Worded and Number of Dependents.
There are more directions like a screenshot of what the form should look like and such but you should get the idea. It has been many years since I have used flowcharting but I still remember it and so my whiteboard (the part not covered with my daughter's drawings) is covered in the flowchart for this project. The coding for this is going to be pretty easy to do and the layout was a breeze. I am really looking forward to some of the later projects that will challenge me some.
John Winkle
P.S. Next I will type of some of the C++ for Game Programmers and then some of the Game Mathematics stuff that I am working on.
|
Here is my lab for the week that I get to make (or get to finish as I have made most of it already):
Employees at XYZ company get $28 per hour regular pay for a 40-hour workweed and are paid time and a half for overtime. Withholdings from the gross pay include federal tax = 20% * (gross - dependents * 48.60) and state tax = 3.2% * gross pay. Draw a flowchart to determine the net weekly pay for an employee. Assume input of Hours Worded and Number of Dependents.
There are more directions like a screenshot of what the form should look like and such but you should get the idea. It has been many years since I have used flowcharting but I still remember it and so my whiteboard (the part not covered with my daughter's drawings) is covered in the flowchart for this project. The coding for this is going to be pretty easy to do and the layout was a breeze. I am really looking forward to some of the later projects that will challenge me some.
John Winkle
P.S. Next I will type of some of the C++ for Game Programmers and then some of the Game Mathematics stuff that I am working on.
Well, I think my first post should be about me. I am a 27 year old college student going for a certificate in Computer Game Development. I am scheduled to finish the program in the Spring of 2005. I am starting this blog so I have a place to post what I have learned and what I want to learn more of from this program and from other developers.
I have been in the computer industry for the last 8 years or so working in Tech Support for a year then on to Software Testing for most of the rest of the time with some Test Lead work also. As the software test industry is getting more and more stagnant with a lot of work being shipped over seas, I have decided to get more into the programming side of things. I have done some odds and ends programming throughout my years as a tester and so have some knowledge of what I am getting into already.
Currently I am in 3 online classes: Introduction to Programming with VB.NET (pre-req for other classes so needed it), Game Mathematics, and C and C++ Review (for game developers). The only one that I am having any issues in so far is the Game Mathematics as the other 2 are just review for me. I am hoping to be able to post many questions along with a lot of information about stuff I have learned here. Who knows, one day this blog might become a shrine to my infinite knowledge of Game Programming (yeah right).
John Winkle
|
I have been in the computer industry for the last 8 years or so working in Tech Support for a year then on to Software Testing for most of the rest of the time with some Test Lead work also. As the software test industry is getting more and more stagnant with a lot of work being shipped over seas, I have decided to get more into the programming side of things. I have done some odds and ends programming throughout my years as a tester and so have some knowledge of what I am getting into already.
Currently I am in 3 online classes: Introduction to Programming with VB.NET (pre-req for other classes so needed it), Game Mathematics, and C and C++ Review (for game developers). The only one that I am having any issues in so far is the Game Mathematics as the other 2 are just review for me. I am hoping to be able to post many questions along with a lot of information about stuff I have learned here. Who knows, one day this blog might become a shrine to my infinite knowledge of Game Programming (yeah right).
John Winkle