Android :: Apply Different Textures On Different Faces Of Cylinder
Apr 12, 2010
how to apply apply different textures on different faces of a cylinder?I am able to apply one texture which covers the whole cylinder.But I want one texture for each face.
View 7 Replies
Jun 25, 2010
I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports. I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube.But the way I did it was to create 6 faces seperately, have 6 seperate index and texture buffers and then using glBindTexture() with the selected texture for each face and then calling glDrawElements. Isn't there an efficient way around this. Should i use a cube map texture instead of a GL_TEXTURE_2D?
View 1 Replies
View Related
Oct 1, 2010
I am newbie to OpenGL programming. I was going through the code of API demos.I understood how to map a single image resource on to all the 6 faces of the cube,but i want to know how can i map 6 faces of the cube with 6 different images. I searched in the web without any luck.Can any one give me some ideas links , pointers on the same.
View 5 Replies
View Related
May 18, 2010
Working through some OpenGL-ES tutorials, using the Android emulator. I've gotten up to texture mapping and am having some trouble mapping to a cube. Is it possible to map a texture to all faces of a cube that has 8 vertices and 12 triangles for the 6 faces as described below?
// Use half as we are going for a 0,0,0 centre.
width /= 2;
height /= 2;
depth /= 2;
float vertices[] = { -width, -height, depth, // 0
width, -height, depth, // 1
width, height, depth, // 2......................
View 1 Replies
View Related
Apr 15, 2010
Is it possible to add any more emoticons/smiley faces to the text app? Stock or otherwise? And if so, where do you find them at?
View 5 Replies
View Related
Feb 15, 2009
I am using opengl for drawing 3d stuff, but so far I've been unable to use transparent textures...
This is what I do...
CODE:..............
View 2 Replies
View Related
Feb 17, 2010
I'm learning OpenGL on my own atm and I have a question about texturing a surface:
I can create a simple polygon like this:
CODE:......
Then I load all of that info into the approriate buffers and draw it to the screen with a call to:
CODE:..
My question:
I'm looking for a good example of how to take an image and texture it to the surface.
View 4 Replies
View Related
Jun 21, 2010
I can't seem to get GLUtils.texImage2D to use my full RGBA (A=my alpha component).
I've tried doing setEGLConfigChooser(8, 8, 8, 8, 0, 0); getHolder().setFormat(PixelFormat.RGBA_8888);
I've tried converting the source image (.png in ARGB) to RGBA.. which works ok for the ordering of data before texImage2D, but when it draws, it draws yellow where it should be "transparent white"... which suggests it's diminishing the "B"(blue) component instead of the A(alpha) component. But the same thing happens when I just use the orignal ARGB data instead ("B" diminishes instead of "A", leaving yellow).
View 5 Replies
View Related
Sep 27, 2010
I created a little texture drawing class from observing the LabelMaker example in the Android SDK. One thing I can't find however is how to rotate textures drawn with glDrawTexiOES. is it possible? I've just tried glRotatef but it has no effect.
View 1 Replies
View Related
Aug 18, 2010
I'm just learning OpenGL ES on Android, and I am trying to get some kind of anisotropic filtering on textures. I want to increase the size of a sprite, with some kind of interpolation, instead of this "nearest-pixel-interpolation".
Is there anything like this in the OpenGL ES standard or do I have to make one texture for each size?
View 2 Replies
View Related
Nov 1, 2010
In Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.
I followed this code to create the textures: http://blog.poweredbytoast.com/loading-opengl-textures-in-android but it seems that this is only for one texture.
If I use only one texture, it renders fine, but then I don't know how to tell the rect to use another texture (same rect, different texture). Do I do something like "setTexture" with the ID that is generated in loadTextures()? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..
View 2 Replies
View Related
Feb 19, 2010
I need to enlarge(Zoom) Textures when I hold&drag at the corners.
I am using glOrtho() to setup ModelView.
CODE:.............
I am able to do hit-test and detect corners of the images(Textures) on the screen.
Now I need to enlarge(zoom) the image(texture). I have offset values, means how far I moved on the screen in X,Y directions.
If I need to use glScalef(), it will accept values in percentage(I think). How can I map the offset values to this percentage value.
or is there any other way to zoom(ie by enlarging the background polygon vertices, so that the mapped texture will automatically get zoomed) ? In this method, I am fixing the polygon sides at time of Surface Creation.
View 1 Replies
View Related
Mar 23, 2010
Good pattern for loading textures in an Android Java & OpenGL ES app.
My first concern is determining how many texture names to allocate and how I can efficiently go about doing this prior to rendering my vertices.
My second concern is in loading the textures, I have to infer the texture to be loaded based on my game data. This means I'll be playing around with strings, which I understand is something I really shouldn't be doing in my GL thread.
Overall I understand what's happening when loading textures, I just want to get the best lifecycle out of it. Are there any other things I should be considering?
View 1 Replies
View Related
May 19, 2010
I'm developing a game for android using OpenGL es and have hit a problem:
My game loads fine in the emulator (windows xp and vista from eclipse), it also loads fine on a T-Mobile G2 (HTC Hero) however when I load it on my new HTC Desire none of the textures appear to load correctly (or at all). I'm suspecting the BitmapFactory.decode method although I have no evidence that that is the problem.
All of my textures are power of 2 and JPG textures seem to load (although they don't look great quality) but anything that is GIF or PNG just doesn't load at all except for a 2x2 red square which loads fine and one texture that maps to a 3d object but seems to fill each triangle of the mesh with the nearest colour).
This is my code for loading images:
CODE:...........................
View 1 Replies
View Related
Jul 2, 2009
I have a texture-mapped cube based in part on the Kube API demo and the Textured Cube example from anddev.org, It is working fine using bitmaps loaded from R.drawable.. what I need to do now is to make the texture for each face dynamic (using Bitmaps created in code). I'm having trouble understanding how to change the textures on the fly and I'm hoping someone can point me in the right direction.What would I need to change in this code to allow an existing texture to be replaced (eg. a new Bitmap would be passed in instead of loading the resource, but when I try this the texture remains unchanged).
View 5 Replies
View Related
Jun 19, 2010
How do I track the memory used by OpenGL textures in Android? I understand the texture memory is on the Video RAM, but do they get swapped in with the RAM? If I call glGenTextures and do not call glDeleteTextures, how does it impact the memory usage of my current process?
View 1 Replies
View Related
Jan 30, 2010
So I'm doing some simple 2D stuff with OpenGL on Android and found the performance to be very, very poor. To give you an example, I made an app with a full screen LSurfaceView. I loaded a 512x1024 texture (containing a 480x854 image), set up an orthogonal 2D matrix, and set it to draw a 480x854 pixel quad with that texture, using vertex and texture arrays. Lighting, dither, blending, etc. is disabled.
I would expect this to run at 60fps without problem, but that simple operation already drags the frame drawing time to 19ms/frame. If I add some more small textured quads around the screen, the drawing time goes up to 22/24ms. If I enable blending it balloons to 28/30ms. This is testing on a Motorola Milestone, running 2.0.1. Is this normal? Am I doing something wrong or is it just a common problem in Android?
View 24 Replies
View Related
Nov 19, 2010
Basically I have a fully functional ogl program (2D game) in opengl es 1.1, everything works fine except for one problem: glcolor
I'm trying to set some of my texture to half transparent and I would like to do it as follows;
gl.glColor4f(1f, 1f, 1f, .5f);
obj.draw(gl);
...
gl.glColor4f(1f, 1f, 1f, 1f);
I'm using VBO for my vertice, my textures and indices. (if that is relevant)
the problem is that nothing gets set to 50% transparency...
I'm don't think relevant to post all my code (mainly because it is spread out several classes with several GL options changing (blends, scissors etc etc).
What I would like is for people to tell me what state of OGL could prevent glcolor form working like I want, what functions should I check, what state should I call.
View 1 Replies
View Related
Dec 28, 2009
I ran into a rather strange problem with my OpenGL game. While most textures look good, five or six are not drawn on Droid, and I don't see anything special about these images/models. For example, my HUD is made of 4 elements. The upper part is drawn correctly, while the lower part appears as white rectangles. The code used for loading and drawing these models and textures is exactly the same. Textures are 32-bit TGAs in both cases, POT dimensions, in - nodpi, inScaled==false, using GLSurfaceView to rule out configuration issues. No problems on G1 and Hero (and of course on emulator). And I don't have the Droid, so I can't just try whatever comes to my mind. Asked users to send me logs - no errors, all models and images appear to load normally.
View 2 Replies
View Related
Dec 5, 2009
I'm using GLSurfaceView for one of my applications and I've encountered a problem. It seems I can only create textures when in onSurfaceChanged, after that glGenTextures only returns 0. I've tried without glGenTextures and keeping track of texture indices myself, but the textures generated just turn up white. Is it only possible to load these types of resources in onSurfaceChanged (and possible onSurfaceCreated)? Or am I missing something?
View 2 Replies
View Related
Nov 1, 2010
In Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.
I followed this code to create the textures: link text
and they render fine, but then I don't know how to tell the given rect to use another texture. Do I do something like "setTexture" with the ID that is generated in loadTextures() ? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..
View 1 Replies
View Related
Feb 26, 2010
I'm using GLSurfaceView to render OpengGL 3D. It works great on my nexus one, the emulators, and at least the G1. However, on the droid, the textures are white. I've seen this problem before when textures aren't loaded, and also when they aren't powers of two dimensions (not the case here). What's weird is that this started when I converted my program to use GLSurfaceView (it used to be based on some older example where I was doing the EGL stuff myself).
Textures displayed on the screen are white, but shapes that are just colors are displayed just fine.
The person testing this for me on their droid does not have the sdk, so if anyone would like to run this with the debugger, let me know and I can get you the apk.
View 7 Replies
View Related
Jun 25, 2010
I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports.I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube.But the way I did it was to create 6 faces seperately, have 6 seperate index and texture buffers and then using glBindTexture() with the selected texture for each face and then calling glDrawElements. Isn't there an efficient way around this. Should i use a cube map texture instead of a GL_TEXTURE_2D?
View 4 Replies
View Related
Sep 18, 2010
Question before I dive deeper into converting my current rendering system to openGL. I heard that textures needed to be in base2 sizes in order to be stored for rendering. Is this true?
My application is very tight on memory, but most of the bitmaps are not a perfect square. Does storing non-base 2 textures waste extra memory?
View 3 Replies
View Related
Jun 30, 2010
I have troubles with OpenGL textures on Motorola Milestone with 2.1 firmware. Each call to glGenTextures fails with error GL_INVALID_OPERATION and sets the id with random numbers. The exact same application works on G1 without any error.
View 1 Replies
View Related
Sep 10, 2010
I'm creating an opengl es application and I would like to be able to dynamically create the text of my buttons etc.
The 2 obvious reasons for that are:
-to be modular (changing the text quickly without using photoshop)
-to be able to add languages later down the line
give me the basic steps/functions to:
create textures form text load custom fonts to display text textures with the chosen custom font indicate if I can use this for loading Kanji ?
View 2 Replies
View Related
Sep 3, 2010
I am drawing some textures with alpha channel, but when they are displayed it looks like the alpha channel is only binary. So a pixel is either transparent or opaque, although in the texture file itself the pixel is half-transparent.
The blending is set up like this:
code:............
The above shows how it should be like, and the below shows how it is:
View 4 Replies
View Related
Jun 25, 2009
I want to make a game with opengl es, but i don't know how is the best way to make the textures, with a program like 3ds max? or with a plain jpg's?
View 13 Replies
View Related
Nov 24, 2011
how to rotate fragment in android 3.0.I have an activity in which there is listfragment and fragment.on click of the item in list i want to apply rotation for the fragment.I have tried with below given code:
ObjectAnimator.ofFloat(getView(), "rotationY", 0, 360).setDuration(500).start();
This code works well witn listview in listfragment but when i used the same for fragment rotation it throws exception.
View 1 Replies
View Related
Mar 12, 2009
I am developing a simple GUI with three buttons. i want to fill the button with color but i found back ground color. if i set mybutton.setBackgroundcolor (color); it's not visible
How can i fill the button with color..
View 3 Replies
View Related