https://learnopengl.com/Introduction

 

LearnOpenGL - Introduction

Introduction Introduction Since you came here you probably want to learn the inner workings of computer graphics and do all the stuff the cool kids do by yourself. Doing things by yourself is extremely fun and resourceful and gives you a great understandin

learnopengl.com

Introduction

당신이 여기 온 이후로, 당신이 아마 컴퓨터 그래픽스의 내부 동작을 배우기 위함일 것입니다. 그리고 멋진 아이들이 스스로 하는것을 모든것을 당신 스스로 하고싶어할 것입니다.

Prerequisities

OpenGL은 그래픽스 api이지 그것 자체로 플랫폼인 것은 아니기 때문에, OpenGL은 작동하기 위한 언어를 필요로 하고 그 선택은 C++입니다. 그러므로 c++ 프로그래밍 지식은 요구됩니다. 하지만 나는 설명하기 위해 노력할 것입니다. 사용되는 대부분의 컨셉들, advanced된 c++ 토픽들. 그렇다고 c++ 전문가가 되기를 요구하지는 않습니다. 그러나 당신은 "Hello World"를 출력하는 것 이상을 알야아 합니다. 당신이 c++에 대한 경험이 많이 없다면 난 아래 링크를 추천합니다.

 

http://www.learncpp.com/

 

Learn C++ – Skill up with our free tutorials

LearnCpp.com is a free website devoted to teaching you how to program in C++. Whether you’ve had any prior programming experience or not, the tutorials on this site will walk you through all the steps to write, compile, and debug your C++ programs, all w

www.learncpp.com

또한 우리는 몇몇 수학(linear algebra, geometry, and trigonometry)을 사용할 예정이고 나는 필요로 하는 수학의 요구되는 개념 모두를 설명하기 위해 노력할 것입니다. 하지만 난 수학자가 아닙니다. 내 설명이 이해하기 쉽더라도. 그렇기에 나의 설명이 불완전할 수 있습니다. 그래서 필요로 하는 곳에는 내가 좋은 resource를 제공할 것입니다.

필요로 하는 수학적 지식에 대해 겁먹지 마세요. OpenGL로의 여행을 시작하기도 전에.

대부분의 수학적 지식 개념은 기본 수학 배경만 가지고 있다면 이해할 수 있고 나는 수학이 최소한이 될 수 있게끔 노력할 것입니다.

심지어, 대부분의 기능은 당신이 모든 수학을 이해하라고 요구하지도 않아요. 당신이 그것을 어떻게 사용하는지 알고 있다면요.

Structure

LearnOpenGL은 많은 섹션으로 나뉩니다. 각각의 세션은 몇몇 챕터를 포함하고 있습니다. 이 챕터는 각각 다른 개념을 자세히 (in large detail)설명합니다. 각각의 챕터는 왼쪽 메뉴에서 확인할 수 있습니다. 그 개념들은 순차적으로 설명될 것입니다. 각각의 챕터는 배경지식 이론과 실전적 관점을 설명합니다.

개념들이 더 쉽게 따라올 수 있게 만들기 위해 그리고 그들에게 몇몇의 추가적인 스트럭쳐를 주기 위해 , 그 책은 boxes, code blocks, color hints 그리고 function refrerences를 포함합니다.

green boxes는 몇몇 노트들과 유용한 특성, 힌트(OpenGL에 대한 또는 subject에 대한) 포함합니다.

red boxes는 경고 또는 다른 특성 (매우 주의해야하는)을 포함합니다.

'그래픽스 > OpenGL' 카테고리의 다른 글

LearnOpenGL 번역  (0) 2023.01.23
삼각형 그리기  (0) 2023.01.06
OpenGL glVertex2f()  (0) 2022.07.27
파이썬 opengl 패키지 설치  (0) 2022.07.12

그래픽스 공부를 위해, 목표를 위와 같은 도전을 하기로 했습니다. 홍정모 교수님의 강의와 병행하며 번역 작업을 해볼 생각입니다.

위를 진행함으로써 아래 사항을 성취할 생각입니다.

  • 영어 학습
  • OpenGL 학습

충분히 해볼만한 도전이라고 생각합니다.

https://learnopengl.com/Introduction

 

LearnOpenGL - Introduction

Introduction Introduction Since you came here you probably want to learn the inner workings of computer graphics and do all the stuff the cool kids do by yourself. Doing things by yourself is extremely fun and resourceful and gives you a great understandin

learnopengl.com

 

한 편으론, 게으른 제가 할 수 있을까 생각이 들기도 하지만 적어도 4월달안에는 끝내보고 싶네요 ㅎㅎ

그래도 이런저런 핑계대면 안되니깐.... 해봐야겠네요!

'그래픽스 > OpenGL' 카테고리의 다른 글

LearnOpenGL - Introduction  (0) 2023.01.23
삼각형 그리기  (0) 2023.01.06
OpenGL glVertex2f()  (0) 2022.07.27
파이썬 opengl 패키지 설치  (0) 2022.07.12
#include <iostream>
#include <GL/glut.h>

void display()
{
	glClearColor(1.0f, 0.25f, 1.0f, 1.0f); // 배경 color 지정
	glClear(GL_COLOR_BUFFER_BIT);		   // 지정한 color로 배경 초기화
	
	glColor3f(0.5f, 0.25f, 0.68f);		   // 도형색 지정
	glBegin(GL_TRIANGLES);				   // 도형 타입 선언
	glVertex2f(-0.5f, -0.2f);				// 도형 좌표 선언
	glVertex2f(0.4f, -0.4f);
	glVertex2f(-0.97f, 0.2f);
	glEnd();

	glFinish();
}

int main(int argc, char** argv)
{
	glutInit(&argc, argv);
	glutCreateWindow("OpenGL");
	glutDisplayFunc(display);
	glutMainLoop();
	return 0;
}

삼각형을 그려봤습니다 ㅎㅎ.

opengl은 visual studio 셋업하는것만 해도 너무 귀찮네요.... ㅜ vcpkg로 freeglut같은 경우는 사용할 수 없는것 같아요.

위와 같은 삼각형 이미지가 출력됩니다.

좌표를 확인해보니, OpenGL은 이미지좌표계가 아닌 일반 xy cartesian coordinate을 이용하는 것 같습니다.

 

'그래픽스 > OpenGL' 카테고리의 다른 글

LearnOpenGL - Introduction  (0) 2023.01.23
LearnOpenGL 번역  (0) 2023.01.23
OpenGL glVertex2f()  (0) 2022.07.27
파이썬 opengl 패키지 설치  (0) 2022.07.12

OpenGL의 가장 기초적인 함수입니다.

https://docs.microsoft.com/ko-kr/windows/win32/opengl/glvertex2f

 

glVertex2f 함수(Gl.h) - Win32 apps

꼭짓점을 지정합니다. | glVertex2f 함수(Gl.h)

docs.microsoft.com

 

꼭지점을 지정하는 함수입니다.

void WINAPI glVertex2f(
   GLfloat x,
   GLfloat y
);

 

삼각형을 그리려면 아래와 같은 코드로 가능합니다.

#include "./include/gl/glut.h"

void display()
{
	glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT);
	glColor3f(0.0f, 0.0f, 1.0f);
	glBegin(GL_POLYGON);
	/**
	glBegin()은 그리기 시작
	*/
	glVertex2f(-0.5f, -0.5f);
	glVertex2f(0.5f, -0.5f);
	glVertex2f(0.5f, 0.5f);
	glEnd();
	/**
	glEnd()는 그리기 종료
	*/
	glFinish();
}

int main(int argc, char** argv)
{
	glutInit(&argc, argv);
	glutCreateWindow("OpenGL");
	glutDisplayFunc(display);
	glutMainLoop();
	return 0;
}

'그래픽스 > OpenGL' 카테고리의 다른 글

LearnOpenGL - Introduction  (0) 2023.01.23
LearnOpenGL 번역  (0) 2023.01.23
삼각형 그리기  (0) 2023.01.06
파이썬 opengl 패키지 설치  (0) 2022.07.12

파이썬 환경에서 openGL을 이용하기 위해 아래 패키지들을 설치합니다.

  • pip3 install PyOpenGL
  • pip3 install PyOpenGL_accelerate

저는 linaro에서 설치를 진행했는데, 아래와 같은 에러가 발생했었습니다.

 

Downloading https://files.pythonhosted.org/packages/68/89/ada28ebf7e30a73791e3d946843c6f471101eee637d67d44cde87ec30698/glfw-2.5.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'setuptools'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kbw9ya_j/glfw/

 

이럴때는 아래와 같이 조치합니다.

sudo apt-get install python3-setuptools

 

그리고 다시 설치를 진행하면 됩니다.

'그래픽스 > OpenGL' 카테고리의 다른 글

LearnOpenGL - Introduction  (0) 2023.01.23
LearnOpenGL 번역  (0) 2023.01.23
삼각형 그리기  (0) 2023.01.06
OpenGL glVertex2f()  (0) 2022.07.27

+ Recent posts