# The Perfect K

Member

5

103 Neutral

• Rank
Newbie

• Interests
Programming
1. ## How is Discrete Math used in video games

Heh, I do suppose that's true, and much to your sub-point at the end of your original post. Funny thing though, the very first bits of calculus I learned was pretty much this how to transform to discrete values in order to solve equations by hand (or with a calculator). It sort of blurs the line, in my mind at least, when calculus ends and begins. But hey, at least through this back and forth we gave the OP an other example of how discrete computation is important in computer programming.
2. ## How is Discrete Math used in video games

Hoo boy, I know this is a topic on discrete math, but I just wanted to chime in and say that I use calculus all the time in programming. Any type of signal processing is going to need calculus. Fourier transforms in particular are extremely useful for, say, virtual reality or eeg programming. Dead reckoning positional tracking is essentially all calculus. Any time you have anything that is sample based over time, you're going to be using calculus. This applies to both EE and general comp sci.
3. ## Do you think using Unreal Engine could cripple the basics of a begginner programmer?

I think there is real value in lowering the barrier for entry to computer programming, personally. Game development is a perfect example of how many different disciplines a person must be competent in before they can start pumping out programs of real worth. Using an example from non-game dev experience I've had, I once did a project with a doctor, who had all sorts of doctor problems and wants he needed solved by a computer program, but who wasn't a computer programmer. He very intimately understood his industry and the type of problems he'd run into, but had no way to put it into a program. After several weeks of back and forth of him teaching me things he'd needed to communicate for me to build his program for him, it wound up that the programming aspect of the project was actually pretty simple. Most of the time was actually getting me, the developer, up to speed in his area of expertise. I often think of the number of people who have life-altering ideas that they just cannot translate into a program. Every skill someone is required to pick up is a barrier to entry that'll turn away a percentage of the potential total developer population. This is a bit at odds with my general advice that someone looking to strengthen their grasp of computer programming should start low, with old hardware, so that they can fully grasp the ins and outs of talking to a machine. Indeed, computer programming knowledge is very cumulative. But put it this way -- how many great authors would we have lost, if it was a prerequisite that one knows how to press and form their own paper by hand?

5. ## SDL - Saving large images?

I'm having a strange problem with SDL and I'm not too sure where to find out how to solve it. My dad bought a commercial large scanner to help him archive a bunch of architectural drawings he has. Only problem is that the scanner's thread is messed up, and thus a large, thick black line appears in the middle of all his scans. He's not too computer savvy, so he asked me if I could write a program that would automatically crop out the black line that appears on his scans. That normally wouldn't be a problem, except that his scans are 14650x14650 big. I'm running into a problem with SDL when I'm trying to save the resulting cropped image as a bmp. I've tried two methods with differing results. If I load the image into a surface then try to save that surface, I get a small blank BMP as a result. Pseudo code as follows: SDL_Surface* Image; Image = load_image("Scan.bmp") ~~a bunch of stuff that crops image~~ SDL_SaveBMP(Image, "Output.bmp"); that would result in a file called output.bmp that is just a tiny white square. If I blit image onto a screen surface (or really any other surface that's not that big) I can save the bmp, but it'll only save the size of the surface. Pseudo code as follows: SDL_Surface* screen; SDL_Surface* image; ~~~code which sets up screen to be 1280x768 big~~ image = load_image("Scan.bmp"); ~~~code which blits image to screen~~ SDL_SaveBMP(screen, "Output.bmp"); That would result in a bmp called Output, which is 1280x768 big, which contains a corner of the scan. I'm guessing the problem lies with trying to work with such a large image. I've been trying to look up documentation to see if there are any size restrictions on SDL_SaveBMP but I can't find anything. Anyone know what could be causing this? Or maybe an alternative method I could use?
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!