OpenGL 개발 셋팅 할때 헤드(.h)파일 Lib파일 모두 적용해보고
아래 프로그램 OpenGL Extensions Viewer 가 잘 잘동되는지 확인해 보자
OpenGL Extensions Viewer 설치 링크
http://realtech-vr.com/admin/glview
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FreeImage 를 OpenGL에서 이미지 로드하기 전에 알아두어야 할것
각각 OS 의 바이트 순서에 따라 칼라값을 읽는 순서가 다르다!
(윈도우, 애플(OSX), 리눅스 등등)
little-endian -> BGR
big-endian -> RGB
test(...)
{
...
FREE_IMAGE_FORMAT format = FreeImage_GetFileType(filename.c_str(), 0);
FIBITMAP *bitmap = FreeImage_Load(format, filename.c_str());
m_w = FreeImage_GetWidth(pBitmap);
m_h = FreeImage_GetHeight(pBitmap);
bit = FreeImage_GetBPP(m_pBitmap);
...
...
//아래와 같은 식으로 두었다면 특정 OS에 따라 색깔이 맞게 않나올수도 있다.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_w, m_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)FreeImage_GetBits(m_pBitmap));
//아래와 같은 식으로 두었다면 특정 OS에 맞게 바꾸어준다.
unsigned int glBit = GL_RGBA;
if (FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR)
{
if( bit == 24) //24비트
{
//24비트 BGR 알파값X
glBit = GL_BGR;
}
else if( bit == 32) //32비트
{
//32비트 BGR 알파값포함 값
glBit = GL_BGRA;
}
}
else if (FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB)
{
if( bit == 24) //24비트
{
//24비트 RGB 알파값X
glBit = GL_RGB;
}
else if( bit == 32) //32비트
{
//32비트 RGB 알파값포함 값
glBit = GL_RGBA;
}
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_w, m_h, 0, glBit , GL_UNSIGNED_BYTE, (GLvoid*)FreeImage_GetBits(m_pBitmap));
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: https://stackoverflow.com/questions/31103121/why-freeimage-loads-image-in-bgr-format
I write game using Android NDK and FreeImage library to load images into my game. It loads images in BGR format. It is possible to load in RGB format? Or I need to swap R and B components manualy? Edited My device is Samsung Galaxy S4(armv7 archtecture). Here is code`
| |||
3 | FreeImage actually doesn't neccessarily use BGR(A) ordering. Section "Pixel access functions" in the FreeImage documentation contains the following statement (emphasis mine):
However, these macros will not help you when you want to use FreeImage's raw pixel data as source for OpenGL. But I don't know what your issue with this is. OpenGL will accept BGR(A) as well as RGB(A) as image data. And actually, FreeImage's choice is not bad, as BGR(A) is most likely the native data format on such platforms, so that using this format represents the most efficient way to transfer image data. | ||||||||||||
|
1 | FreeImage can be built to always load in RGB order independent of the architecture. Use #define FREEIMAGE_COLORORDER=FREEIMAGE_COLORORDER_RGB. If you're using Android.mk to build FreeImage, add the following line to it:
Documentation for this can be found in Source/FreeImage.h if you search for FREEIMAGE_COLORORDER:
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
32비트 알파채널 추가 이미지 투명 설정하기
/////////////////////////////////////////////////////////
//{alpha Blend 알파가 추가된 32비트 이미지, 투명처리 반영
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
//}
////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
//{위의 옵션이 추가된 상황에서 이미지가 겹칠때 뚫린 부분에 서로 이미지가 마스크되어 보일려면 아래와 같이 필요하다
glTexEnvf(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDepthMask(GL_FALSE);
//}
////////////////////////////////////////////////////////
//즉 아래와 같이 옵션을 해주면 32비트 알파이미지가 겹쳐도 뚫린곳으로 서로 보이게끔 설정이 된다.
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glTexEnvf(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);glDepthMask(GL_FALSE);
이렇게 추가된 부분을 보면 된다.
아래 스크롤되는 코드를 보면 위와같이 코드부분추가한 부분을 보면 이해가 될 것이다.
출처: https://www.opengl.org/discussion_boards/showthread.php/165638-Texture-transparency-problems
Texture transparency problems
----------------------------------------------------------------------------------------------------------------------------------------------------------------
xture transparency problems
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
32비트 알파채널 추가 이미지 투명 설정하기
출처: http://collagefactory.blogspot.kr/2009/10/opengl.html
OpenGL의 투명 효과
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: http://stackoverflow.com/questions/4153055/how-to-load-jpg-png-textures-in-an-sdl-opengl-app-under-osx
Take a look at freeimage. It supports all major formats and is easily built with macports. Nice to work with as well. Auto-detects image format etc.
GLuint m_mpTextures;
FREE_IMAGE_FORMAT format = FreeImage_GetFileType(filename.c_str(), 0);
FIBITMAP *bitmap = FreeImage_Load(format, filename.c_str());
if (!bitmap)
{
LOG_ERROR("Unable to load texture: " + filename);
return false;
}
mlWidth = FreeImage_GetWidth(bitmap);
mlHeight = FreeImage_GetHeight(bitmap);
glGenTextures(1, &m_mpTextures);
glBindTexture(GL_TEXTURE_2D, m_mpTextures);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mlWidth, mlHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE,
(GLvoid*)FreeImage_GetBits(bitmap));
FreeImage_Unload(bitmap);
출처: http://202psj.tistory.com/1031 [알레폰드의 IT 이모저모]
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: http://m.blog.naver.com/jungwan82/20108510997
텍스쳐를 렌더링 하기 위해서는 다양한 포맷의 이미지를 프로그램 내에서 다룰 수 있어야 하는데요 이 일을 해주는 좋은 라이브러리가 있습니다. 라이브러리 이름은 FreeImage Library입니다. 아래의 주소에서 다운 받으실 수 있습니다.
http://freeimage.sourceforge.net/
https://sites.google.com/site/jungwan82/home/opengl/texture-rendering/RenderingTexture.zip?attredirects=0&d=1
에서 받으실 수 있습니다. 하지만 첨부된 파일에 Freeimage 라이브러리는 프함되어 있지 않으므로 이 라이브러리와 dll 파일은 아래 주소에서 다운로드 받으시기 바랍니다.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: https://r3dux.org/2014/10/how-to-load-an-opengl-texture-using-the-freeimage-library-or-freeimageplus-technically/
The loadTexture Method
Usage
To use the method, just set up your code something like this – in your main .cpp file at the top have:
In your initialisation/setup method add something like this:
In your main method, once you’ve create an OpenGL context (i.e. window) and called your initialise/setup method, then you can load a texture to use like this:
Finally, on shutdown you may (optionally, as long as you’re not using the Linux/Mac .a version of the library) like to add the following:
Wrap-up
Not a great deal to say – it works, it should be relatively robust, it doesn’t leak memory (or at least none that we control), and the code is commented to the hilt and explains why it’s doing things instead of just what it’s doing (some people don’t like verbose code like this – but I teach a lot of programming so I just try to explain everything as clearly as possible as I go – and find I prefer it to ‘terse’ code that I have no idea WTF it’s up to or why it’s bothering).
Many thanks to the FreeImage devs for the library – it’s rather feature-packed and I quite like it (some good example code wouldn’t go amiss though!) =D
Hope you find the code useful! (Bugs? Comments? Suggestions? Feedback always welcome!).
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: https://www.opengl.org/discussion_boards/showthread.php/164502-freeImage-example-code
freeImage example code
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: freeImage example code
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Certainly not ! why would you want to _always_ swizzle your texture accesses just because of a small hypothetical performance hit for the texture creation...
Moreover you can tell OpenGL that your data is in BGRA format ::
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA, w, h, 0, GL_BGRA,GL_UNSIGNED_BYTE,(GLvoid*)textura )
Cheers
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
I tried using your code RGHP for loading a texture using freeImage. It only work with standard opengl image size. I am trying to load an image that is 39x35. Is there a way I can copy that image to a standard opengl image size with transparency for the new image.
#include <windows.h> #include <gl\gl.h> #include <gl\glu.h> #include <SDL\SDL.h> #include <fmod.hpp> #include <FreeImage.h> //The attributes of the screen const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; const int SCREEN_BPP = 32; //The surfaces that will be used SDL_Surface *screen = NULL; void InitGL(int Width, int Height) // We call this right after our OpenGL window is created. { glViewport(0, 0, Width, Height); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // This Will Clear The Background Color To Black glClearDepth(1.0); // Enables Clearing Of The Depth Buffer glDepthFunc(GL_LESS); // The Type Of Depth Test To Do glEnable(GL_DEPTH_TEST); // Enables Depth Testing glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading glEnable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Reset The Projection Matrix gluPerspective(45.0f,(GLfloat)Width/(GLfloat)Height,0.1f,100.0f); // Calculate The Aspect Ratio Of The Window glMatrixMode(GL_MODELVIEW); } /* The main drawing function. */ int main( int argc, char* args[] ) { //Initialize all SDL subsystems if( SDL_Init(SDL_INIT_VIDEO) != 0 ) { return 1; } SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); //Set up the screen screen = SDL_SetVideoMode( 640, 480, 32, SDL_OPENGL); //If there was an error in setting up the screen if( screen == NULL ) { return 1; } //Set the window caption SDL_WM_SetCaption( "Hello World", NULL ); /* FMOD::System *system; FMOD::System_Create(&system); system->init(100, FMOD_INIT_NORMAL, 0); FMOD::Sound *sound; system->createStream("music.mp3", FMOD_DEFAULT, 0, &sound); FMOD::Channel *channel; system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); */ InitGL(640, 480); FREE_IMAGE_FORMAT formato = FreeImage_GetFileType("image.png",0);//Automatocally detects the format(from over 20 formats!) FIBITMAP* imagen = FreeImage_Load(formato, "image.png"); FIBITMAP* temp = imagen; imagen = FreeImage_ConvertTo32Bits(imagen); FreeImage_Unload(temp); int w = FreeImage_GetWidth(imagen); int h = FreeImage_GetHeight(imagen); //cout<<"The size of the image is: "<<textureFile<<" es "<<w<<"*"<<h<<endl; //Some debugging code GLubyte* textura = new GLubyte[4*w*h]; char* pixeles = (char*)FreeImage_GetBits(imagen); //FreeImage loads in BGR format, so you need to swap some bytes(Or use GL_BGR). for(int j= 0; j<w*h; j++){ textura[j*4+0]= pixeles[j*4+2]; textura[j*4+1]= pixeles[j*4+1]; textura[j*4+2]= pixeles[j*4+0]; textura[j*4+3]= pixeles[j*4+3]; //cout<<j<<": "<<textura[j*4+0]<<"**"<<textura[j*4+1]<<"**"<<textura[j*4+2]<<"**"<<textura[j*4+3]<<endl; } //Now generate the OpenGL texture object GLuint texturaID; glGenTextures(1, &texturaID); glBindTexture(GL_TEXTURE_2D, texturaID); glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA, w, h, 0, GL_RGBA,GL_UNSIGNED_BYTE,(GLvoid*)textura ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef(-3.0f,0.0f,-6.0f); glBegin (GL_QUADS); glTexCoord2f (0.0, 0.0); glVertex3f (0.0, 0.0, 0.0); glTexCoord2f (1.0, 0.0); glVertex3f (1.0, 0.0, 0.0); glTexCoord2f (1.0, 1.0); glVertex3f (1.0, 1.0, 0.0); glTexCoord2f (0.0, 1.0); glVertex3f (0.0, 1.0, 0.0); glEnd (); SDL_GL_SwapBuffers(); int done = 0; while ( ! done ) { /* This could go in a separate function */ { SDL_Event event; while ( SDL_PollEvent(&event) ) { if ( event.type == SDL_QUIT ) { done = 1; } if ( event.type == SDL_KEYDOWN ) { if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; } } } } } //Quit SDL SDL_Quit(); return 0; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: http://stackoverflow.com/questions/4153055/how-to-load-jpg-png-textures-in-an-sdl-opengl-app-under-osx
i am writing an SDL / OpenGL application that runs under OSX. I have to use existing code which uses the DevIL library for loading JPG and PNG textures. Unfortunately, this works very bad under OS X, so i decided not to use DevIL at all, and rewrite the respective parts of the application using another library. I want to keep it flexible (DevIL can handle a lot of image formats) and easy to use. Is there a good replacement for DevIL that you can recommend? The application is entirely written in C++.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Take a look at freeimage. It supports all major formats and is easily built with macports. Nice to work with as well. Auto-detects image format etc.
GLuint m_mpTextures;
FREE_IMAGE_FORMAT format = FreeImage_GetFileType(filename.c_str(), 0);
FIBITMAP *bitmap = FreeImage_Load(format, filename.c_str());
if (!bitmap)
{
LOG_ERROR("Unable to load texture: " + filename);
return false;
}
mlWidth = FreeImage_GetWidth(bitmap);
mlHeight = FreeImage_GetHeight(bitmap);
glGenTextures(1, &m_mpTextures);
glBindTexture(GL_TEXTURE_2D, m_mpTextures);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mlWidth, mlHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE,
(GLvoid*)FreeImage_GetBits(bitmap));
FreeImage_Unload(bitmap);
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you're on Mac OS anyway, why not just use CGImageSource to do the loading? OS X natively supports loading many file formats including PNG and JPEG.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Runnable SDL 2 example
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
int main(void) {
SDL_Event event;
SDL_Renderer *renderer = NULL;
SDL_Texture *texture = NULL;
SDL_Window *window = NULL;
SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO);
SDL_CreateWindowAndRenderer(
COMMON_WINDOW_WIDTH, COMMON_WINDOW_WIDTH,
0, &window, &renderer
);
IMG_Init(IMG_INIT_PNG);
texture = IMG_LoadTexture(renderer, "flower.png");
common_fps_init();
while (1) {
SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer);
common_fps_update_and_print();
if (SDL_PollEvent(&event) && event.type == SDL_QUIT)
break;
}
SDL_DestroyTexture(texture);
IMG_Quit();
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return EXIT_SUCCESS;
}
Compiled with:
sudo apt-get install libsdl2-dev libsdl2-image-dev
gcc -std=c99 main.c -lSDL2 -lSDL2_image
on Ubuntu 16.10, SDL 2.0.4.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
출처: https://solarianprogrammer.com/2013/05/17/opengl-101-textures/
The code for this post is on GitHub: https://github.com/sol-prog/OpenGL-101.
This is the third article from my OpenGL 101 series. In the first two articles we’ve seen how we can open a window and draw OpenGL primitives: points, lines and triangles. We’ve also seen how we can assign a particular color to a vertex and use this to paint a two-dimensional surface with a smooth color.
Suppose now that we want to draw something more complex like the ruins of an ancient building, think a bit about how we can draw something as close as possible to what we can see in the real world. Theoretically, we can model everything with triangles and calculate the colors corresponding to each vertex, but this quickly gets out of hand - we are limited by the memory of our graphics card and by the speed of our graphics processor. A much practical approach to create the illusion of reality is to use textures that can be glued on the geometrical representation of our computer world.
In this article, we will concern ourselves only with two-dimensional textures, OpenGL can use other type of textures: 1D, 3D, cube textures etc … Technically a texture is just a container for data, you can store any numerical values in a texture, usually color values, and process this data in your shaders, usually in the fragment shader.
Let’s start with something simple like reading an image from a file in a 2D texture and using the color information from this to paint a simple 2D surface - the square from ex_9, see the last article if you need to refresh your memory:
We say that a texture is composed of texels, for a 2D texture the texel space can be represented like in the next figure:
If we have an image data in our texture, the lower left corner of the image will be at (0, 0) and the upper right corner at (1, 1) in the (s, t) space. It is important to note that the image data, the pixel values, is layered in memory starting from the upper left corner to the right, and from the top to the bottom, using the C convention for storing an array in memory.
When we work with textures in OpenGL, we need to specify the texture coordinates, the position of the texture in the (s, t) space. If we want to map an image to a rectangle, we can use the next texture coordinates:
If you want to follow along, copy ex_9 from the previous article to ex_10 and add the texture_coord array in the intialize function, we’ll also need to remove/comment any code that uses the colors array.
We could store the texture_coord in the same VBO that stores the vertex_position array:
In order to create a texture, we follow the same recipe as in the case of a buffer object. We start by asking OpenGL for a unique identifier for our texture:
Next step is to specify that we will work with a 2D texture:
Now, we need to actually load an image from a file and initialize the texture with the the color data from the image, we can abstract this by calling a, to be discussed, function load_image, that takes as a parameter the path to the image file:
At the end of the initialize function let’s enable the texture_coord attribute, we’ll need this as an entry point to the vertex shader:
Now, we need to modify the vertex shader in order to accept as input the texture_coord data and send it, through the OpenGL pipeline, to the fragment shader:
The fragment shader needs more modifications:
Line 6 from the above shader defines a uniform shader variable, a 2D texture sampler - this is used internally by OpenGL to sample, or map, values from the continuous (s, t) space to the discrete color data stored in our texture. A uniform is a read-only variable for a shader and it is constant for all shaders, in other words it is a global variable for all shaders.
Line 9 will extract the color information for the current fragment based on the texture sampler and on the texture coordinates.
Now, we can discuss the load_image function. As mentioned in the first article from this series, OpenGL doesn’t include functionality for reading/writing image files. We could use the FreeImage library to read/write images. There are a number of other image processing libraries available, some free and open source like FreeImage, feel free to test other libraries if you don’t like FreeImage. I prefer to use FreeImage because it is a relatively small library, open source and portable on all major operating systems.
You can find the complete source code for load_image on the Github repository for this article, in ex_10. In the next chunk of code we omit the boilerplate code used to initialize FreeImage and other cleaning operations:
Line 29, or 32 for RGBA images, allocates the necessary memory for storing the image data and fills the texture with the color data from the original image. glTexImage2D creates a mutable storage for our texture, this is useful if you plan to later resize the texture storage, perhaps to accommodate a larger or a smaller image. On the other hand, if you know that your texture storage will remain constant it is more efficient to use glTexStorage2D to allocate space and glTexSubImage2D to add data to the texture. glTexStorage2D will create an immutable storage for our texture. In both cases, mutable or immutable storage, we can modify the data stored in a texture.
Next two highlighted lines instructs OpenGL how to interpolate the image data when we scale up or down the original image, in this case we will use linear interpolation.
If you’ve installed FreeImage on OS X using my modified Makefile, as suggested in the first article, you will need to add an extra parameter stdlib=libc++ when you use FreeImage, specifically:
If you run ex_10, this what you should see:
Please note that I’ve commented the line that sets the clear color to red, the default clear color for OpenGL is black.
If you want to completely fill the available window surface you can change the vertices_position accordingly:
Say that you want to use tones of grey for the texture and not the original RGB colors, we can modify the fragment shader to average the red, green, blue from the original image and use this average color as the output color from the shader:
If you run ex_11, this is what you should see:
We can get more interesting effects if we extend the texture coordinates outside the (s, t) space, which is defined as the unit square [0, 1] x [0, 1], the image will be wrapped on the missing values. We can control the wrapping mode with glTexParameteri.
First, let’s change the texture_coord array:
If you run ex_12, this is what you should see:
By default, OpenGL will repeat the image in both s and t directions for values outside of the unit square. Same effect can be obtained if we set (this is the default wrap mode):
Other possible value for the third parameter in the above function: GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER, GL_MIRRORED_REPEAT, if you press W while running ex_12 you can test all these wrap options:
- GL_CLAMP_TO_EDGE
- GL_CLAMP_TO_BORDER
- GL_MIRRORED_REPEAT
In the next article, we are going to talk about geometrical transformations - translation, scaling, rotation, projection matrix and the camera model. If you don’t know what matrix multiplication means, or the inverse of a matrix is, you are going to have a hard time working with more complex models. Take your time and read a bit about basic matrix operations: addition, multiplication, inverse of a matrix, a simple Google search will do. You don’t need to be an expert, but you need to know what these operations means.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'프로그래밍 관련 > 3D,2D DRAW 관련' 카테고리의 다른 글
OpenGL 중 glew.h 를 include하면 에러가 나는데 어떻게 해결해야 할까요? (0) | 2017.05.17 |
---|---|
OpenGL 오픈지엘 테스트 그리기 관련 (0) | 2017.05.10 |
SDL 개발환경 셋팅 관련 (0) | 2017.05.10 |
OpenGL 오픈지엘 glew 관련 외부 기호를 확인할 수 없습니다. 에러 관련 (0) | 2017.04.25 |
[FAQ] Directx 3D (0) | 2011.03.30 |