opengl-es

How to make each component of a 3D OpenGL object touchable in Android? [closed]

社会主义新天地 提交于 2019-12-14 03:36:27
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . let's say I have a 3d car model displayed using GLSurfaceView in Android. This model consists of many components, is that possible to control each of them or make each of them response to touch events individually? for example, if I want to select one wheel, what I need to do is

How to show background bitmap on 2D

自闭症网瘾萝莉.ら 提交于 2019-12-14 03:28:35
问题 The background original bitmap and the real effect like this: This is my first time use Opengl ES 2.0. I don't know why and where my the problem is. Maybe some wrong happens in direction. My code: public class BackgroundGLRnder implements GLSurfaceView.Renderer { // Our matrices private final float[] mtrxProjection = new float[16]; private final float[] mtrxView = new float[16]; private final float[] mtrxProjectionAndView = new float[16]; // Geometric variables private float vertices[];

glMapBuffer is missing from opengl es 2

…衆ロ難τιáo~ 提交于 2019-12-14 02:47:05
问题 Why glMapBuffer is missing from opengl es 2.0? Who we can get access to buffer data to change it efficiently? Only glBufferSubData is the best way to modify the buffer? 回答1: glMapBuffer is an extension in ES 2.0, not part of the core spec. The vast majority of devices (all iOS and most Andriod) offer the extension, but it is not required. The only core way to upload VBO data is with glBufferData , or glBufferSubData . 回答2: You need extension GL_OES_mapbuffer. This provides glMapBufferOES and

How to deal with NaN or inf in OpenGL ES 2.0 shaders

青春壹個敷衍的年華 提交于 2019-12-14 01:31:32
问题 This is based on the question: Best way to detect NaN's in OpenGL shaders Standard GLSL defines isnan() and isinf() functions for detection. OpenGL ES 2.0 shading language doesn't. How can I deal with NaNs and Infs nevertheless? 回答1: You can check for NaN via a condition that will only be true for NaN: bool isNan(float val) { return (val <= 0.0 || 0.0 <= val) ? false : true; } isinf is a bit more difficult. There is no mechanism to convert the float into its integer representation and play

How to use multiple textures on a cube in WebGL?

馋奶兔 提交于 2019-12-13 23:30:39
问题 This is my source code. It still doesnt work. I want to put 6 different pictures on the 6 sides of a cube, which is animated. Please help :) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> <title>WebGL</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="glMatrix-0.9.5.min.js"></script> <script type="text/javascript" src="webgl-utils.js"></script> <script id="shader-fs" type="x-shader/x-fragment">

How to convert a 2D image to 3D in iphone app [closed]

纵饮孤独 提交于 2019-12-13 23:13:43
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Input: 2D image Output: 3D image Platform: IOS I need to convert a 2D image into 3D in my ios application.How to do this in my ios application? What are the frameworks I need to use? Will OpenGL-es helps in this?

OpenGL ES 2 Color buffer not working

丶灬走出姿态 提交于 2019-12-13 21:48:28
问题 I've recently started using OpenGL ES 2 for android. I followed their examples for drawing shapes, and I went further and created a cube. I'm now trying to achieve a nice color effect(each face a different color). I ve defined a colorBuffer which has a color for each vertex, but when I'm drawing the shape the image is black. If I use only one color, instead of the buffer the shape is fine. I tried to adapt my colorBuffer from the positionBuffer, but I'm doing something wrong. Here is my code:

Convert hexidecimal colors to floats

你离开我真会死。 提交于 2019-12-13 21:24:11
问题 This may seem a bit silly, but I can't realize how I have to enter the desired color in glColor4f. I mean, it needs 4 floats between 0.0 ~ 1.0, and all the colors I find are in hexadecimal or in rgb (which are between 0 ~ 255). How do I have to make the conversion to adquire the desired color using glColor4f? I have already tried doing something like this: glColor4f(1/248, 1/50, 1/99); But it doesn't make the trick. I'm using JAVA and OpenGL-ES 回答1: 'C' does integer arithmatic in integers 1

Shader is not running if I bind framebuffer to mipmap texture

大憨熊 提交于 2019-12-13 21:03:30
问题 I am using open gl to generate Gaussian Parimid, I create a 2D texture with mipmap, and bind to array of FBO, FBO[0] -> base level of texture, FBO[1] -> level 1 texture and so on ... Platform: Android OpenGL ES 2.0 When run the code below: gaussV.Use(); glUniform1f(gaussV("mip_level"), 0.0); //some param to shader glUniform1f(gaussV("delta"), 1.0f / h); // some param to shader glBindFramebuffer(GL_FRAMEBUFFER, filterFBO_IDs[m]); draw(gaussV("vPosition")); // draw arrays. gaussV.UnUse(); If m=

Best way to find and remove hidden textures from memory

喜你入骨 提交于 2019-12-13 20:18:10
问题 I need to find a way to track positions where the loaded textures are drawn. When some of the loaded textures are overwritten, i have to delete them from memory. I have a Remote User Interface (RUI) server which sends me a lot of small images, which are assembled and then shown on the RUI client's screen. In this scenario, i have no clue which textures are behind some other textures, so i am unable to delete them. Also, overwriting must be complete (texture behind must be totally hidden). Is