Lesson 1

1. Seznámení s průběhem předmětu Základy počítačové grafiky.


Na cvičeních budeme používat C++ (Microsoft Visual Studio 2017) a další vybrané knihovny. Odzkoušejte dnes minimálně GLEW, GLFW a GLM (později Assimp, OpenCV, …).


#include <iostream>

int main()
{
  std::cout << "Hello World!\n";
  system("PAUSE");
  return 0;
}

Testovací příklad [main.cpp] //cvičení 1


Abychom si ušetřili práci, budeme využívat některé knihovnym které nám budou umožňovat rozšířit stávající možosti C++.

Knihovny (popřípadě jejich části) lze rozdělit podle způsobu použití na:

  • Statickou část knihovny – pro kterou platí, že to co program z knihoven využívá, je vloženo přímo do spustitelného kódu (zvětšují velikost).
  • Dynamická část knihovny – které se načítají za běhu. Tyto knihovny se přikládají k spustitelnému souboru samostatně a mohou být sdíleny mezi více programy.

Ve Windows mají statické knihovny obvykle příponu .lib (static library) a dynamické knihovny mají příponu .dll (dynamic linked library).


[ připravené knihovny GLEW, GLFW, GLM ]  //vytvořte čistý projekt a namapujte knihovny, stáhměte si prosím aktální verze:

GLFW: http://www.glfw.org/download.html
GLM: https://glm.g-truc.net
GLEW: http://glew.sourceforge.net/


opengl32.lib
glu32.lib
glew32.lib
glfw3.lib


GLFW (http://www.glfw.org/)

GLFW is an Open Source, multi-platform library for creating windows with OpenGL contexts and receiving input and events. It is easy to integrate into existing applications and does not lay claim to the main loop.

GLM (http://glm.g-truc.net/) OpenGL Mathematics

OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. GLM provides classes and functions designed and implemented with the same naming conventions and functionalities than GLSL so that anyone who knows GLSL, can use GLM as well in C++.

GLEW (http://glew.sourceforge.net/) The OpenGL Extension Wrangler Library

The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.

Assimp (http://assimp.sourceforge.net/) Open Asset Import Library

Assimp is a portable Open Source library to import various well-known 3D model formats in a uniform manner. The most recent version also knows how to export 3d files and is therefore suitable as a general-purpose 3D model converter. See the feature list.

Tutorial http://ogldev.atspace.co.uk/www/tutorial38/tutorial38.html

OpenCV (http://opencv.org/) Open Source Computer Vision Library

OpenCV is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.

AntTweakBar (http://anttweakbar.sourceforge.net)

AntTweakBar is a small and easy-to-use C/C++ library that allows programmers to quickly add a light and intuitive graphical user interface into graphic applications based on OpenGL (compatibility and core profiles), DirectX 9, DirectX 10 or DirectX 11 to interactively tweak parameters on-screen.

FreeGLUT (http://freeglut.sourceforge.net/) Free OpenGL Utility Toolkit

Free-software/open-source alternative to the OpenGL Utility Toolkit (GLUT) library.


Relative Paths

D:\ZPG\Cviceni\Libraries\glew\lib\Release\Win32

vs.

..\Libraries\glew\lib\Release\Win32