sharpgl

SharpGL学习笔记(七) OpenGL的变换总结

懵懂的女人 提交于 2020-08-16 06:58:39
笔者接触OpenGL最大的困难是: 经常调试一份代码时, 屏幕漆黑一片, 也不知道结果对不对,不知道如何是好! 这其实就是关于OpenGL"变换"的基础概念没有掌握好, 以至于对"将三维体正确的显示在屏幕上指定位置"这样的操作都无法完成. OpenGL变换包括计算机图形学中最基本的三维变换,即几何变换、投影变换、裁剪变换、视口变换,以及针对OpenGL的特殊变换概念理解和用法,如相机模拟、矩阵堆栈等,这些基础是开始真正走进三维世界无法绕过的基础. 所以笔者在前面花了5篇的篇幅详细讲解了这些基础概念. SharpGL学习笔记(二) 模型变换(几何变换) SharpGL学习笔记(三) 投影变换和视点变换 SharpGL学习笔记(四) 正射投影 SharpGL学习笔记(五) 视口变换 SharpGL学习笔记(六) 裁剪变换 但是这些概念是零散的, 你可能感觉在实际应用中无法把它们有机的串联起来吧? 本节就是想把这些基础知识点按照应用时的逻辑关系理清楚, 并且要彻底搞清楚这些功能之间的关系. 我们拿日常使用相机的例子打个比方: 实际上,从三维空间到二维平面,就如同用相机拍照一样,通常都要经历以下几个步骤 (括号内表示的是相应的图形学概念): 第一步,将相机置于三角架上,让它对准三维景物( 视点变换,Viewing Transformation )。 第二步,将三维物体放在适当的位置(

C#: WinForms/WPF Render Loop

霸气de小男生 提交于 2019-12-11 12:24:57
问题 I want to make a render loop to render on a WPF Window or a WinForm. Therefore I want to use SharpGL (https://sharpgl.codeplex.com/). To make my loop I made a thread: public void Run() { IsRunning = true; this.Initialize(); while (IsRunning) { Render(/* arguments here */); // pausing and stuff } Dispose(); } In Render I want to send the Draw Calls to the GPU. So far there is no problem. But Winforms and WPF need their own thread and loop. So I can't just create a Window and draw onto like in

OpenGL: More vertices, slower performance

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:48:26
问题 I am working on a part of a program where given a collection of xyz-coordinates, a 3D model is made. I have all of the functionality needed for this picture done (i.e. panning, rotating, scaling) however the more xyz-coordinates given, the slower my program runs. My program runs pretty smooth when processing 29,000 coordinates, but I when I have 300,000 points, my program slows down. I am using SharpGL in order to use OpenGL in WPF. The code for inserting all these points looks as follows: gl