opengl-es

3D CAD to OpenGL

本秂侑毒 提交于 2021-02-10 13:34:56
问题 I was wondering if anyone knew of a program that can take a 3D drawing of an object and then convert it into the required OpenGL points and normals. Basically I have an AutoCAD drawing of that I want to be able to display in a program I am creating for iPhone. Any suggestions? 回答1: If you have AutoCAD itself, you could export the object into a mesh format, like STL. Reading STL files is straightforward. If you don't have AutoCAD you may also try FreeCAD, which is based on OpenCascade, which

Is there any way to accelerate iPad simulator's OpenGL performance?

折月煮酒 提交于 2021-02-08 12:43:02
问题 iPad simulator is too slow to test OpenGL graphics. Is there any way to make it faster? 回答1: In my experience, the iPad Simulator has almost always been faster than running on an actual device. On my early 2010 i7 MacBook Pro, the Simulator has been significantly faster than the iPhone 4 and iPad 1 with almost every OpenGL ES application I've developed. The Simulator does appear to do software-based simulation of certain iOS hardware features, particularly in the area of shaders. If you have

Is there any way to accelerate iPad simulator's OpenGL performance?

流过昼夜 提交于 2021-02-08 12:42:12
问题 iPad simulator is too slow to test OpenGL graphics. Is there any way to make it faster? 回答1: In my experience, the iPad Simulator has almost always been faster than running on an actual device. On my early 2010 i7 MacBook Pro, the Simulator has been significantly faster than the iPhone 4 and iPad 1 with almost every OpenGL ES application I've developed. The Simulator does appear to do software-based simulation of certain iOS hardware features, particularly in the area of shaders. If you have

Converting pixel co-ordinates to normalized co-ordinates at draw time in OpenGL 3.0

不想你离开。 提交于 2021-02-08 10:33:38
问题 I am drawing a triangle in OpenGL like: MyGLRenderer( ) { fSampleVertices = ByteBuffer.allocateDirect( fSampleVerticesData.length * 4 ) .order ( ByteOrder.nativeOrder( ) ).asFloatBuffer( ); fSampleVertices.put( fSampleVerticesData ).position ( 0 ); Log.d( TAG, "MyGLRender( )" ); } private FloatBuffer fSampleVertices; private final float[] fSampleVerticesData = { .8f, .8f, 0.0f, -.8f, .8f, 0.0f, -.8f, -.8f, 0.0f }; public void onDrawFrame( GL10 unused ) { GLES30.glViewport ( 0, 0, mWidth,

Using OpenGL shaders for math calculation (C++)

只愿长相守 提交于 2021-02-08 06:35:35
问题 I have a matrix (for example 100x100 dimantion): I need to do calculation with each element ( matrix[i,j]*tt/8+5 for example) I have huge matrix and I want to implement the algorithm using OpenGL shaders. I want to use shader like: uniform float val; uniform float tt; void main() { gl_Position.x = val*tt/8+5 } How I can implement the program? How I can get matrix after calculation(I do not want to show any windows\pictures? 回答1: It is possible if you create a fake window frame buffer. See my

detecting arc and circle shapes in vector array with a range

谁说胖子不能爱 提交于 2021-02-07 19:22:10
问题 I have an array of 2d vertices and I want to detect if there are any arch or circle shapes in a array. Sometimes the values are not that precise and I need a small range. Here are the values. The 3rd verticle value value remains 0: verticle: -0.014848, -13.2684, 0 angle : 0.141274 verticle: -0.0174556, -4.84519, 0 angle : 90 verticle: 0, 0, 0 angle : 90 verticle: -9.53674e-07, 14.14, 0 angle : 40.7168 verticle: -12.1101, 14.0709, 0 angle : 7.94458 verticle: -12.0996, 10.6442, 0 angle : 0

How to avoid transparency overlap using OpenGL?

。_饼干妹妹 提交于 2021-02-07 13:42:10
问题 I am working on a handwriting application on iOS. I found the sample project "GLPaint" from iOS documentation which is implemented by OpenGL ES, and I did something modification on it. I track the touch points and calculate the curves between the points and draw particle images alone the curve to make it looks like where the finger passby. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,

How to avoid transparency overlap using OpenGL?

旧城冷巷雨未停 提交于 2021-02-07 13:41:20
问题 I am working on a handwriting application on iOS. I found the sample project "GLPaint" from iOS documentation which is implemented by OpenGL ES, and I did something modification on it. I track the touch points and calculate the curves between the points and draw particle images alone the curve to make it looks like where the finger passby. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,

Using opengl es shader to convert YUV to RGB

半世苍凉 提交于 2021-02-06 11:04:29
问题 I want to convert yuv to rgb in opengl es shader with just one sampler which contains yuv data. My code is below: 1) I send yuv data to texture: GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_LUMINANCE, mData.w, mData.h * 3 / 2, 0, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE, ByteBuffer.wrap(mData.yuv)); 2) My vertex shader: attribute vec4 position; attribute vec2 inputTextureCoordinate; attribute mediump float width; varying vec2 v_texCoord; varying mediump vec2 v_vuTexCoord;

Using OpenGL from the main thread on Android

混江龙づ霸主 提交于 2021-02-05 20:31:14
问题 I would like to call a GLES20 method when an item from the options menu is selected. public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.clear: GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); break; // ... } } This does not work since I am in the main thread and not in GLThread . It says: call to OpenGL ES API with no current context (logged once per thread) But what do I have to do to get things working? 回答1: I found the answer on my own: public boolean