计算机图形学:光线追踪和 3D 渲染编程
我注意到许多顶尖大学都为计算机专业的学生提供与计算机图形学相关的课程。 遗憾的是,这是我的大学没有提供的东西,也是我非常想在未来几年内进入的东西。
我从一些大学发现的一些项目都很棒,尽管我最感兴趣的是两件事:
- 光线追踪:
- 我想在未来两年内编写一个 Raytracer。 我需要知道什么? 我还不是一个出色的程序员(Java、C 和 Prolog 是我今天的主要语言),但我每天都在慢慢学习。 另外,我的数学背景并不是那么好,所以任何有关阅读书籍的建议或编写此类程序的建议都会很棒。 我往往很快就能学会这些东西,所以请随意向我提供参考资料。
- 对 3D 渲染模型进行编程
- 我看过几个项目,学生们开发了模型并将其用于游戏中。 我用光栅图像制作了一些 2D 游戏,但从未使用过 3D 模型。 在对这些模型进行编程时我需要学习什么? 如果它有帮助的话,我以前对 3D Studio Max 和 Cinema4D 还不错(尽管每门课程似乎都使用 Maya),但大约四年来没有接触过它。
很抱歉发布如此模糊且老实说愚蠢的问题。 这只是我一段时间以来想做的事情,也是我在自己的时间里开发的一个大项目。
相关问题
I've noticed that a number of top universities are offering courses where students are taught subjects relating to Computer Graphics for their CS majors. Sadly this is something not offered by my university and something I would really like to get into sometime in the next couple of years.
A couple of the projects I've found from some universities are great, although I'm mostly interested in two things:
- Raytracing:
- I want to write a Raytracer within the next two years. What do I need to know? I'm not a fantastic programmer yet (Java, C and Prolog are my main languages as of today) but I'm slowly learning every day. Also, my Math background isn't all that great, so any pointers on books to read or advice on writing such a program would be fantastic. I tend to pick these things up pretty quickly so feel free to chuck references at me.
- Programming 3D Rendered Models
- I've looked at a couple of projects where students have developed models and used them in games. I've made a couple of 2D games with raster images but have never worked with 3D models. What would I need to learn in regards to programming these models? If it helps I used to be okay with 3D Studio Max and Cinema4D (although every single course seems to use Maya), but haven't touched it in about four years.
Sorry for posting such vague and, let's be honest, stupid questions. It's just something I've wanted to do for a while and something that'd be good as a large project for me to develop in my own time.
Related Questions
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我可以推荐pbrt,这是一本书和一个用于教学的基于物理的渲染器计算机科学专业的毕业生。 对所使用的数学的描述很好且清晰,并且由于它是用“文学编程”编写的,因此您也可以看到相应的代码(C++)。
I can recommend pbrt, it's a book and a physically-based renderer used to teach computer science graduates. The description of the maths used is nice and clear, and since it is written in the 'literate programming' you can see the appropriate code (in C++) too.
这本书“计算机图形学:原理与实践”(在计算机图形学圈为“Foley-VanDam”)是大多数计算机图形学课程的基础,它详细介绍了实现光线追踪器的主题。 它已经相当过时了,但它仍然是最好的,据我所知,并且基本原则保持不变。
我还赞同 Eric Lengyel 的 3D 游戏编程和计算机图形学数学 。 它不是那么彻底,但它是对 3D 编程所需的数学基础知识的精彩回顾,在每章末尾都有非常有用的总结,并且以平易近人、不太可怕的方式编写。
此外,您可能需要一些 OpenGL 或 DirectX 基础知识。 开始使用 3D API,然后学习底层数学比相反(在我看来)更容易,但这两种选择都是可能的。 只需在 SO 上查找 OpenGL,您就应该找到一些很好的参考资料。
The book "Computer Graphics: Principles and Practice" (known in the Computer Graphics circles as the "Foley-VanDam") is the basic for most computer graphics courses, and it covers the topic of implementing a ray-tracer in much detail. It is quite dated, but it's still the best, afaik, and the basic principles remain the same.
I also second the recommendation for Eric Lengyel's Mathematics for 3D Game Programming and Computer Graphics. It's not as thorough, but it's a wonderful review of the math basics you need for 3D programming, it has very useful summaries at the end of each chapter, and it's written in an approachable, not too scary way.
In addition, you'll probably want some OpenGL or DirectX basics. It's easier to start working with a 3D API, then learn the underlying maths than the opposite (in my opinion), but both options are possible. Just look for OpenGL on SO and you should find a couple of good references as well.
2000 ICFP 编程竞赛要求参赛者在三天内构建一个光线追踪器。 他们对简单的光线追踪器有很好的规范,您可以获得获奖作品和其他一些作品的代码。 有大量不同编程语言的条目。 这可能是您入门的好方法。
The 2000 ICFP Programming Contest asked participants to build a ray tracer in three days. They have a good specification for a simple ray tracer, and you can get code for the winning entries and some other entries as well. There were entries in a large number of different programming languages. This might be a nice way for you to get started.
我能给出的最简短有用的答案是,大多数重要算法都可以在实时渲染 由 Tomas Akenine-Möller、Eric Haines 和 Naty Hoffman 撰写,最后的参考书目引用了必要的数学知识。 他们的网站也有推荐的阅读清单。
我读过的关于该主题的最有用的数学书是 Eric Lengyel 的《3D 游戏编程和计算机图形学数学》。 您最需要的数学是几何(显然)和线性代数(用于处理所有矩阵)。
The briefest useful answer I can give is that most of the important algorithms can be found in Real-Time Rendering by Tomas Akenine-Möller, Eric Haines, and Naty Hoffman, and the bibliography at the end has references to the necessary maths. Their website has a recommended reading list as well.
The most useful math book I've read on the subject is Eric Lengyel's Mathematics for 3D Game Programming and Computer Graphics. The maths you need most are geometry (obviously) and linear algebra (for dealing with all the matrices).
我去年上过这样一门课,我相信这门课很棒,它迫使学生学习计算机图形学背后的数学——而不仅仅是让计算机做你想做的事情的命令。
我的教授有一个网站位于此处,其中有他的讲义以及您可以浏览的问题集。
我们的最终项目确实是一个光线追踪器,但是一旦您了解了其背后的数学原理,编码(效率低下)就变得微不足道了。
I took such a class last year, and I believe that the class was wonderful for forcing students to learn the math behind the computer graphics - not just the commands for making a computer do what you want.
My professor has a site located here and it has his lecture notes and problem sets that you can take a look through.
Our final project was indeed a raytracer, but once you know the mathematics behind it, coding (an inefficient one) is trivial.
有关这些主题的数学介绍,请参阅
http://graphics.idav.ucdavis.edu/education/GraphicsNotes/homepage.html
For a mathematical introduction into these topics, see
http://graphics.idav.ucdavis.edu/education/GraphicsNotes/homepage.html
检查 http://www.scratchapixel .com/lessons/3d-basic-lessons/lesson-1-writing-a-simple-raytracer/
这是学习一般光线追踪和渲染的好地方。
Check http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-1-writing-a-simple-raytracer/
This is a very good place to learn about ray tracing and rendering in general.