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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:53:53+00:00 2026-06-12T10:53:53+00:00

I have a human model in an .OBJ file I want to display as

  • 0

I have a human model in an .OBJ file I want to display as a mesh with triangles. No textures. I want also to be able to move, scale, and rotate in 3D.

The first and working option is to project the vertices to 2D using the maths manually and then draw them with Quartz 2D. This works, for I know the underlying math concepts for perspective projection.

However I would like to use OpenGL ES for that method, but I am not sure how to draw the triangles.

For example, the code in – (void)drawRect:(CGRect)rect is:

glClearColor(1,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
GLKBaseEffect *effect = [[GLKBaseEffect alloc] init];
[effect prepareToDraw];
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);

Now what? I have an array of vertex positions (3 floats per vertex) and an array of triangle indices, so I tried this:

glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, numVertices,pVertices);
glDrawElements(GL_TRIANGLES, numTriangles, GL_UNSIGNED_INT,pTriangles);

but this doesn’t show anything. I saw from a sample the usage of glEnableVertexAttribArray(GLKVertexAttribPosition) and glDrawArrays but I ‘m not sure how to use them.

I also understand that rendering a wireframe is not possible with ES? So I have to apply color attributes to the vertices. That’s ok, but before that the triangles have to be displayed first.

  • 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-12T10:53:55+00:00Added an answer on June 12, 2026 at 10:53 am

    The first thing I’d ask is: where are your vertices? OpenGL (ES) draws in a coordinate space that extends from (-1, -1, -1) to (1, 1, 1), so you probably want to transform your points with a projection matrix to get them into that space. To learn about projection matrices and more of the basics of OpenGL ES 2.0 on iOS, I’d suggest finding a book or a tutorial. This one’s not bad, and here’s another that’s specific to GLKit.

    Drawing with OpenGL in drawRect: is probably not something you want to be doing. If you’re already using GLKit, why not use GLKView? There’s good example code to get you started if you create a new Xcode project with the “OpenGL Game” template.

    Once you get up to speed with GL you’ll find that the function glPolygonMode typically used for wireframe drawing on desktop OpenGL doesn’t exist in OpenGL ES. Depending on how your vertex data is organized, though, you might be able to get a decent wireframe with GL_LINES or GL_LINE_LOOP. Or since you’re using GLKit, you can skip wireframe and set up some lights and shading pretty easily with GLKBaseEffect.

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

Sidebar

Related Questions

If I have a human body 3d model, that I want to animate walking,
I have a Model like this: class MyModel attr_accessor :size end Now i want
I have a model with several date attributes. I'd like to be able to
I have the following model class. class Human(db.Model): email = db.StringProperty(required=True) date = db.DateTimeProperty(auto_now=True)
I have a human face mesh that was created using the mirror editing, so
I am trying to use google appengine. I have this model: def Human(db.Model): name
I have to write a classificator (gaussian mixture model) that I use for human
I have some knowledge about Human computer interaction and some basic knowledge programming scripts
I have written a constuctor function Human() { var legs = 2; var iq
I have for some time tried to anthropomorphise (meaning human readable) the names I

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.