http://www.infocuswebdesigning.com/
On Mon, Aug 16, 2010 at 9:19 AM, Rassall Jubair <[email protected]>wrote: > Last copule of days, I am trying to load a texture image(.bmp) inside > my Augmented Reality (AndAR) application's coding.but every time white > texture come to screen on marker.here is my coding for texture: > > package edu.dhbw.andar.pub; > public class CustomObject extends ARObject { > > > public CustomObject(String name, String patternName, > double markerWidth, double[] markerCenter) { > super(name, patternName, markerWidth, markerCenter); > > } > > ...... > ..... > > int[] textureIDs = new int[5]; > private Resources res; > > > gl.glVertexPointer(3, GL10.GL_FLOAT, 0, verticesBuffer); > gl.glNormalPointer(GL10.GL_FLOAT, 0, normalsBuffer); > gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, > textureCoordsBuffer); > gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 6); > > } > > public final void draw(GL10 gl) { > super.draw(gl); > ..... > ..... > gl.glEnable(GL10.GL_TEXTURE_2D); > > //Enable vertex buffer > gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); > > gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); > > > //Bind our only previously generated texture in this case > gl.glBindTexture(GL10.GL_TEXTURE_2D, textureIDs[0]); > > > gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices1.length > / 3); > } > > @Override > public void init(GL10 gl) { > > > > gl.glEnable(GL10.GL_TEXTURE_2D); > > gl.glGenTextures(1, textureIDs, 0); > //load the textures into the graphics memory > > > Bitmap bm = BitmapFactory.decodeResource(res, R.drawable.image); > gl.glBindTexture(GL10.GL_TEXTURE_2D, textureIDs[0]); > GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bm,0); > gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, > GL10.GL_LINEAR); > gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, > GL10.GL_LINEAR); > > bm.recycle(); > > > } > } > > here the object is four square and image will be bind in the four > sqaure object. the coding can compile and install in phone. the four > square draw but with white texture.I also add image.bmp in drawble > folder. but still same result. > > please help me to sort out this problem... > > Thanks > Rasasll > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

