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 7705721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:55:57+00:00 2026-05-31T23:55:57+00:00

I’ve written a simple model viewer for android that parses a .obj wavefront file

  • 0

I’ve written a simple model viewer for android that parses a .obj wavefront file to create a 3d model. I’m exporting a simple icosphere that has been textured with a uv map from blender that comes in this format

v 0.000000 -1.000000 0.000000
v 0.723600 -0.447215 0.525720
v -0.276385 -0.447215 0.850640
.
.
.
v -0.723600 0.447215 -0.525720
v 0.276385 0.447215 -0.850640
v 0.894425 0.447215 0.000000
vt 0.238062 0.172144
vt 0.314133 0.212645
vt 0.264721 0.263452
.
.
.
vt 0.176955 0.098382
vt 0.327646 0.115775
vt 0.361262 0.040083
f 103/1 15/2 48/3
f 48/3 44/4 103/1
f 13/5 103/1 44/4
.
.
.
f 47/12 105/8 46/10
f 14/9 46/10 105/8
f 105/8 47/12 15/2

“v” represents the vertices, “vt” represents the texture coordinates and “f” represents the faces with the values before the forward slash being the indices corresponding to the vertices and the values after the slash are the indices corresponding to the texture coordinates. My problem is that I’m not sure how to input the texture coordinate indices into opengl es so my current model looks very strange since the texture coordinates do not match up.

enter image description here

  • 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-31T23:55:59+00:00Added an answer on May 31, 2026 at 11:55 pm

    OBJ defines the origin within a texture to be at the top left. OpenGL defines it to be in the bottom left. You need to invert the y coordinates coming in from the OBJ.

    EDIT: in response to what I’m interpreting as scepticism on Christian Rau’s part below, for OpenGL purposes and limiting the properties to just those you actually use, a vertex is the combination of a position and a texture coordinate. It’s the two things together. You might think they’re logically distinct but OpenGL doesn’t. You might respond to the question “which OBJ vertex is at entry 23 in the list passed to OpenGL?” with an answer like “it’s the vertex 46/10”.

    One way to implement that when loading is via any of the Dictionary subclasses (eg, Hashtable). When encountering a need to use the vertex 46/10 you’d create a suitable composite key and check the Hashtable for a mapping to the OpenGL array index position. If you failed to find one, you’d allocate the next available index position and store a record in your dictionary.

    So the following, from your question:

    f 103/1 15/2 48/3
    f 48/3 44/4 103/1
    f 13/5 103/1 44/4
    .
    .
    .
    f 47/12 105/8 46/10
    f 14/9 46/10 105/8
    f 105/8 47/12 15/2
    

    Gives rise to ten vertices, those being the vertices 103/1, 13/5, 48/3, 44/4, 15/2, 47/12, 105/8, 46/10, 14/9 and 46/10.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

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.