Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6319371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:47:45+00:00 2026-05-24T15:47:45+00:00

Hy I have a little problem in openGL-ES texturing. I created a modell in

  • 0

Hy I have a little problem in openGL-ES texturing. I created a modell in 3ds max and used UV map for it, as you can see here(1st. picture) there is my UV map.
Without UV mapping my texture loading is “perfect”, but with UV maps…(2nd picture here), look at the bogie).

I load this modell(bogie) from an obj file, there isn’t any problem with my code or with the obj, because it is working with simple textures, maybe my loadtexture method is bad, pls check it, or do you have any Ideas?
Thanks for your answers, I’m out of ideas.

Loadtexture code:

private int[] textures = new int[3];
    public void loadtexture(GL10 gl, Context mContext, String map_source) {
            try {
                InputStream is = mContext.getAssets().open(map_source);
                Bitmap bitmap = BitmapFactory.decodeStream(is);
                is.close();
                gl.glGenTextures(3, textures, 0);

                gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,
                        GL10.GL_NEAREST);
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,
                        GL10.GL_NEAREST);
                GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);


                gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]);
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,
                        GL10.GL_LINEAR);
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,
                        GL10.GL_LINEAR);
                GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);

                gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[2]);
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,
                        GL10.GL_LINEAR);
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,
                        GL10.GL_LINEAR_MIPMAP_NEAREST);
                if (gl instanceof GL11) {
                    gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_GENERATE_MIPMAP,
                            GL11.GL_TRUE);
                    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
                } else {
                    buildMipmap(gl, bitmap);
                }
                bitmap.recycle();
            } catch (IOException e) {
                // Should never happen
            }
        }

        private void buildMipmap(GL10 gl, Bitmap bitmap) {
            //
            int level = 0;
            //
            int height = bitmap.getHeight();
            int width = bitmap.getWidth();

            //
            while (height >= 1 || width >= 1) {

                GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bitmap, 0);

                //
                if (height == 1 || width == 1) {
                    break;
                }

                // Increase the mipmap level
                level++;

                //
                height /= 2;
                width /= 2;
                Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, width, height,
                        true);

                // Clean up
                bitmap.recycle();
                bitmap = bitmap2;
            }
        }

P.S. Sorry for my english.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:47:46+00:00Added an answer on May 24, 2026 at 3:47 pm
    private int[] textures = new int[3];
        public void loadtexture(GL10 gl, Context mContext, String map_source) {
                try {
    InputStream is = mContext.getAssets().open(map_source);
                Bitmap bitmap2 = BitmapFactory.decodeStream(is);
                is.close();
                Matrix flip = new Matrix();
                flip.postScale(1f, -1f);
                Bitmap bitmap =  Bitmap.createBitmap(bitmap2, 0, 0, bitmap2.getWidth(), bitmap2.getHeight(), flip, true);
                bitmap2.recycle();
    ... (same like before)
    

    So I’ve flipped it vertically because loading maps is little bit diffrent in opengl. I hope that I helped some1 who get in to trouble with the same problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have little problem. I can't use AcceptVerb.Get on some ASP.NET MVC actions because
I have little problem in my iPhone application code but can not identify. please
I have a little problem because on my website I can't really set permissions
I have one little problem...Here is my code..Is there a way to distribute weights
I have a little problem and I'm hopping that you can help me solve
I have little problem with my script. Here is the code. http://pastie.org/2361140 When I
have a little problem here: int IntegerTransformer::transformFrom(std::string string){ stream->clear(); std::cout<<string<<std::endl;; (*stream)<<string; int i; (*stream)>>i;
I have a little problem with a Listview. I can load it with listview
I'm have little problem in retrieving the data from a table here's the code:
I have little problem with a replacement of a little part in an url.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.