Jump to content
  • Advertisement
Sign in to follow this  
tom_mai78101

Anything with the title: "Beginning DirectX: Top-Down Approach" exists on Earth? Here's my reasons...

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Beware: Wall of Text (All containing my reasoning to the following 2 questions at the bottom of this post.)


----------------------------------------------------------------

"Oh, look, I know how that headline sounds. But, please, walk with me a little and I'll buy you an ice cream." - CNET Tech Review.



Ever heard of "Computer Networking: A Top-Down Approach"? (The title is the link.)

When reading our textbook (that textbook above) from Chapter 1 to Chapter 2, I notice there's something similar to DirectX programming books, yet different in how the content/tutorial/references are read.

For example, suppose we have a DirectX sample written in C or C++ (depending on the preferences of the user) that allows the user to move the camera in first-person mode. Let's say the Y-axis is facing towards you, so you can only see the X-axis and the Z-axis, meaning the Y-axis is the camera's pitch. If the user moves the mouse cursor up and down, the user is "rolling" up and down the camera. If the user moves the mouse left and right, the user is "yawing" the camera left and right, respectively.

If we follow the top-down approach to DirectX, by going along with the perspective the Computer Networking book teaches in, the book might go like this (in my own words, literally):


We know that when we move the mouse, the camera moves along with it. How does it work? When the mouse moves, for each frame the program updates, it first save the last mouse cursor's X and Y coordinates into the memory. During the update, the program then fetches the new X and Y coordinates of the mouse cursor, and compares it to the coordinates stored in memory. From there, we obtain the differences for each coordinates X and Y. We then use the differences, and measure the acceleration of the camera's roll and yaw. Then we calculate the velocity and update the camera's roll and yaw values. And that's how you can see the camera is moving.
[/quote]

The approach is more like a technique such that it gives the reader a new perspective in a particular subject. Or, we can have a smaller example (Might be called the Front-Back Approach, but there's no such name for it.):


All games are programs. For each game you play, you should noticed that for a program to be called a "game", it must require an input, the logic, and the output. And for every logic that you come across, it must have an input and an output. Suppose you want to blit a bitmap picture onto the screen. We call the bitmap, "sprite". To blit a "sprite", you need a "SpriteObject". To get a "SpriteObject", you need a "Texture2D" resource. To get a "Texture2D" resource, you need to obtain it from a bitmap file.
[/quote]

That quote above teaches on how to use deductive reasoning on a specific part of the program's actions. Wouldn't programming books may be more useful, if it collected all of these little information and convey them into something that all beginners and those who aren't too familiar with extensive programming skills?


-------------------------------------------------------------

So, on with my questions:

1. Where can I find such Top-Down Approach books on Game Programming? If doesn't exist, what makes it hard for authors to write such a book? (This has to do with me writing a similar programing book in some future...)
2. Do you think that a top-down approach in programming (or a different approach based on different perspectives) is more helpful? Since, I find that direct logic gives a more emphasis on how things work in programs, and then moving on towards the specific details of that particular action makes what we've learned about more sense.

Share this post


Link to post
Share on other sites
Advertisement

Wouldn't programming books may be more useful, if it collected all of these little information and convey them into something that all beginners and those who aren't too familiar with extensive programming skills?
[/quote]

To be blunt, no.

Graphics programming is not a beginner topic, and it is not unreasonable to expect people to have fairly extensive programming skills if you're authoring a book focusing on an API. Because your book is teaching the API, not how to solve problems. Networking has a fairly limited range in what exists, how it works, and how to make it do what you want. There is no 'do this, then that, like this' to get what you want.

Programming is not a recipe.

Share this post


Link to post
Share on other sites

1. Where can I find such Top-Down Approach books on Game Programming? If doesn't exist, what makes it hard for authors to write such a book? (This has to do with me writing a similar programing book in some future...)
2. Do you think that a top-down approach in programming (or a different approach based on different perspectives) is more helpful? Since, I find that direct logic gives a more emphasis on how things work in programs, and then moving on towards the specific details of that particular action makes what we've learned about more sense.


1. It doesn't exist. You could just as easily write a for a "top-down approach for racing pit mechanics", or "top-down approach for fighter pilots". Lots of people have the job, but there is no direct foolproof route.

2. No. You learn the basics. You learn the fundamentals of algorithms and data structures. Everything in programming stems from those. Then you learn how to apply the same patterns of algorithms and data structures to a wide range of problems. That's what you begin doing during university studies, and they tend to only give enough that you can continue on your own.

Mastery of using and applying the basics takes years. Learning about graphics and AI are just new applications of the same theories. Game programming is mostly applying the same algorithms, you see branch and prune, tree traversals, flow control, sorts and selections, and other fundamentals. Game programming can also encompass many areas requiring knowledge of advanced mathematics. Generally this is part of an engine that few people touch, but it is still something to cover.


You must master the fundamentals before moving on. Just like you start babies not with steak but instead with creamed rice and bland crackers, so to do programmers need to start with basics of flow control.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!