Original linkOpenGL environment Configuration Freeglut and GlewFreeglut: A third-party library that can be used to display windows, manage user input, and perform some other action.Glew: A cross-platform third-party library simplifies the process of acquiring function addresses and includes some other OpenGL programming methods that can be used across platforms.This article uses a library file that adds Freeglut and Glew to a directory that we have bu
The purpose of this experiment: Install and configure the environment. 1 Downloads https://www.opengl.org/ Https://www.opengl.org/wiki/Getting_Started#Downloading_OpenGL Find the https://www.opengl.org/sdk/libs/in the SDK Glus download, unzip will get a file 2 installation I'm using Ms Studio 2015. This is the installation directory for my MS Studio: C:\Program Files (x86) \microsoft Visual Studio 14.0 First, put the Glut.lib and glut32.lib files in
Start learning OpenGL from today.First, the environment is built, VS2013 Community Edition +freeglut 3.0.0.Freeglut Introduction is not necessary, Google itself. Address: http://sourceforge.net/projects/freeglut/Unzip after download, build the environment according to the readme.
Installation============
See Readme.cmake as a starting point, as well as the other READMEFiles for further info.
----------------------------------------------------
GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER
Parameter 2, memory capacity
Parameter 3 is used to initialize a buffer object. It can be a pointer or empty.
Parameter 4: how to read and write data, you can select the following types
GL_DYNAMIC_DRAW
GL_STATIC_DRAW
GL_STREAM_DRAW: The data is specified only once. It can be used only a few times as the source data of the function specified for drawing and image. The data in the buffer object often needs to
. you should check the texture compression formats supported on the target device to determine the format used by your application. to determine which compression format is used on the device, you must query the device and check the OpenGL extension name. The extension name identifies the texture compression formats supported by the device (and other OpenGL features ). some frequently supported texture comp
. you should check the texture compression formats supported on the target device to determine the format used by your application. to determine which compression format is used on the device, you must query the device and check the OpenGL extension name. The extension name identifies the texture compression formats supported by the device (and other OpenGL features ). some frequently supported texture comp
Opengl basic learning topic (2) vertices, straight lines, and polygon
Digress
As learning grows, I feel more and more confused. In the previous blog, we recommend that you use a simplec framework based on VS2015 to learn opengl.
Some problems.
1. The Release version is not considered in the VS Debug mode.
2. In this v
, you can think of an arc as a lot of shortStraight segments that are short enough to be less than the width of one pixel in length. So arcs and circles can also be represented.The By connecting small polygons in different planes, we can also form a "surface".Ii. specifying vertices in OpenGLAs can be known from the above discussion, "point" is the basis of everything.How do I specify a point? OpenGL provides a series of functions. They all start with
. point, line, and polygon
PointRepresented by a vector containing three floating point numbers, also known as vertex (vertex ). OpenGL uses the "homogeneous coordinates", so four floating point numbers (X, Y, Z, W) are used internally ). If W! = 0, equivalent to (x/W, Y/W, Z/W ).
Baidu Encyclopedia "homogeneous coordinates ":
Homogeneous coordinates are represented by an n + 1-dimension vector, which is or
quite easy for us to draw a background. We enable face-to-face projection and draw a full screen image texture of the current frame. The following is the OpenGL ES1 code:
-(Void) drawbackground {// obtain the glfloat W = ceiling; glfloat H = m_glview.bounds.size.height; // The Four vertex coordinates const glfloat squarevertices [] = {0, 0, w,
. We only have one attribute, so the value is 0. If we have two attributes, A position and a normal direction. If they are all vectors in the 3-dimensional float format, this parameter must be set to (6*4) = 24 byte, And the last parameter is offset, if there are two attributes, this value is 0 for the first attribute, no offset, and 12 for the second attribute.
glDrawArrays(GL_POINTS,
Rotation:
In this lesson, I will teach you how to rotate triangles and quadrilateral. The triangle in the left graph rotates along the Y axis, and the Quadrilateral rotates along the X axis.
In the previous lesson, I will teach you how to color triangles and quadrilateral. This lesson will teach you how to rotate these color objects around the axis.In fact, you only need to add a few lines to the code of the previous lesson. Next I will rewrite the entire routine. So that you can know what is a
NeHe OpenGL lession 2
# Include
# Include
# Include
# Include
# Include
// Header file for sleeping/* ASCII code for the escape key. */# define ESCAPE 27/* The number of our GLUT window */int window;/* A general OpenGL initialization function. sets all of the initial parameters. * // * We call this right after our
AbstractY = a + B; how can we use digital reality for a very simple computing?
IntroductionUse environment: US us II 8.0
Y = a + B; this is a simple operation in C. However, if you want to use OpenGL on the digital path, beginners may encounter some difficulties.
Y = a + B
Do not use clockAdd2_assign.v/OpenGL
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter
Original works can be reprinted. During reprinting, you must mark the original source, author information, and this statement in hyperlink form. Otherwise, legal liability will be held. Http://yarin.blog.51cto.com/1130898/380265
Lesson 2: Polygon
Your first polygon:
Based on the first tutorial, we added a triangle and a quadrilateral. You may think this is simple, but you have taken a big step to know that any model drawn in
position and direction: rotation, movement, and scaling.
View TransformationView transformation is equivalent to fixing the camera on a tripod and aligning it with the scene
Projection TransformationProjection Transformation is equivalent to selecting the camera lens, that is, determining the field of view
View TransformProjection Transformation specifies the ing mechanism, and the viewport transformation determines the shape of the valid screen area.
General functionsvoid glMatrixMode(GLen
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.