opengl-es

OpenGL ES has different UV coordinates?

五迷三道 提交于 2019-12-18 09:08:23
问题 I use OpenGL ES 1.1 with texture mapping. I always thought that UV coordinate system for textures starts from the top-left and goes to bottom-right. This is fine on android, I have tested it. However, if I test it with Qt on the desktop, my UV coordinate system starts from the bottom-left and goes to top-right. Is that OK? I am using the same code to setup OpenGL glViewport(0, 0, m_screenWidth, m_screenHeight); glMatrixMode(GL_PROJECTION); glLoadIdentity(); #ifdef DESKTOP_QT glOrtho(0, 1, 0,

Is there a way to incorporate vector graphics into LibGDX development?

别等时光非礼了梦想. 提交于 2019-12-18 05:54:13
问题 I haven't found anything in LibGDX that would work with vector graphics. This post suggests that AGG is close as it gets, they also mentioned that it is a lot of pain. Is there a painless alternative ? 回答1: There does not seem to be any painless support for vector graphics in Libgdx at this point (mid-2013). First, for vector graphics generally that means SVG in practice. Part of the problem with a "generic" SVG solution is that getting it to work with all the various corner cases seems to be

Background transparency in libgdx

房东的猫 提交于 2019-12-18 05:18:10
问题 How can I make background of screen transparent if I use libgdx in Android? The code I tried to use doesn't work. Gdx.gl.glClearColor( 0, 0, 0, 0 ); Gdx.gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT ); 回答1: Just found a solution! Just add this code to the class that extends AndroidApplication. AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); cfg.r = cfg.g = cfg.b = cfg.a = 8; cfg.useGL20 = false; View view = initializeForView(new LineDrawing(),

Use rotateM() of Matrix to rotate matrix from SurfaceTexture but corrupt the video output

邮差的信 提交于 2019-12-18 05:08:08
问题 I managed to play video with opengl es, I used the way of grafika's ContinuousCaptureActivity, my data source is MediaPlayer rather than Camera which makes no difference. MediaPlayer produces video frames continuously and I draw each frame to screen in onFrameAvailable callback. The code is as follows which works well: mVideoTexture.updateTexImage(); mVideoTexture.getTransformMatrix(mTmpMatrix); mDisplaySurface.makeCurrent(); int viewWidth = getWidth(); int viewHeight = getHeight(); GLES20

OpenGL clipping

假装没事ソ 提交于 2019-12-18 05:06:48
问题 I have been reading articles about clipping now for hours now but I dont seem to find a solution for my problem. This is my scenario: Within an OpenGL ES environment (IOS,Android) I am having a 2D scene graph consisting of drawable objects, forming a tree. Each tree node has its own spatial room with it's own transformation matrix, and each node inherits its coordinate space to its children. Each node has a rectangular bounding box, but these bounding boxes are not axis aligned. This setup

Core Animation or OpenGL ES?

无人久伴 提交于 2019-12-18 05:04:29
问题 I want to do the following: Tap the screen and draw 3 cricles around the the tapped point. Is it better to do this with Core Animation or OpenGL ES? Where do I start? 回答1: As mentioned, the Core Graphics framework is probably what you want. A good way to go about it would be to subclass UIView, then override the two methods drawRect: and touchesEnded:withEvent: . When a touch event ends on the UIView, you can get the point of the last touch from the event passed to touchesEnded:withEvent: ,

Can I mix OpenglES with standard Cocoa widgets on an iPhone app?

故事扮演 提交于 2019-12-18 04:21:42
问题 In case this is possible, it would be nice to see some examples! Thanks, rui 回答1: This question asks something very similar, and as I state there it's trivial to have OpenGL ES content coexist with UIKit controls. The OpenGL ES content lives within a CAEAGLLayer that backs a UIView, which is part of the normal view hierarchy. You can easily overlay other UIViews on top of it. For an example of this, you can look at the source code to my Molecules application, where I place two UIButtons on

Calculate near/far plane vertices using THREE.Frustum

妖精的绣舞 提交于 2019-12-18 04:12:52
问题 I need some help to deal with THREE.Frustum object. My problem: I need to calculate near/far plane vertices; I've taken a look at these tutorials http://www.lighthouse3d.com/tutorials/view-frustum-culling/view-frustums-shape/ http://www.lighthouse3d.com/tutorials/view-frustum-culling/geometric-approach-extracting-the-planes/ and I've sketched this function implementing exactly (I hope so) the procedure explained (just to get top-left/right vertices, assuming the camera can only look left and

WebGL shaders: maximum number of varying variables

狂风中的少年 提交于 2019-12-18 04:12:38
问题 From the OpenGL ES spec section 2.10.4 (Shader Variables: Varying Variables): The number of interpolators available for processing varying variables is given by the implementation-dependent constant MAX_VARYING_VECTORS . This value represents the number of four-element floating-point vectors that can be interpolated; varying variables declared as matrices or arrays will consume multiple interpolators. When a program is linked, any varying variable written by a vertex shader, or read by a

how to create Duval Triangle in canvas

老子叫甜甜 提交于 2019-12-18 03:45:46
问题 I need to create a triangle which called a duval triangle. It looks like this: I need to do it with canvas. so far I succeed to create a triangle. But I don't know how to color it up and how to divide the area inside the triangle into a different colors like in the picture. Can I do such thing in canvas, is it possible to create duval triangle in canvas. Any help is blessed :). The code so far: var triangle = document.getElementById("triangle"); var ctx = triangle.getContext("2d"); var cw =