opengl-es

How to setup/calculate texturebuffer in glTexCoordPointer when importing from OBJ-file

£可爱£侵袭症+ 提交于 2019-12-30 06:57:22
问题 I'm parsing an OBJ-file in Android and my goal is to render & display the object. Everything works fine except the correct texture mapping (importing the resource/image into opengl etc works fine). I don't know how to populate the texture related data from the obj-file into an texturebuffer-object. In the OBJ-file I've vt-lines: vt 0.495011 0.389417 vt 0.500686 0.561346 and face-lines: f 127/73/62 98/72/62 125/75/62 My draw-routine looks like (only relevant parts): gl.glEnableClientState(GL10

Getting sprites to face the camera properly in OpenGLES

ぃ、小莉子 提交于 2019-12-30 06:42:26
问题 I have a game that is more or less 2D, but rendered in 3D. The camera hovers above the 2D game field tilted about 20 degrees from perfectly perpendicular to give a little 3D perspective to it. I have some sprites that need to be rendered perfectly square, because they represent spherical objects. My first approach rendered quads flat on the 2D field which positioned them properly, but the sprite was subject to perspective distortion and it didn't always look round. My current approach is that

Floating Point Textures in OpenGL ES 2.0

我的未来我决定 提交于 2019-12-30 06:08:07
问题 I've been trying to figure out how to use float textures in GLES2. The API Reference (http://www.khronos.org/opengles/sdk/docs/man/glTexImage2D.xml) says that only unsigned bytes and shorts can be used, but i've seen people saying it is supported elsewhere. I could use GL_LUMINANCE as the texture format but that only gets me one float value. If anyone has some insight i'd appreciate it. 回答1: In OpenGL ES 2.0, floating-point textures are only supported if the implementation exports the OES

Floating Point Textures in OpenGL ES 2.0

旧街凉风 提交于 2019-12-30 06:06:03
问题 I've been trying to figure out how to use float textures in GLES2. The API Reference (http://www.khronos.org/opengles/sdk/docs/man/glTexImage2D.xml) says that only unsigned bytes and shorts can be used, but i've seen people saying it is supported elsewhere. I could use GL_LUMINANCE as the texture format but that only gets me one float value. If anyone has some insight i'd appreciate it. 回答1: In OpenGL ES 2.0, floating-point textures are only supported if the implementation exports the OES

What is the fastest way to draw single pixels directly to the screen in an iPhone application?

╄→尐↘猪︶ㄣ 提交于 2019-12-30 04:58:09
问题 I am looking the fastest way to draw thousands of individually calculated pixels directly to the screen in an iPhone application that preforms extremely well. 回答1: Most probably using OpenGL, something like: glBegin(GL_POINTS); glColor3f(...); glVertex3f(...); ... glEnd(); Even faster would probably be to use vertex arrays for specifying the points. 回答2: Why don't you use OpenGL views? 回答3: In all graphics frameworks I've ever used, the way you'd do this is to write your pixels into a block

Current state and solutions for OpenGL over Windows Remote

谁说胖子不能爱 提交于 2019-12-30 04:49:05
问题 OpenGL and Windows Remote don't play along nicely. Solutions for this are dependent on the use case and answers are fragmented across the vast depths of the net. This is a write-up I wish existed when I started researching this, both for coders and non-coders. Problem: A RDP session of Windows does not expose the graphics card, at least not directly. For instance you cannot change the desktop resolution and GraphicsCard drivers usually just disable their setting menus. Starting a OpenGL

Mixing Android Views and GLSurfaceView

倾然丶 夕夏残阳落幕 提交于 2019-12-30 04:34:07
问题 I'm currently working on a game and I would hate to get halfway through and find that the what I'm doing causes errors/kills performance. This is how I'm thinking of setting it up. First want to have a LinearLayout with a LinearLayout containing a HUD, and then a GLSurfaceView. However I may at certain points "pause" the game view and switch to a different linear layout containing an inventory or equips, etc. I think this way would be best because I can make use of all the great components

iOS 6 app crashes in EAGLContext when displaying maps

强颜欢笑 提交于 2019-12-30 02:30:14
问题 We have an app that uses OpenGL and MKMapView . When we switched to iOS 6 it started crashing at [EAGLContext setCurrentContext:] with EXC_BAD_ACCESS whenever we tried to display a map after setting our own EAGLContext . 回答1: iOS 6 maps are OpenGL based. Your app will crash if you don't call [EAGLContext setCurrentContext:nil] after you have set your own EAGLContext. We fixed our bug by putting the above call into the dealloc method of our class that was interacting with EAGLContext. 来源:

How to move a OpenGL square with the finger?

本秂侑毒 提交于 2019-12-30 02:27:12
问题 Actually I have an application for Android 1.5 with a GLSurfaceView class that shows a simple square polygon on the screen. I want to learn how to add a new functionality, the functionality of moving the square touching it with the finger. I mean that when the user touches the square and moves the finger, the square should stick to the finger, until the finger releases the screen. Any tutorials/code examples/help will be apreciated. My code: public class MySurfaceView extends GLSurfaceView

How do I determine what is touched in 3D space from the screen?

落花浮王杯 提交于 2019-12-30 02:26:27
问题 How do I use gl.gluUnproject in my OpenGL ES 1.1 android app to determine what is selected when the user touches the screen? My understanding is that the touch event results in a line and I have to find the first "thing" it intersects with. Are there any tutorials on how to do this? 回答1: If you are doing 2D to 3D picking, you need to fiddle with matrices and vectors a bit. GlUnproject does not exist for OpenGL ES 1.1 so you have to do some math by yourself. Ray-object intersection is a way to