• Math for Game Programming class walkthrough
    10 replies, posted
I am currently taking a class for "Math for Game programming". I would like to do a Walk through of every week I spend in that class. The class includes math. It also include programming. It include integrating said math into said programming. We were given a "3D environment" program to work on projects past week1. So far, I've got 1 week done. Would it be alright if I did a class walk through here? This is me attempting a "focus strategy". I heard that teaching is one of the best ways to learn. It has a 70% retention rate. Or something of that nature. Currently working with derivatives.
I cannot see any problems with it. Could be useful!
Sounds great, looking forward to your lessons.
Go for it. I suck at math, sadly. :/
Being a programmer that sucks at math is difficult, but thank fuck I have Google!
That would be cool. Teaching others always helps me hold onto info, and my math is OK at best.
If any if you guys who are pro with the numbers wana lend me a hand with something that fucks my mind beyond belief, pm me.
I will be able to make my uploads tomorrow. Currently I'm at work. Sorry I haven't gotten to this earlier. Don't worry, I'll start with everything in week 1.
Week 1 Discussions [B]How is speed defined? How is velocity defined? How are they different?[/B] My answer (in response to someone else's): Can vectors be non dimensional? Just a curious question. I often thing about how speed is defined through spans of time; I know this isn't relevant to what we're learning in class, but I wonder how it's defined at the finest level of physical axioms. In a game, we can give an object a "speed" variable so that every frame/step it will traverse a certain amount of pixels based on that variable. Because of this an object is literally skipping space(pixels) if the speed is larger than 1pixel. If the speed is larger than the length of the body(parallel to the vector) the object could completely skip pixel. This is a concern for collision testing. (there are easy measures to fix this, but let me bring up my greater point) If the speed of the object is triple that of its vector-parallel length, then it could jump over entirely an object within its path. Our cutting edge quantum physicist don't know yet, so I don't expect anyone to; does the universe work in such a fashion? Or does it have some "thorough" collision checking algorithm to handle this? Axioms of existence are very interesting topics. [B]A car traveling along a straight line accelerates from 30 mi/hr to 70 mi/hr in 60 seconds. Assume that the acceleration is constant. Which equation of motion would you use to find the acceleration? What is the acceleration?[/B] My answer: I honestly don't know the equation by formal name, but by looking at the problem one can tell that there has been a change of "40" units within a period of "60" time units. Acceleration is change in speed over time. The change in speed is 40 within the time limit of 60 seconds. That is an increase in 2/3 mph per second. You can cross check that result multiplying 60 by 2/3. You'll end up with 40. 40 added to the original 30 is 70! [B]BOOK PROBLEMS[/B] [B]1.) [/B]Suppose you’re programming a moving platform for the player to jump on. The platform can move only left (–) and right (+). The platform is moving at a constant velocity of –6.5px/s. If it’s currently at the 450-pixel mark, where should it be 5 seconds later (assuming that it hasn’t reached the point where it turns around)? [B]2.)[/B] Suppose your character runs 28 meters in 20 seconds. What’s his average speed for that 20-second time interval? [B]3.)[/B] Suppose the player in question 3 realizes he forgot something, so he turns the character around and runs back to where he started. What’s his average velocity for the entire run? [B]4.) [/B]Suppose an object in your game is at the 500-pixel mark in one frame. In the next frame, it’s positioned 50-pixel mark. What is its instantaneous velocity in that frame, assuming 30fps? [B]5.)[/B] Suppose you are driving along, and you are forced to slam on the brakes. In 3 seconds, you go from 50mi/hr to a complete stop. What is your deceleration in m/s2? [B]6.)[/B] A speedboat increases its speed from 12m/s to 28m/s over a distance of 500m. What is its rate of acceleration? How much time would it take the boat in question 1 to go the 125m?' [B]7.)[/B] A ball is thrown upward at a speed of 16m/s. How much time does it take to reach its maximum height? What is the maximum height the ball in question 5 reaches? I will post my answers & [B]SOLUTIONS[/B] to the book questions once I get home. [editline]20th September 2012[/editline] week 2 Discussion: [B]Explain the concept of a limit. How would you determine the limit as x goes to 0 of tan(x)/(3x) by making a table of values? By the way, be sure to have your calculator in radian mode.[/B] My answer: (it was not even remotely related to the original question, it'd be hard to understand without the context) [B]What is the difference between average velocity and instantaneous velocity?[/B] My Answer: A derivative will show the change over time in the higher displacement related attribute. A derivative of displacement will show velocity. A derivative of velocity will show acceleration. From what I've briefly theorized, derivatives will always hit a flat line of 0 if you go far enough. I've never seen a system of nomials what have a potential for infinite derivatives yet are contained within real number (not infinity) [B]BOOK PROBLEMS[/B] [B]1.)[/B] Looking back at the tomato described in Example 9.1, find its average velocity for the following time intervals: 1 ≤ t ≤ 6 1 ≤ t ≤ 5 1 ≤ t ≤ 4 example 9.1{{ Using the data just discussed, find the average velocity of the tomato for the time interval 3 ≤ t ≤ 5 seconds. 1. Looking at the data, you need to know the height of the tomato at t = 3s and t = 5s: f(3) = 162 f(5) = 106 2. Calculate the average velocity, or the slope between those two points: [img]http://f2.braxupload.se/zaswo7.untitled.png[/img] }} [B]2.)[/B] Looking back at the grenade described in Example 9.2, find its instantaneous velocity at t = 4s. example 9.2{{ Suppose you’re coding a game like Half Life and the player can throw a grenade into the air, and its height is a function of time, just like the tomato. If its height is y = f(t) = t2 + 5, find the instantaneous velocity at t = 3s. 1. To find the instantaneous velocity at exactly t = 3s, you need to take the average velocity over smaller and smaller time intervals. In other words, take the limit of f(t) as the change in time approaches 0: [img]http://f2.braxupload.se/7x4boj.1.png[/img] 2. Calculate both heights using the formula y = f(t) = t2 + 5: [img]http://f2.braxupload.se/hhmvb6.2.png[/img] }} [B]3.) [/B]Using the data from Table 9.2, find the average acceleration of the race car for the time interval 0 ≤ t ≤ 5 seconds. Helpful formula [img]http://f2.braxupload.se/iz759i.4.png[/img] example 9.2 {{ [img]http://f2.braxupload.se/xv62vi.3.png[/img] }} [B]4.)[/B] The velocity of the grenade in Example 9.5 is a function of time: v = f(t) = –11.8t + 12. Find its instantaneous acceleration at t = 4s. [img]http://f2.braxupload.se/rlg0gt.5.png[/img] [B]5.)[/B] Suppose an object’s position is a function of time: y(t) = 25t – 3t2. Find its acceleration at t = 5s. I will post my answers & [B]SOLUTIONS [/B]to the book questions once I get home.
Seems to be a funny math book with grenades and stuff!
[QUOTE=AlienCat;37761767]Seems to be a funny math book with grenades and stuff![/QUOTE] That's because it's a "math for game programming" class. They try to be real "immersive" with their math problems. [editline]23rd September 2012[/editline] oh. let me go post my answers & solutions. I forgot. Life stuff. I'll be uploading the iLab stuff too. That stuff gets pretty intense. I forgot to do that part. [B]Week 1 Solutions THAT I HAD[/B] (I know one of them is wrong) [IMG]http://i.imgur.com/B3AOo.png[/IMG] [IMG]http://i.imgur.com/fnPUo.png[/IMG] [IMG]http://i.imgur.com/Kc8ks.png[/IMG] [IMG]http://i.imgur.com/VwPKx.png[/IMG] Week 1 solutions: [url]http://www.filehost.ws/uedmaius1s1e[/url] (if you have any better file hosts in mind. please let me know) [B]Week 2 solutions THAT I HAD[/B] (got all these bitches right) [IMG]http://i.imgur.com/d8fCB.png[/IMG] [IMG]http://i.imgur.com/d8fCB.png[/IMG] Now it's time to bring up the actual programming pieces. I'm not sure how to do this. though. Should I give you the instructions and the final result? For the ilabs, we've been building off the same project for 2 weeks. Here is the result of what we have now. [url]https://dl.dropbox.com/u/20161227/ilab-as-of-week-2.zip[/url] As I complete week 3 I will detail the process... via video?
Sorry, you need to Log In to post a reply to this thread.