Sign in to follow this  

UV mapping

Recommended Posts



I am trying to map a picture to some coordinates but the result is messed up. I am using OpenGL ES 2.0 and Java in Android Studio.


This is the cube file that I am loading the data from -->


Now this is the end result of my uv coordinates stored in a float array called "TextureCoordinates" -->


After that I have my uv coordinates stored in "TextureCoordinates" I am just doing the following -->


And this is the result


Any help is appreciated. Incase you need more information you just have to ask and I will do my best to provide it.



Edited by Skyzyx

Share this post

Link to post
Share on other sites

If I were you, rather than pour over long, unintelligible lists of indices, I'd do the following process in order to get the cube rendering properly:

1.) Get one face working correctly.

2.) Get two faces working correctly.

3.) Get three faces working correctly.

etc...  :)

Share this post

Link to post
Share on other sites

A few things may be wrong. Your UV coordinates may not match with the correct vertex, or your index ordering is off. Use a profiler like PIX or nsight and you can debug where your problem is at. OR a simple cube does not have a lot of buffer information to scan through. Go through the position and UV coordinate on paper and you can figure it out.


EDIT: Sorry PIX is direct3d only, but nsight can debug OGL

Edited by ExErvus

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this