opengl-es

Interactive 3d Web Technology

≯℡__Kan透↙ 提交于 2019-12-24 07:47:08
问题 I would like to use interactive 3D models in a web page. The required functionality is: Import dxf file which defines & displays a room. Add/move prebuilt objects from javascript Add/move lamp which cast shadows from javascript Return room dimensions to javascript Return object positions to javascript Can I import dxf files into any WebGL engine? I have a small repeat user base so a browser installation is no problem at all. Is there any plugin technology I could use? Java applets? Unity? Can

getting model view matrix in Android?

↘锁芯ラ 提交于 2019-12-24 07:06:18
问题 how to get current model view matrix in Android?i am using OpenGL 1.1,the method GL.getFloatv() is giving zero values.please help. float[] model_matrix = new float[16]; GL11.getFloatv(GL11.GL_MODELVIEW_MATRIX,model_matrix); 回答1: Just a guess, since you don't show any code: you should be using GL11.GL_MODELVIEW_MATRIX, and not GL_MODELVIEW for requesting the matrix values. 回答2: Not sure if this is still pending or which version you used, but as of now, the GLES11.glGetFloatv has 2 overloads

Opposite of glscissor in Cocos2D?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 06:49:59
问题 I found a class called ClippingNode that I can use on sprites to only display a specified rectangular area: https://github.com/njt1982/ClippingNode One problem is that I need to do exactly the opposite, meaning I want the inverse of that. I want everything outside of the specified rectangle to be displayed, and everything inside to be taken out. In my test I'm using a position of a sprite, which will update frame, so that will need to happen to meaning that new clipping rect will be defined.

Cannot set custom class to GLKView inside UIView

一曲冷凌霜 提交于 2019-12-24 06:44:27
问题 I am learning OpenGL ES for iOS and following Ray Wenderlich's tutorial online. The first thing he does is set the view in a view controller to a different color using OpenGL ES 2.0. So I created the custom class called OpenGLView which is responsible for changing the color of the screen. Then in the main story board I deleted the original view in the view controller and replaced it with a GLKView and set its class to OpenGLView. When I run the project everything works fine. But now I was

“stack corruption detected” when using glGetProgramiv

狂风中的少年 提交于 2019-12-24 06:43:04
问题 I am writing native Android OpenGLES 2 code. When loading shaders (shader loading code is very similar to the NDK sample "hello-gl2"), my program does not link (shaders themselves compile without errors). This code: GLint linkStatus = GL_FALSE; GLCALL(glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus)); if (linkStatus != GL_TRUE) { Returns false, so I proceed to calling LOGE("Could not link program, gathering log..."); GLint bufLength = 0; GLCALL(glGetProgramiv(programId, GL_INFO_LOG

Pass array to shader

六月ゝ 毕业季﹏ 提交于 2019-12-24 06:31:04
问题 I create my array this.kernel: it hast 48 elements and I want to pass it to my fragment shader. When i call gl.uniform3fv(gl.getUniformLocation(this.program, "kernel"), 16, this.kernel); kernel is defined in my shader: uniform vec3 kernel[16]; I get an error for not enough arguments. I already looked up the specification etc, but don't find my problem -.- void glUniform3fv( GLint location, GLsizei count, const GLfloat * value); Thanks for help €: I converted this.kernel to a float32array but

GLSL texture2D() always returns (0, 0, 0, 1)

别等时光非礼了梦想. 提交于 2019-12-24 06:29:27
问题 I'm super-baffled by this. I'm trying to render to an off-screen texture so I can perform some post-processing, but can't even get that texture to draw to the screen unmodified. I'm currently targeting OpenGL ES 2.0 on the iPhone simulator. I've narrowed down the problem to GLSL's texture2D() function returning vec4(0, 0, 0, 1) since, if I replace that call with any a constant color, the screen fills with the specified color. The texture is created, bound to texture unit 0, its storage is

GLSL texture2D() always returns (0, 0, 0, 1)

时光怂恿深爱的人放手 提交于 2019-12-24 06:29:14
问题 I'm super-baffled by this. I'm trying to render to an off-screen texture so I can perform some post-processing, but can't even get that texture to draw to the screen unmodified. I'm currently targeting OpenGL ES 2.0 on the iPhone simulator. I've narrowed down the problem to GLSL's texture2D() function returning vec4(0, 0, 0, 1) since, if I replace that call with any a constant color, the screen fills with the specified color. The texture is created, bound to texture unit 0, its storage is

What is the best way to draw a large number of lines using openGL and cocos2D?

怎甘沉沦 提交于 2019-12-24 05:32:57
问题 I have a series of 2d vertices that represent the lines used to draw a grid. There are about 900 line segments to draw (the grid uses spring physics to distort, which is why I don't just draw a single line for each row and col). cocos2D has a ccDrawLine function built in, which draws fine, but I think this may be inefficient since it is calling glDrawArrays for each line segment. How do you efficiently draw a large number of line segments? As a bonus, please recommend a source of good 2D

How to read pixels from a rendered texture in OpenGL ES

旧巷老猫 提交于 2019-12-24 04:53:11
问题 I'm trying to read pixels from a texture which was generated on the fly (RTT, Render To Texture). I'm taking this snapshot by implementing Apple's suggested method listed here. This works fine for the "default" colorbuffer which gets presented to the screen but I can't get this to work for the pixels that were written to the texture. I'm having trouble with these lines: // Bind the color renderbuffer used to render the OpenGL ES view // If your application only creates a single color