functions of WebGL, in this paper, we do not use a perfect framework, but only use a framework (gl-matrix.js) to help calculate the matrix ).
Like using OpenGL, We need to initialize the use environment and extract some global usage. The related code is as follows:
Initialization:
Var gl; // WebGLRenderingContextvar cubeVBO; // Cube buffer IDvar sphereVBO; // sphere VBOvar sphereEBO; // sphere EBOvar cubeT
The previous article describes WebGL.Further streamlined here.The whole content of WEBGL is to create different shaders,Provides data to the shader and then calls gl.drawArrays or gl.drawElementsLets WebGL invoke the current vertex shader to process each vertex, calling the current fragment shader to render each pixel.Since shaders require data, shaders are divided into two parts, vertex and fragment shadersThe data that is required by the vertex shader can be obtained in the following three way
After the ports and src are upgraded, the infrastructure is complete. Now let's compile the kernel.Enter the Kernel configuration file directory# Cd/usr/src/sys/i386/conf# Mkdir/root/kernels# Cp GENERIC/root/kernels/IM. RD. BJ# Ln-s/root/kernels/IM. RD. BJIM. RD. BJ: the name of your new Kernel configuration file.Compile the kernel# Cd/usr/src# Make buildkernel KERNCONF = IM. RD. BJInstall Kernel# Make installkernel KERNCONF = IM. RD. BJYou can configure your own Kernel File IM. RD. BJ before co
dumpbin, use the following syntax:
DUMPBIN [options] files...
Specify one or more binary files and any options required to control information. Dumpbin displays the information to the standard output. You can redirect the output to a file, or use the/out option to specify the file name for the output.
When dumpbin is run on the file but no option is specified, dumpbin displays/summary output.
When you type a commanddumpbinHowever, when there is no other command line input, dumpbin displays usag
string that stores N-relationshipsVertexnode *GL: Array of vertex tablesOutput variable: An array of vertex tables representing graphsreturn value: Int: number of vertices*/Intcreategraph (char *data, Vertexnode *GL){int i, u, v;int count = 0;//record vertex countEdgenode *e;for (i=0; i{Gl[i].data = i + ' a ';gl[i].in
onsurfacecreated (gl10 GL, eglconfig config) {// called after surface is created// Todo auto-generated method stub// Enable the differentiation of which side may be visibleGl. glable (gl10.gl _ cull_face); // enable the culling surface to ensure only one side// Which is the front? The one which is drawn counter clockwiseGl. glfrontface (gl10.gl _ CCW); // gl_ccw
This article refers to the WebGL Programming Guide
Using the knowledge from the previous chapter, draw the following points:Source:Test.jsfunctionMain () {varGL =Init (); if(!GL) {Console.log (' Failed to Init '); return; } varn =initvertices (GL); if(N ) {Console.log (' Failed to init vertices '); return; } gl.drawarrays (GL. POINTS,0, n);}//@Func: init th
adjlist;int numvertexes,numedges; /* Current number of vertices and number of edges in the graph */}graphadjlist,*graphadjlist;/* **************************** */void Createmgraph (Mgraph *g)/* Component Diagram */{int I, J;/* printf ("Please enter the number of sides and vertices:"); */g->numedges=maxedge;g->numvertexes=maxvex;for (i = 0; i {g->vexs[i]=i;}for (i = 0; i {for (j = 0; J {g->arc[i][j]=0;}}g->arc[0][4]=1;g->arc[0][5]=1;g->arc[0][11]=1;g->arc[1][2]=1;g->arc[1][4]=1;g->arc[1][8]=1;g->
Method@ OverridePublic Boolean ontouchevent (motionevent e ){Float y = E. Gety ();Float x = E. getx ();Switch (E. getaction ()){Case motionevent. action_move:Float DY = Y-mpreviousy; // calculates the y displacement of the touch pen.Float dx = x-mpreviousx; // calculates the Y-shift of the touch pen.Mrenderer. cylinder. manglex + = Dy * touch_scale_factor; // you can specify the Rotation Angle along the X axis.Mrenderer. cylinder. manglez + = DX * touch_scale_factor; // you can specify the Rota
performed, however, we are not considering this issue for the moment. The frequency of the second step should be the most important. First, write a simple program to test the consumption caused by this step of transmission.The Code is as follows:Var canvas = document. createElement ('canvas ');Var _ gl = canvas. getContext ('experimental-webgl ');Var vertices = [];For (var I = 0; I Vertices. push (I * Math. random ());}Var buffer = _
AbbreviationPS = Photoshop/AI = Illustrator/GL = GoLiveAE = AfterEffects/LM = LiveMotion/AS = AtmosphereDW = DreamWeaver/FW = FireWorks/
First of all, Look clearly. What I'm talking about is possible. Don't blame me if it doesn't happen in the future.
From the perspective of Adobe's sudden acquisition of Macromedia, it was actually premeditated.
After seeing that the MM product line is constantly enriched and improved, AdobeFinally, we made a try-and-
multiplied with the previous result, passed to uniform, and then plotted.So, take a look at the actual code.Part of the code in >script.jsThe generation and initialization of various matrices var Mmatrix = m.identity (M.create ()), var Vmatrix = m.identity (M.create ()), var PMatrix = m.identity ( M.create ()), var Tmpmatrix = m.identity (M.create ()), var Mvpmatrix = m.identity (M.create ());//view x projection coordinate transformation matrix M.lookat ([0.0 , 0.0, 3.0], [0, 0, 0], [0, 1, 0],
the original binary details of the file.Only the/headers dumpbin option can be used for files generated by the/GL compiler option.
2
/ARCHIVEMEMBERS
This option displays the minimum information about database Member objects.Only the/headers dumpbin option can be used for files generated by the/GL compiler option.
3
/CLRHEADER file
Image files generated by/clr.RemarksCLRHEADER
First of all, there are too few colleagues in OpenGL, especially ndk, in China.
There are many problems encountered in this process, and these problems need to be found on the book, on the Internet, on a variety of materials, and the book is called at the java layer, the lack of various file cases on the internet, only by studying at the java layer and finding the required knowledge points in various cases can google search foreign websites solve the problem.
Next body
-----------------------
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.