• Advertisement
Sign in to follow this  

UV mapping

This topic is 633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

 

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 --> http://pastebin.com/sBcyfvGd

 

Now this is the end result of my uv coordinates stored in a float array called "TextureCoordinates" --> http://pastebin.com/vhm0jUrp

 

After that I have my uv coordinates stored in "TextureCoordinates" I am just doing the following --> http://pastebin.com/GHvUZRNn

 

And this is the result http://imgur.com/a/Dtw6F

 

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

 

Regards!

Edited by Skyzyx

Share this post


Link to post
Share on other sites
Advertisement

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
Sign in to follow this  

  • Advertisement