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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:13:55+00:00 2026-05-21T19:13:55+00:00

I have a cube on the screen, I want to give the effect of

  • 0

I have a cube on the screen, I want to give the effect of zooming out so I was tweaking the frustum to be larger and larger. Here is the code:

- (void)Draw {

    EAGLView* videoController = [EAGLView Instance];
    [videoController BeginDraw];

    glClearColor(0.1f, 0.7f, 0.1f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glViewport(0, 0, videoController.mBackingWidth, videoController.mBackingHeight);

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    float mAspectRatio = 1.6666;
    static float mHalfViewAngleTan = 0.1;
    mHalfViewAngleTan += 1.1;
    float mNearZClip = 1.0;
    float mFarZClip = 1000.0;
    glFrustumf( mAspectRatio*-mHalfViewAngleTan, mAspectRatio*mHalfViewAngleTan, -mHalfViewAngleTan, mHalfViewAngleTan, mNearZClip, mFarZClip );

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    static float rotZ = 0.0f;
    ++rotZ;
    if(rotZ > 360)
        rotZ = 0;

    glRotatef(rotZ, 0, 0.5, 0.5);

    RenderModel(modelObj);

    [videoController EndDraw];
}

The glRotate is working correctly. However as mHalfViewAngleTan gets larger nothing seems to be happening, the scene changes in no noticeable way. I have tried smaller and larger numbers for the amount mHalfViewAngleTan increase per frame. Changing the Near and Far plane are also working correctly.

There are no glMatrixMode/glPushMatrix calls inside RenderModel. It Enables and Disables client state, sets up glVertPointer’s and call glDrawArray.

All this code is in an .mm file calling into .cpp files.

  • 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-21T19:13:56+00:00Added an answer on May 21, 2026 at 7:13 pm

    I had this problem in the past. I solved it by directly including the Open GL 1.1 or 2.2 headers. Not quite sure why that fixed it.

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

Sidebar

Related Questions

i want to draw a rotating cube in the middle of the screen, and
The Screen-to-world problem on the iPhon e I have a 3D model (CUBE) rendered
I have a cube which I want to rotate. I also have a light
I am using GL Kit to draw a cube which rotates on the screen.
My program was meant to draw a simple textured cube on screen, however, I
I have cube which contains geographic sales data. I want to pull sales of
I have a Cube which I want to rotate using mouse motion. So if
I have a cube which I want to restrict users to only be able
I want to have a reflecting cube surface in a WebGL page with Three.js.
I have a cube that I want to paint with same color on all

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.