数学和游戏编程
我想要编写比我已经知道的基本 2D 内容更复杂的图形 2D 游戏。 我不想进行 3D 编程。 只是更复杂的 2D 东西。 在我能学到很多东西之前,我从高中辍学了,所以我带着足够的代数知识来平衡我的支票簿并做了一些简单的二维笛卡尔编程。
对于注意力有限的人(例如我非常感兴趣的主题,每人 20 分钟),是否有任何好的资源可以帮助他们逐步学习如何在编程中使用数学做一些更有用的事情?
I want to program graphical 2D games more complex than the basic 2D stuff I already know. I don't want to do 3D programming. Just more complex 2D stuff. I dropped high school before I could learn a lot of stuff so I walked away with enough algebra knowledge to balance my checkbook and do some light 2D Cartesian programming.
Are there any good resources out there for a guy with a limited attention span (say 20 minutes apiece for a subject I'm keenly interested in) to learn, gradually, how to do something more useful with math in programming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
如果您想要一个通用数学网站,我推荐 planetmath.org。 那里的文章往往比维基百科拥有更高的标准(根据我的经验,当涉及到数学时,维基百科可能会令人震惊)并且比数学世界更用户友好。 如果您是一名数学家并且需要某些术语的完整正确定义,那么 Mathworld 是不错的选择,但对于日常使用来说,它往往过于理论化和迟钝。
If you want a general math website I'd recommend planetmath.org. The articles there tend to hold a higher standard than wikipedia (which in my experience can be downright appalling when it comes to math) and are more user friendly than mathworld. Mathworld is good if you are a mathematician and need the complete correct definition of some term, but for day to day use it tends to be far to theoretical and obtuse.
您可以从学习 Processing! 开始
,然后阅读 Daniel Shiffman 撰写的这本精彩的书,名为“代码的本质'。 这本书还可以在线获取,其中包含用Processing.js编写的交互式示例
http://natureofcode.com/book/
这本书涵盖了
他还上传了视频到 Vimeo,解释每章的概念!
http://vimeo.com/shiffman/videos/sort:date/format:detail
他还写了一本书来教您学习处理
http://www.learningprocessing.com/
You can start out by learning Processing!
Then move onto this amazing book by Daniel Shiffman called 'The Nature of Code'. The book is also available online with interactive examples written in Processing.js
http://natureofcode.com/book/
The book covers
He also has uploaded videos to Vimeo explaining concepts from each chapter!
http://vimeo.com/shiffman/videos/sort:date/format:detail
He has also written a book to teach you the basics of Learning processing
http://www.learningprocessing.com/
奇怪的是,我在维基百科中发现了很多关于线性代数的有用内容:http://en。 wikipedia.org/wiki/Portal:数学
一般来说,它不是最好的知识来源,但数学还可以。
Strangely I've found a lot of useful stuff on linear algebra in Wikipedia: http://en.wikipedia.org/wiki/Portal:Mathematics
Generally it's not the best source of knowledge, but math there is ok.
我推荐 Wolfram 的资源:http://mathworld.wolfram.com
它们很厚,但我知道没有更好的在线资源。
I recommend Wolfram's resources: http://mathworld.wolfram.com
They're thick, but I know of no better online resource.
您可能想查看有关该主题的任何 OReilly 文本。 他们有很好的例子供您参考。 这将使您更好地了解编程是否适合您。 如果你想进入游戏编程,最好的方法就是真正开始游戏编程 。 只需查看它并查找出现问题的答案(此处其他回复中的链接)即可。
You might want to check out any OReilly text on the topic. They have good examples that you can work through. This will give you a better idea of if programming is right for you. If you want to get into game programming, best way is to actually start game programming. Just go at it and look up answers to questions (links in other replies here) as they arise.
您需要精通三角学:维基百科和Mathworld
即使您不希望进行 3D 编程,2D 游戏也使用向量和矩阵。 (来自线性代数)
线性代数资源:维基百科和Mathworld
在 Trig 编程中,有一点可以为您节省大量精力,那就是认识到对 atan2() 函数,而不是 atan() 函数。 这在确定两点之间的方向时很重要。
能够在不同的坐标系之间移动是一个很大的优点。 这需要经验的积累。 两个常见的让人绊倒的事情是:
a) 大多数屏幕系统将原点 (0,0) 放在左上角,正 x 轴向右延伸,正 y 轴向下延伸。 标准笛卡尔坐标假定象限 1(其中 x 和 y 始终为正或零)的原点位于左下角。 这需要程序员在某个阶段“翻转”y 方向。
b) 典型的地理位置为北 0 度,正度顺时针扫过。 所有三角函数都将 0 度设置为东,并以逆时针方向扫描正度。
最后,尽管我们倾向于用度数来思考,但真正的图书馆会使用弧度。
最佳实践是将角度存储为弧度(以“数学”方向而不是“地理”方向)并在显示调试信息时进行转换。
You need to be competent in Trigonometry: Wikipedia and Mathworld
Even though you don't wish to do 3D programming, 2D games also use vectors and matrices. (from Linear Algebra)
Linear Algebra resources: Wikepedia and Mathworld
One point that will save you a lot of effort in Trig programming is realizing the need for the atan2() function, rather than the atan() function. This is important when determining the direction between two points.
Being able to move between various coordinate systems is a big plus. This will come with experience. Two common things that trip people up are:
a) Most screen systems place the origin (0,0) in the upper left corner, with the positive x axis extending to the right and the positive y axis extending down. Standard Cartesian coordinates suppose the origin of Quadrant 1 (where x and y are always positive or zero) in the lower left. This requires a programmer to 'flip' the y orientation at some stage.
b) Typical geography places 0 degrees as North and positive degrees sweep clockwise. All the Trig functions place 0 degrees as East with positive degrees sweeping counter-clockwise.
Finally, even though we tend to think in degrees, real libraries will use radians.
A best practice is to store angles as radians (in 'math' orientation rather than 'geo') and convert things when displaying debug information..
我目前正在阅读 David M 撰写的“游戏开发者物理学”。布尔格。 到目前为止,我会推荐它。
它提供了物理背后的数学概念,可以轻松应用于 2D 领域,为您的游戏增添趣味。
I'm currently going through "Physics for Game Developers" by David M. Bourg. So far, I'd recommend it.
It provides the math-y concepts behind physics that can easily be applied to the 2D realm to spice up your games a bit.
GameDev.net 有一个关于数学和物理编码的文章部分。 值得快速浏览一下,看看是否有任何内容与您想要做的事情相关。
http://www.gamedev.net/reference/list.asp?categoryid= 28
GameDev.net has a section of articles for Math and Physics coding. It's worth a quick look through to see if anything is related to what you're trying to do.
http://www.gamedev.net/reference/list.asp?categoryid=28
如果您住在美国,是否可以在当地的社区大学报名参加您错过的数学课程? 他们将提供资源来帮助需要补习技能课程并可能有学习障碍的学生。 您有学习的动力,并且现在意识到教育的价值。 想要学习并不可耻。 去找学术顾问,他们会帮助你。 大胆试试吧。
If you live in the US, how about enrolling at a local community college to take those math classes you missed? They will have resources available to help students who need remedial skills classes and may have a learning disability. You have an incentive to learn and you now realize the value of the education. There's no shame in wanting to learn. See an academic counselor and they'll help you out. Go for it.
我非常相信从视频系列中学习是有史以来最快的学习方式,也就是说,如果您想快速学习您愿意学习的内容。
您可能会花费大量时间阅读一个页面,只是为了获取视频在一两分钟内即可为您提供的一小段信息!
为此,我找到了这个数学频道:
https://www.youtube.com/user/patrickJMT
另外:
https://www.youtube.com/playlist?list=PL233FC7AA6FE11E0E
I very much believe that learning from Videos series is the fastest way ever possible for learning, that is, if you wanna move fast with the thing that you're willing to learn.
You could spend a lot of time reading a page just to get a small piece of info that a video could give you in a minute or two!
And for that, I found this Math channel:
https://www.youtube.com/user/patrickJMT
Also:
https://www.youtube.com/playlist?list=PL233FC7AA6FE11E0E
我不得不不同意《游戏开发者物理学》的建议。
我发现那本书很无聊,而且我不会说我自己的注意力持续时间那么短。
我想说最擅长的是向量,使用三角函数来操纵它们,然后在此基础上应用特定于当前项目的任何物理原理。
我只是启动谷歌/维基百科,开始在网络上跳跃,吸收随机的东西,当你有限的注意力变得烦躁时,再次跳跃。
读这本书可能不会吸引你并激励你。
I have to disagree with the recommendation of Physics for Game Developers.
I found that book pretty boring, and I wouldn't call my own attention span that short.
I would say the top things to get good at are vectors, using trig to manipulate them, and then on top of that foundation you apply whatever physics are specific to your current project.
I'd just fire up google/wikipedia and start bouncing around the web soaking up random stuff, and when your limited attention span gets antsy, bounce again.
Taking on that book is probably not going to suck you in and inspire you.