opengl-es

Example from Chapter 1 of iphone 3D programming book not drawing to screen.

£可爱£侵袭症+ 提交于 2019-12-11 05:22:11
问题 I'm learning OpenGL-ES with 3D programming for the iPhone (O'Reilly). Its first tutorial involves drawing the background of the screen grey. I've entered in all the code to the letter and it runs without error, but I get no color...just black. Since it runs fine, there is no bug message. There are a few very small source files and rather then post all the code here I've zipped up the project and made it available for download here. I don't know if it is too much to ask for people to look at,

Qt: All Canvas3D rendering is broken when GL ES 3.0 is requested

时间秒杀一切 提交于 2019-12-11 05:15:06
问题 I've distilled this to a completely trivial testcase. In main() I request a GL ES 3.0 context. In the Canvas3D code I first I setup all low-level stuff like shaders, vertex buffers and matrices. Then I draw a white triangle. The results is a window that alternates between all black and white (flickers) at a high frequency. I.e. completely buggy. Changing the 3.0 version I request to 2.0 fixes it, and, in my real app, and lets all other GL functionality work fine. Note that QML items other

How to detect which 3d object has been touched?

筅森魡賤 提交于 2019-12-11 05:07:53
问题 Assume I have 3 cubes in random location/rotation that are visible in the viewport. I want to be able to detect if which of the cube has been touched if I touch ( or click on emulator) a specific cube. If I just touch empty space instead of a cube, this should also be properly detected. I know there is onTouchEvent callback that you over-ride on a View but this only gives me x,y coordinate of where the touch occurred. I am looking for OpenGL-ES based solution and more specifically for Java

What's causing the dark borders around letters using OpenGL?

余生长醉 提交于 2019-12-11 05:06:30
问题 Following on from this question. When I draw the letters I'm getting a dark border around some areas. Below is an example zoomed 4x. The letter on the left is drawn with OpenGL. The letter on the right is my bitmap font atlas in Photoshop colour adjusted to match what is being drawn by my game. As you can see, the 's' on the left has noticeable dark borders in some areas. I've played with various blending options but can't work out what's causing it. If someone could tell me what the cause is

Getting GL_OUT_OF_MEMORY error at random after drawing

ⅰ亾dé卋堺 提交于 2019-12-11 05:05:01
问题 I am drawing a ton of billboards to the screen, and 'randomly' i get a glerror 1285 either after the drawing, or right before starting the next draw cycle, i can't tell. The whole data is 1.3M~ that i upload to the videocard as vertex and index buffers. There are 20 vertex buffers, 19 of them tells me the position and size of the billboard at 19 different times, and the 20th tells me the vertex index (so i can calculate texture coords in the vertex shader). Every second i change which two

How to draw outline of a point in OpenGL?

独自空忆成欢 提交于 2019-12-11 04:47:57
问题 By now points can be drawn with the following code: // SETUP FOR VERTICES GLfloat points[graph->vertexCount * 6]; for (int i = 0 ; i < graph->vertexCount; i++) { points[i*6] = (graph->vertices[i].x / (backingWidth/2) ) - 1; points[i*6+1] = -(graph->vertices[i].y / (backingHeight/2) ) + 1; points[i*6+2] = 1.0; points[i*6+3] = 0.0; points[i*6+4] = 0.0; points[i*6+5] = 1.0; } glEnable(GL_POINT_SMOOTH); glPointSize(DOT_SIZE*scale); glVertexPointer(2, GL_FLOAT, 24, points); glColorPointer(4, GL

On Android 2.3, how can I ensure not to compromise the definition of its texture while enlarging a 3D object?

谁说胖子不能爱 提交于 2019-12-11 04:41:56
问题 Now I'm developing an Android-based 3D app with opengl-es 2.0, I made use of an OBJ file which consists of a 3D model and a texture image (like below): Currently, the apple can rotate freely on my Samsung Galaxy II with no problem. Next, I want to enlarge the apple while keeping the definition of its texture, but I didn't make it (see below). I need help to achieve that. Any suggestion or pointing would be highly appreciated. Thanks in advance. 来源: https://stackoverflow.com/questions/13006227

Create an OpenGL ES 2.0 context on a “standard” Linux system

纵饮孤独 提交于 2019-12-11 04:40:38
问题 I'm writing a game engine using opengl 3.3/SDL/glew/Linux (Ubuntu 11.04). I want to keep the possibility to deploy on mobile (OpenGL ES 2). This means that I have to stay somewhat OpenGL ES 2.0 compatible. Therefore my question is: Is it possible to create an OpenGL ES 2.0 context using SDL/(existing patch on SDL). 回答1: You don't need a GL ES 2.0 context on PC, you can use OpenGL 4.1, which has the GL_ARB_es2_compatibility , which adds the OpenGL ES functions that weren't in OpenGL, making

Ray-Triangle intersection picking not working

会有一股神秘感。 提交于 2019-12-11 04:37:10
问题 I've been working on this for the past several days and have been stuck. I need to be able to touch the screen and return the x,y,z coordinates of the point on my model closest to the near plane that intersects the ray generated at the pick point. I think part of my problem is I'm doing a bunch of matrix transformations and rotations throughout the render code for my model, although the geometry I'm interested in is all rendered at a specific transformation state. My code that I'm using is

android: disable opengl ES context switch upon device rotation

淺唱寂寞╮ 提交于 2019-12-11 04:12:53
问题 i have an android fullscreen opengl es app. when the device is rotate from portrait to landscape and back the gl context is destroyed and recreated. is there a way to avoid this? i.e. always stay in portrait or landscape? edit: i already have this code in my activity: @Override protected void onResume() { super.onResume(); mGLSurfaceView.onResume(); } @Override protected void onPause() { super.onPause(); mGLSurfaceView.onPause(); } 回答1: Unfortunately until API Level 11 (3.0) GLSurfaceView