>

2014년 4월 8일 화요일

Starting OpenGL 4 (above L3.2) in Mac OS X

* Starting Point for Learning
> Follow the instructions in http://www.opengl-tutorial.org. Very good. Almost perfect except for a few things listed below
>> download the normal version
>> uncompress
>> cd build; 
>> cmake -G Xcode .. (to use XCode IDE)

> Don't forget to include the following line to make OpenGL work properly in Mac OS X Maverick.
  glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

> Fix in the fragment shader program:
   texture2D -> texture
>> The texture coordinate uv is somehow inverted in the code to use DDS texture. So it is OK for DDS. Otherwise, you need to fix the code by yourself.
> The mouse control in Tuturial06 did not work. I don't know why yet. Simply change it as you like.

> Get version info
  const GLubyte* renderer = glGetString (GL_RENDERER); // get renderer string
  const GLubyte* version = glGetString (GL_VERSION); // version as a string
  printf ("Renderer: %s\n", renderer);
  printf ("OpenGL version supported %s\n", version);

* Other good reference or tutorial.


Anton's OpenGL 4 Tutorial:  http://antongerdelan.net/opengl/

* Need to install glfw3, glew, glm
  > $ brew install glfw3 glew glm

* GLFW (version 3) library
   http://www.glfw.org/docs/latest/quick.html
* GLEW 

* DDS texture utility in Mac: Aorta
   http://sourceforge.net/projects/aorta/

* Loading OBJ/MTL in OpenGL
   http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Load_OBJ
   http://en.wikipedia.org/wiki/Wavefront_.obj_file#Material_template_library

* free OBJ files
   http://www.nasa.gov/multimedia/3d_resources/assets/aces.html

* texture disabling
   glBindTexture (GL_TEXTURE_2D, 0);

* rotation/translation/scaling transformation with GLM
glm::vec3 axsis = glm::vec3(1.f,0.f,0.f);
glm::mat4 newRot = glm::rotate(X, angle, axis);
> new Rot = X * Rotation(angle, axis)

// ---------------------------------------------------------------------------------

http://en.wikibooks.org/wiki/OpenGL_Programming
OpenGL 2.1+

http://openframeworks.cc/tutorials/graphics/opengl.html
http://www.tomdalling.com/blog/category/modern-opengl/
http://openglbook.com/
http://www.rastertek.com/tutgl40.html
http://www.swiftless.com/opengl4tuts.html
http://www.swiftless.com/

// END

댓글 없음:

댓글 쓰기