This article provides some commonly used OpenGL plotting functions and APIs for reference.
GLUT toolbox Functions
The glut toolkit provides several functions for 3D graphics:
Void gluwiresphere (gldouble radius, glint slices, glint stacks); filament ball
Void maid (gldouble radius, glint slices, glint stacks);
Android OpenGL ES plotting tutorial 3: Drawing GraphicsAfter defining the shapes to be drawn by OpenGL, you certainly want to draw them. Using OpenGL ES 2.0 to draw a graph may require more code than you think, because the API provides a large number of graphic rendering pipeline control interfaces.This chapter describ
I recently started learning OpenGL again. Some practical functions I wrote during the learning process can be shared here:
1. The following functions can output some information about current OpenGL in the console (to be called after the window is created, otherwise null value will be obtained)
Void printglinfo ()
2.
interface for unified graphic rendering. It defines the following three interface functions:
// Called when the surface is created or recreated.public void onSurfaceCreated(GL10 gl, EGLConfig config)// Called to draw the current frame.public void onDrawFrame(GL10 gl)// Called when the surface changed size.public void onSurfaceChanged(GL10 gl, int width, int height)
Onsurfacecreated: This method is mainly used to set parameters that do not change fr
Original post address: http://ogldev.atspace.co.uk/www/tutorial04/tutorial04.html
This chapter begins to learn how to use shader. In the past, many people often used OpenGL fixed pipelines to do some programs. shader is rarely used, while modern GPU programming and shader applications are indispensable. Although shader programming is used, A little more code, but more flexible.
The shader pipeline diagram of Open
] * vplaneequation[3]; -}View Code1 //Given three points on a plane in counter clockwise order, calculate the unit normal2 voidGltgetnormalvector (ConstGLTVector3 vP1,ConstGLTVector3 vP2,ConstGLTVector3 vP3, GLTVector3 vnormal)3 {4 GLTVector3 vV1, vV2;5 6 gltsubtractvectors (vP2, vP1, vV1);7 gltsubtractvectors (vP3, vP1, vV2);8 9 gltvectorcrossproduct (vV1, vV2, vnormal);Ten Gltnormalizevector (vnormal); One}View CodeThe second type:The Createshadowmatrix function is the focus1 The s
Thoughts on OpenGL functions-glflush and glswapbuffers
Function prototype:
VoidGlflush(VoidVoid)
Void gluswapbuffers(Void)
Function Description:
Glflush is used to force the output of command execution results immediately, instead of storing the results in the buffer, and waits for other OpenGL commands.
When performing a double buffer exchange,Use glu
This chapter tutorials mainly from: http://ogldev.atspace.co.uk/www/tutorial01/tutorial01.html
Before using OpenGL, install and set freeglut and glew ,:
Http://freeglut.sourceforge.net/
Http://glew.sourceforge.net/
Source code Tutorial: http://ogldev.atspace.co.uk/ogldev_win.zip
As a 3D graphic interface, OpenGL does not provide any window management function.
Because of work, I don't have much time to focus on game development. Here we will list some previously collected OpenGL tutorials and share them with friends who like OpenGL and game development. Of course, there are still some good tutorial websites not included in it. You are welcome to add that the title "Top Ten" is completely designed to attract everyone's
Thoughts on OpenGL functions-glvertex
Function prototype:
Glvertex4i,Glvertex4s,Glvertex2dv,Glvertex2fv,Glvertex2iv,Glvertex2sv,Glvertex3dv,Glvertex3fv,Glvertex3iv,Glvertex3sv,Glvertex4dv,Glvertex4fv,Glvertex4iv,Glvertex4sv
Example:
Glvertex3f (glfloatX, GlfloatY, GlfloatZ)
Function Description:
The glvertex function is used between glbegin and glend, Which is meaningless. Used to specify vertex, line, and
corresponding key array to false.Killglwindow (); // destroy the current windowFullscreen =! Fullscreen; // switch to full screen/window mode// Recreate the OpenGL window (modify)If (! Createglwindow ("nehe's first polygon tutorial", 640,480, 16, fullscreen )){Return 0; // exit the program if the window cannot be created}}
Markus Knauer note: In ("OpenGL
location corresponding to the current position Gldrawbuffer: Select one or more cache glreadpixels to store the pixel map: deposit A pixel in the specified array glcopypixels: Copy a pixel from one cache to another GLLOGICOP: Select a logical operation after activating with constant GL_COLOR_LOGIC_OP to combine the two pixels group Glutbitmapcharacter (font, char) : Select a font and a bitmap profile character to display glutstrokecharacter (font, char): Select a font and a contour character to
'd like to tell you that people use cameras to observe things in 3D, although OpenGL does not actually have a camera. So when you move on the screen, you are actually moving all objects, and the feeling of motion is not caused by the creation of a camera to watch movies, instead, all objects in the world are moved with the relative coordinates (0, 0.
It sounds like this is a huge workload, but it is not. According to your application, you will perfor
Currently, OpenGL functions are mainly included in three libraries.1. GL function library2. Glu function library3. glut function library
1. GL library functions
Color editing-------------------GlshademodelSelect either flat or smooth.Void glshademodel (glenum Mode)Parameter: mode indicates the symbol value of the Light and Dark modes. The options a
Getting Started with OpenGL Learning 1: Writing the first OpenGL program Http://www.c3dn.net/forum.php?mo ... d=20extra=page%3d3Getting Started with OpenGL Learning 2: points, lines, and polygons http://www.c3dn.net/forum.php?mo ... id%3d5%26typeid%3d5Getting Started with OpenGL Learning 3: Drawing the details of the g
OpenGL functions-glbegin and glend
Function prototype:
Void glbegin(GlenumMode)
Void glend(Void)
Parameter description:
Mode: Type of the created element. It can be the following value
Gl_points: processes each vertex as a vertex. vertex N defines vertex N and draws n vertices in total.
Gl_lines: Each vertex is used as an independent line segment. n lines are defined between the 2n-1 and 2n v
The code is not analyzed here because it is enough in the tutorial. If you are interested, you can check the code yourself. This tutorial comes from the original neheopengl Chinese tutorial (http://www.yakergong.net/nehe/), but it has a bad place, that is, when I go to see, it can not download the code ~~~~ Maybe my character is poor. It can be used as a referenc
Guidance: Modern OpenGL Tutorial 01--Getting Started GuideIn this article, we'll add a map to the triangle, which involves adding some new variables to the vertex and fragment shader, creating and using the mapped object, and learning a bit about the mapping unit and mapping coordinates.This article uses two new classes into the Tdogl namespace: Tdogl:bitmap and Tdogl:texture. These classes allow us to uplo
GLUTTutorial
Prepare for transformation window
Download the following vcpus and run the program (glu0.zip) (this is the project in the previous section ). You will see two windows: a console window and an OpenGL window. Change the window size so that the height and width are no longer equal, and the triangle is deformed. This occurs because you have not correctly set the projection matrix. The default value is the Perspective Projection Matrix and t
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.