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

  • Home
  • SEARCH
  • 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 7981739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:28:03+00:00 2026-06-04T10:28:03+00:00

I am teaching myself opengl es. I recently figured out how to parse/load a

  • 0

I am teaching myself opengl es. I recently figured out how to parse/load a mesh from .OBJ file. I am now trying to apply a texture to it, I know I can only use one set of indices.. other than that I am lost as to the concept and code required to draw a texture onto my cube.
A detailed/semi-detailed explanation of what’s required, code, and description of what is happening would be soooo much appreciated. I haven’t found much for opengl es on this subject and the explanations are a bit vague for me. Please remember I am using opengl es. Thanks in advance. BTW if it helps this is the .OBJ file

enter code here
# Blender v2.62 (sub 0) OBJ File: ''

http://www.blender.org

mtllib untitled.mtl
o Cube_Cube.002
v 1.067472 -0.769912 -1.117719
v 1.067472 -0.769912 0.882281
v -0.932528 -0.769912 0.882281
v -0.932527 -0.769912 -1.117719
v 1.067473 1.230088 -1.117718
v 1.067472 1.230088 0.882282
v -0.932528 1.230088 0.882281
v -0.932528 1.230088 -1.117719
vt 0.951958 0.112804
vt 0.951958 -0.887196
vt -0.048042 -0.887196
vt -0.048042 0.112804
vt 0.058859 0.112804
vt 0.058859 1.112804
vt 1.058859 1.112804
vt 1.058859 0.112804
vt 0.951958 1.112804
vt -0.941141 0.112804
vt -0.941141 -0.887196
vt 0.951958 0.058859
vt -0.048042 0.058859
vt 0.951958 -0.941141
vt 1.951958 -0.941141
vt -0.048042 -0.941141
usemtl Material.001
s off
f 5/1 1/2 4/3
f 5/1 4/3 8/4
f 3/5 7/6 8/7
f 3/5 8/7 4/8
f 2/1 6/9 3/4
f 6/1 7/4 3/3
f 1/5 5/6 2/10
f 5/5 6/10 2/11
f 5/12 8/13 6/14
f 8/12 7/14 6/15
f 1/12 2/14 3/16
f 1/12 3/16 4/13

P.S. I understand how to read/parse/understand these aspects of the file. I just need clarification on how I am supposed to use one indexbuffer for the texture and vertices while making only one call to drawelements. Thanks again!

  • 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-06-04T10:28:05+00:00Added an answer on June 4, 2026 at 10:28 am

    I don’t know if blender can do it, but some tools exists to export .obj with a single set of indices. This will look like this:

    f 6/6/6 1/1/1 4/4/4 
    f 4/4/4 1/1/1 3/3/3 
    f 1/1/1 2/2/2 3/3/3 
    f 12/12/12 2/2/2 1/1/1 
    f 11/11/11 12/12/12 1/1/1 
    f 11/11/11 81/81/81 12/12/12 
    

    For instance, UDK does this when you export a scene (made of StaticMesh) to .obj format. Using a tool that exports .obj in such way is the easiest solution for you. You can however rebuild the arrays yourself from what you read from the .obj in your code, but it’s a boring and unnecessary time consuming operation.

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

Sidebar

Related Questions

I'm just starting out teaching myself openGL and now adding openAL to the mix.
I've been teaching myself cpp sporadically from 'accelerated C++' and recently I noticed that
Teaching myself the flow of data from mySQL -> PHP -> JSON / Javascript
I'm teaching myself Objective-C from a book ( Cocoa programming for mac OS X
I was recently teaching myself Python and discovered the LBYL/EAFP idioms with regards to
I've been teaching myself python recently an came across and example where str.endswith took
I've recently started teaching myself the Play! Framework. (I like it a lot.) I
I'm teaching myself XSLT and am still trying to wrap my brain around the
I'm teaching myself WPF and xaml by replicating existing controls and UI from AutoCAD
I'm new to OpenGL and I'm teaching myself by making a 2D game for

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.