opengl-es

take screen Programmatically of UIview+glview

瘦欲@ 提交于 2019-12-19 11:55:13
问题 i have glview in my uiview ,now i have to take scrren shot of combine view of uiview and glview. i googled lot but i dnt found any thing useful i know how to take scrrenshot of glview nt width = glView.frame.size.width; int height = glView.frame.size.height; NSInteger myDataLength = width * height * 4; // allocate array and read pixels into it. GLubyte *buffer = (GLubyte *) malloc(myDataLength); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); // gl renders "upside down"

Android OpenGL: Possibly Running Out Of Memory?

让人想犯罪 __ 提交于 2019-12-19 11:52:13
问题 I have been trying to fix this issue for weeks but I'm at the point where I dont know what to do now. I think that some Android devices dont have enough memory to load the amount of textures, although it could be something else causing the issue, as I said I really dont know what to do with this. There are 28 PNG's being loaded all 1024x1024 which come to a total of 4.8megs. Below is the OpenGL method for loading textures GL10 gl = glGraphics.getGL(); int[] textureIds = new int[1]; gl

Page Curl with best quality

人走茶凉 提交于 2019-12-19 11:51:10
问题 I am working with Harism Page Curl(Open GL) https://github.com/harism/android_page_curl and its works fine. Output is something like this: It's not smooth too much. I want something like this: 回答1: In CurlMesh class, default maxCurlSplits is 10. Increasing this number, increasing quality of lines of area. 来源: https://stackoverflow.com/questions/30726077/page-curl-with-best-quality

Black out everything outside a polygon

二次信任 提交于 2019-12-19 11:43:00
问题 I have a map, for simplicity let's say it's just a single texture. On top of this map, I have a polygon which indicates the route that the user must follow. What I want is to draw everything outside the polygon black. Or, of course to only draw things inside the polygon. To explain it better I made a picture. The blue lines define the polygon, with each corner being a point in the polygon. The red with yellow lines is the part I want to black out of the picture, and only leave the red with

Black out everything outside a polygon

北战南征 提交于 2019-12-19 11:42:31
问题 I have a map, for simplicity let's say it's just a single texture. On top of this map, I have a polygon which indicates the route that the user must follow. What I want is to draw everything outside the polygon black. Or, of course to only draw things inside the polygon. To explain it better I made a picture. The blue lines define the polygon, with each corner being a point in the polygon. The red with yellow lines is the part I want to black out of the picture, and only leave the red with

convert Vertex buffer to Vertex array

血红的双手。 提交于 2019-12-19 10:44:11
问题 I'm working on OpenGL program and I must calculate a bounding box . I made the code to do it but I can't get vertexes coordinations from vertex buffer . Someone can explain me an easy way to get data from vertex buffer? I'm using Java for android and OpenGL es 回答1: If you use OpenGL ES 3.0 or later, you can use glMapBufferRange() to access buffer data directly. See the man page for details about the functionality, and the GLES30 documentation for details about the Java bindings in Android. I

Non-radial texture mapping over a ring geometry in WebGL using Three.js

最后都变了- 提交于 2019-12-19 10:41:21
问题 I am trying to simulate image deformation effects using textures over 2D geomtries using the ThreeJS library. I want to apply a texture image over a hollow circle (basically, a ring built by the THREE.RingGeometry function) and obtain the results shown at this image: Following I show the results I am obtaining in my scene both for the solid ring and its wireframed version: The problem is that, as you see, the texture is been applied in a radial way, from the center of the ring to the outside.

Fastest way to load arrays of vertices and face indices into OpenGL-ES?

╄→гoц情女王★ 提交于 2019-12-19 09:37:08
问题 I'm trying to load .obj files that I've formatted into: vertexX vertexY vertexZ normalX normalY normalZ and: index1 index2 index3 format into vector and vector arrays, which I then directly render in Opengl-ES. My problem is, when I try to load the model into the arrays, it takes about 40 seconds to load them in. I'm not sure why it's going so slow, I've seen others code load the same model in just a few seconds. Any suggestions? My code for loading the file is below: -(void)loadModel:

Is it possible to measure rendering time in webgl using gl.finish()?

点点圈 提交于 2019-12-19 06:14:56
问题 I am trying to measure the time it takes for an image in webgl to load. I was thinking about using gl.finish() to get a timestamp before and after the image has loaded and subtracting the two to get an accurate measurement, however I couldn't find a good example for this kind of usage. Is this sort of thing possible, and if so can someone provide a sample code? 回答1: No it is not. In fact in Chrome gl.finish is just a gl.flush . See the code and search for "::finish". Because Chrome is multi

iPad app only shows black screen after updating to iOS4 SDK

浪子不回头ぞ 提交于 2019-12-19 04:11:00
问题 I just opened an iPad app I'd been working on and it was working fine, until now. I open it and the screen remains black, even after it's loaded! It's an OpenGL and I just downloaded the iOS4 SDK. I also added a provisioning profile. Would any of these changes result in a completely black screen with no error for no reason at all? It loads the MainWindow.xib but doesn't show it. It's thinking but doesn't register touch events. All this was working until now. 回答1: Solution: open your