opengl-es

How to manipulate texture content on the fly?

前提是你 提交于 2019-12-17 17:29:20
问题 I have an iPad app I am working on and one possible feature that we are contemplating is to allow the user to touch an image and deform it. Basically the image would be like a painting and when the user drags their fingers across the image, the image will deform and the pixels that are touched will be "dragged" along the image. Sorry if this is hard to understand, but the bottom line is that we want to edit the content of the texture on the fly as the user interacts with it. Is there an

To Convert Image to Cartoon in ios

佐手、 提交于 2019-12-17 17:27:05
问题 Is there any filters available in ios to convert a image to cartoonistic image like exactly in the above picture? 回答1: For a much faster solution than ImageMagick, you could use the GPUImageToonFilter from my GPUImage framework: It combines Sobel edge detection with posterization of the image to give a good cartoon-like feel. As implemented in this framework, it's fast enough to run on realtime video from the iPhone's camera, and is probably at least an order of magnitude faster than

How to use onSensorChanged sensor data in combination with OpenGL

好久不见. 提交于 2019-12-17 17:25:06
问题 ( edit: I added the best working approach in my augmented reality framework and now also take the gyroscope into account which makes it much more stable again: DroidAR framework ) I have written a TestSuite to find out how to calculate the rotation angles from the data you get in SensorEventListener.onSensorChanged() . I really hope you can complete my solution to help people who will have the same problems like me. Here is the code, I think you will understand it after reading it. Feel free

OpenGL ES 2.0 Sphere

时光怂恿深爱的人放手 提交于 2019-12-17 16:43:09
问题 What is the easiest way to draw a textured Sphere in OpenGL ES 2.0 with GL_TRIANGLES? I'm especially wondering how to calculate the vertices. 回答1: There are various ways of triangulating spheres. Popular ones, less popular ones, good ones, and not so good ones. Unfortunately the most widely used approach isn't very good. Spherical Coordinates This might be the most widely used approach. You iterate through the two angles in a spherical coordinate system in two nested loops, and generate

Android OpenGL2.0 showing black textures

杀马特。学长 韩版系。学妹 提交于 2019-12-17 16:13:37
问题 I am trying to draw textures onto quads in OpenGL2.0. So far I got the quads to show up and everything, but the textures are not there - the quads are all black. My main suspicion is that i'm not mapping the textures correctly - my textures are not powers of 2, nor are they square - their width is in the field mWidth and their height in mRowHeight. The quads are drawn in a vertical list, which is done with a translate matrix. I'll be very grateful if anyone can go over this cause I'm

OpenGL ES 2.0 and glPushMatrix, glPopMatrix

て烟熏妆下的殇ゞ 提交于 2019-12-17 15:44:38
问题 Does OpenGL ES 2.0 still support glPushMatrix and glPopMatrix? I'm currently using these in the following way: glPushMatrix(); glTranslatef(xLoc, yLoc, 0); [myTexturePointer drawAtPoint:CGPointZero]; glPopMatrix(); I'm asking because I've read a few things about 2.0 "removing the matrix stack from the spec". Since I'm relatively new to OpenGL I'm not sure where to find a definitive answer. 回答1: Nope, OpenGL ES 2.0 uses a programmable pipeline instead of the fixed function pipeline found in

Android. How play video on Surface(OpenGL)

你说的曾经没有我的故事 提交于 2019-12-17 15:44:29
问题 Need to help How play video on Surface(OpenGL) in Android? I tried playing video in mySurfaceView extends SurfaceView with help method setSurface() in MediaPlayer . SurfaceTexture mTexture = new SurfaceTexture(texture_id); Surface mSurface = new Surface(mTexture); MediaPlayer mp = new MediaPlayer(); mp.setSurface(mSurface); I got only playing audio - video not playing. How get video buffer for sending in OpenGL ?? How playing video on GLTexture ? 回答1: From android source code... import java

How to draw basic circle in OpenGL ES 2.0 Android

混江龙づ霸主 提交于 2019-12-17 15:44:13
问题 I'm new in OpenGL ES 2, and I have read many topics about how to draw a circle in OpenGL ES 2 on Android. Based on Drawing Shapes and this code found on gamedev.net, I can draw triangles and quares, but I still don't know how to draw a circle. I now have three ways to draw a circle: Generate vertices in a circle and use glDrawArray( GL_LINES, ... ). Depending on how many vertices you generate this will yield a nice and crisp result. Use a pregenerated texture of a circle (with alpha

Non power of two textures in iOS

♀尐吖头ヾ 提交于 2019-12-17 15:36:58
问题 In my iOS app (targeted for iPad), I'd like to use non power of two (NPT) textures. My GL_VERSION query returns "OpenGL ES 2.0 APPLE". According to the spec, it should support NPT textures, but a simple test shows that I need to resize the texture to 2^N before it shows up. Does Apple not support the full ES 2.0 spec? Where can I find documentation on what is not supported? I am using Xcode 4.3.2 and iOS 5.1. Edit: A closer look at the ES 2.0.25 spec (section 3.8.2), reveals that there are a

Crop camera preview for TextureView

允我心安 提交于 2019-12-17 15:36:00
问题 I have a TextureView with a fixed width and height and I want to show a camera preview inside of it. I need to crop the camera preview so that it doesn't look stretched inside my TextureView. How to do the cropping? If I need to use OpenGL, how to tie the Surface Texture to OpenGL and how to do the cropping with OpenGL? public class MyActivity extends Activity implements TextureView.SurfaceTextureListener { private Camera mCamera; private TextureView mTextureView; @Override protected void