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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:33:17+00:00 2026-05-27T18:33:17+00:00

I am trying to create a 3D function plotter for iOS. I have succeeded

  • 0

I am trying to create a 3D function plotter for iOS. I have succeeded to render the graph using triangle strips and also implemented drawing a wireframe via lines. But if I render both at the same time using a 24-bit (or 16-bit doesn’t matter) depth buffer the lines get partially obscured by the polygons, making them appear very thin or disappear entirely. Turning off 4xMSAA doesn’t solve the issue. See the image below for an example.

example of partially obscured lines

Drawing just lines works just fine – the lines have just the proper thickness. If I disable depth-buffering for the lines they get drawn correctly as well, but they of course appear above all the polygons (i.e. lines that are indeed hidden by polygons). I have also tried to reduce the polygons’ transparency, to no avail. Slightly increasing the lines’ y-coordinates makes it look better, as long as you are looking at them from above, so that they indeed are in front of the polygons then.

For optimum performance, I statically store all vertex data and indices into vertex arrays prior to rendering. Thus, my rendering loop is quite short:

- (void)drawRect:(CGRect)rect
{
    glClearColor(1, 1, 1, 1);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    [self.effect prepareToDraw];

    for (NSUInteger i = 0; i < _nVertexArrays; i ++)
    {
        glBindVertexArrayOES(_vertexArrays[i].vertexArray);
        glDrawElements(_vertexArrays[i].mode, _vertexArrays[i].indexCount, GL_UNSIGNED_INT, NULL);
    }
}

How can I display polygons and wireframes properly at the same time? I also thought of just moving the lines a bit nearer to wherever the camera happens to be right now, but I don’t know how to do that in OpenGL ES, and I’m not sure if it might impact performance, as this shift is dependent on the current position of the camera. Is it possible to dynamically apply a transformation to the lines just before drawing them?

  • 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-27T18:33:18+00:00Added an answer on May 27, 2026 at 6:33 pm

    Check out glPolygonOffset. It is made specifically for this use.

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

Sidebar

Related Questions

I am using MySQL v5.1.36 and I am trying to create a stored function
I am trying to create a function with options. I believe I have to
I'm trying to create a custom function for a SQLite database I'm using with
I'm trying to create function using phpmyadmin/mysql console. Without any luck. I'm getting info
I'm trying to create a function in C# which will allow me to, when
I'm trying to create a function which takes an array as an argument, adds
I'm trying to create a function that searches up a WebControl's parent-child relationship (basically
I am trying to create a function which will give me alphabet position when
I'm trying to create a function to create a new basewith another struct as
I am trying to create a function that will block access to some of

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.