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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:42:16+00:00 2026-05-31T04:42:16+00:00

Here I created one simple OpenGLES iPad sample. //—————————————- glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustumf(-1, 1, -1,

  • 0

Here I created one simple OpenGLES iPad sample.

//----------------------------------------
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

glFrustumf(-1, 1, -1, 1, 0, 20);
glMatrixMode(GL_MODELVIEW);

 static const GLfloat squareVertices[] = {
    -0.5f,  -0.33f,1.6,
     0.5f,  -0.33f,1.6,
    -0.5f,   0.33f,1.6,
     0.5f,   0.33f,1.6
 };

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
. . .  . . . .
. . .  . . . .
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

//----------------------------------------

I used gluLookAt in mac sample, but it is not found in iPad. What is the basic mistake in above code? why square is not visible?

if I change z value in vertex array then works fine.

  static const GLfloat squareVertices[] = {
    -0.5f,  -0.33f,0.5,
     0.5f,  -0.33f,0.5,
    -0.5f,   0.33f,0.5,
     0.5f,   0.33f,0.5
  };

I thought z value range should be 0-20, here 1.6, its in range. I don’t like to change vertex value now. Help me to set glFrustumf.

  • 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-31T04:42:17+00:00Added an answer on May 31, 2026 at 4:42 am

    The near and far values passed to glFrustum are not absolute coordinates in object space. They are the distances from the camera to the near and far planes. That means that you can’t say that a z coordinate of 1.6 is necessarily in your frustum unless you know where the camera position is and what direction it is pointing in.

    For example if your camera is at (0,0,-19) pointed at the origin and you pass 0 and 20 to glFrustum for near and far then in object space the near plane is at -19 (-19+0) and the far plane is at 1 (-19+20). In such a case the square with z=1.6 would be past the far plane but the one with z=0.5 would be inside the frustum. Similarly if your camera was at (0,0,1) with the same values for glFrustum then in object space the near plane would be at 1 and the far would be at -19 so 0.5 would be in and 1.6 would be out.

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

Sidebar

Related Questions

I created a simple WCF application which expose one operation. This operation takes a
I've created two simple testpages. One loads the other one using XMLHttpRequest. (just a
I've created a simple android game, based on the Lunar Lander sample, and I'm
I created a simple WCF web service that has one method: SubmitTicket(flightticket ft, string
i want create one simple windows form ,it just contain Editcontrol(textbox),Static Edit(label),Button (Name of
I've created a very simple one-button MFC dialog app that attempts to utilize a
I created a simple bubblesorting script here that takes in arrays and sorts them,
I have a map with only one annotation.I created a simple class which I
I want to create a view in a one-to-many relation. Here are my relations:
Has anyone here created a Flash site or application that is ADA (Section 508)

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.