简体   繁体   English

没有OpenGL的Linux基本图形编程

[英]Linux basic graphics programming without OpenGL

What are the good choices to start basic graphics programming in C/C++ (both 2D and 3D) for a learner?对于学习者来说,在 C/C++(2D 和 3D)中开始基本图形编程有哪些好的选择? I want to try out things given in the book ( 3D math primer ).我想尝试书中给出的东西( 3D 数学入门)。 Obviously I don't want to use OpenGL.显然我不想使用OpenGL。

I have a machine that has Linux (Debian).我有一台装有 Linux (Debian) 的机器。 What are my choices on Linux to start with?我在 Linux 上的选择是什么? QT or GTK or something else? QT或GTK或其他什么?

Edit: I don't want to use OpenGL because it does most of the interesting work for me.编辑:我不想使用 OpenGL,因为它为我做了大部分有趣的工作。 Like, rotation, projection etc. I want to learn those things.像,旋转,投影等。我想学习这些东西。

Use OpenGL.使用 OpenGL。 You can either use legacy OpenGL and leave the transformation matrices as identity, and do your own rotation projection etc. before calling glVertex *, or use modern OpenGL with shaders, where you'll have to implement those features yourself in the vertex shader.您可以使用旧版 OpenGL 并将变换矩阵保留为单位,并在调用glVertex * 之前进行自己的旋转投影等,或者使用带有着色器的现代 OpenGL,您必须自己在顶点着色器中实现这些功能。

For 2D Graphics I recommend SDL Library .对于 2D 图形,我推荐SDL Library It is simple but powerful.它简单但功能强大。 The library APIs are native to C/C++ but supports all languages you can think of.库 API 是 C/C++ 原生的,但支持您能想到的所有语言。 You don't have to use OpenGL, but SDL supports it if you decide to use it later on.您不必使用 OpenGL,但如果您以后决定使用它,SDL 会支持它。 It also supports most audio and video files.它还支持大多数音频和视频文件。 I find it great to work with for a beginner game developer.我发现与初学者游戏开发人员一起工作非常好。

Go through the tutorials in the following link.浏览以下链接中的教程。 You don't need any graphics library http://www.codermind.com/articles/Raytracer-in-C++-Introduction-What-is-ray-tracing.html您不需要任何图形库http://www.codermind.com/articles/Raytracer-in-C++-Introduction-What-is-ray-tracing.html

After doing the tutorials then rewrite the ray tracer in OpenCL and use SDL to display the pixel buffer.完成教程后,然后在 OpenCL 中重写光线跟踪器并使用 SDL 来显示像素缓冲区。 Impress your friends with real-time global illumination who think OpenGL is the only way to do graphics.使用实时全局照明给您的朋友留下深刻印象,他们认为 OpenGL 是处理图形的唯一方法。

Take a look at tinyrenderer .看看tinyrenderer

In this series of articles, I want to show the way OpenGL works by writing its clone (a much simplified one).在本系列文章中,我想通过编写其克隆(一个非常简化的克隆)来展示 OpenGL 的工作方式。 Surprisingly enough, I often meet people who cannot overcome the initial hurdle of learning OpenGL / DirectX.令人惊讶的是,我经常遇到无法克服学习 OpenGL / DirectX 最初障碍的人。 Thus, I have prepared a short series of lectures, after which my students show quite good renderers.因此,我准备了一系列简短的讲座,之后我的学生展示了非常好的渲染器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM