opengl-es

In the stock OpenGL ES app on iOS 5.1, are they really using the vertex arrays they declare?

牧云@^-^@ 提交于 2019-12-13 19:26:13
问题 In the stock OpenGL ES app you get (when you create a new "OpenGL game" in XCode), in the setupGL function, there is: glEnable(GL_DEPTH_TEST); //glGenVertexArraysOES( 1, &_vertexArray ) ; // va's are not being used! //glBindVertexArrayOES( _vertexArray ) ; // we comment these out // to no ill effect -- are these calls extraneous? glGenBuffers( 1, &_vertexBuffer ) ; glBindBuffer( GL_ARRAY_BUFFER, _vertexBuffer ) ; glBufferData( GL_ARRAY_BUFFER, sizeof(gCubeVertexData), gCubeVertexData, GL

Rotating a sphere around another using OpenGL ES on Android

限于喜欢 提交于 2019-12-13 17:27:20
问题 I have the following problem: I'm trying to create a solar system in OpenGL ES on Android. I already have some spheres. Now I want to make the spheres rotate in an orbit around the biggest sphere in the center (like the planets rotate around the sun). How do I do that? The rotation of a sphere around itself works, but I don't know how to make it rotate around another sphere. Also, I have a problem with colors. There must be a problem somewhere in my code, because all my "planets" are grey. I

How integrated is Collada to OpenGL ES

孤街醉人 提交于 2019-12-13 17:04:45
问题 All over where I read about the Collada file format I see some hint as to how integrated Collada is to OpenGL ES - or the other way. How integrated is it really? I suspect not, but are there functions that directly work with Collada files? - or even parts of Collada files? Or do I need to create my own parser from the ground up? 回答1: You need to create your own parser, OpenGL or OpenGL ES doesn't have any model/mesh loading functionality, that's the developer's responsability. 回答2: I think

What is the best way to render blender model in Android?

拈花ヽ惹草 提交于 2019-12-13 16:34:44
问题 I know there is way to parse Blender model by exporting it as OBJ (WaveFront) file and then parsing its (plaintext) contents, but this is silly when you're dealing with huge models. It just doesn't make sense to parse the file every time the application loads when the file itself is 5MB heavy (the obj file). I came to an idea to parse it once and record all those coordinates into arrays and then just use them to draw the model, but not sure if this is the right way. What is the recommended

WebGL/OpenGL: Rotate camera according to device orientation

走远了吗. 提交于 2019-12-13 16:23:41
问题 I have a web application I am trying to show a plane of map image tiles in a 3D space. I want the plane to be always horizontal however the device rotate, the final effect is similar to this marine compass demo. I can now capture device orientation through the W3C device orientation API for mobile devices, and I successfully rendered the map image tiles. My problem is me lacking of essential math knowledge of how to rotate the camera correctly according to the device orientation. I am using

Problems Using Wavefront .obj's texture coordinates in Android OpenGL ES

不想你离开。 提交于 2019-12-13 15:55:20
问题 I'm writing an android app using openGL ES. I followed some online tutorials and managed to load up a textured cube using hard-coded vertices/indices/texture coordinates As a next step I wrote a parser for wavefront .obj files. I made a mock file using the vertices etc from the tutorial, which loads fine. However, when I use a file made using a 3d modelling package, all the textures get messed up Below is how I'm currently getting the texture coordinates: First I load all the texture

OpenGL Shaders. Pass array of float

耗尽温柔 提交于 2019-12-13 14:33:04
问题 On my scene i have many objects that i want to rotate at the same time but on different angles. I have a shader that computes position of each object and draw the whole scene (pass vertex array into the shader with array of vertexes). "uniform float uRotation;" + ... " mat4 mz = mat4(1.0);" + " mz[0][0] = cos(rotation);" + " mz[0][1] = sin(rotation);" + " mz[1][0] = -sin(rotation);" + " mz[1][1] = cos(rotation);" + ... gl_Position = uMVPMatrix * (aPosition *mz); i have all my vertexes,

How to get notified when glTexImage2D finished upload?

不羁岁月 提交于 2019-12-13 14:22:12
问题 I want to render after a texture is uploaded to OpenGL, but I cannot get notified about the completition. I do want to avoid using animation, or any kind of repetitive rendering. Is glTexImage2D asynchronous at all? As far as I know, almost every OpenGL call is async. It would be great anyway, if I could be informed about a glDrawArrays completition as well. 回答1: The answer is, just continue after the call to glTexImage2D returns. From your point of view it is a synchronous call in the sense

glReadPixels only saves 1/4 screen size snapshots

空扰寡人 提交于 2019-12-13 14:12:34
问题 I'm working on an Augmented Reality app for a client. The OpenGL and EAGL part has been done in Unity 3D, and implemented into a View in my application. What i need now, is a button that snaps a screenshot of the OpenGL content, which is the backmost view. I tried writing it myself, but when i click a button with the assigned IBAction, it only saves 1/4 of the screen (the lower left corner) - though it does save it to the camera roll. So basically, how can i make it save the entire screensize

Lots of allocations in Libgdx slow down game and cause sprite-jolts

旧巷老猫 提交于 2019-12-13 12:44:36
问题 I found out that LIBGDX allocates a lot of variables (not from any of my methods). I just ran the game for a few seconds and I've already got 32000 rows in DDMS->Allocation Tracker . The methods that allocate are getPalmRejection , createFromParcel and nativeReadString . Is it normal to have this many allocations in just a couple of seconds? I get 60FPS but sometimes it drops to 58-59 and that is important because I use framerate-independent movement in my game and I get alot of sprite-jolts