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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:45:26+00:00 2026-06-02T07:45:26+00:00

I want to try to create a Hemi-Sphere. Here my Code void drawHalfSphere(int scaley,

  • 0

I want to try to create a Hemi-Sphere.

Here my Code

void drawHalfSphere(int scaley, int scalex, GLfloat r) {
int i, j;
GLfloat v[scalex*scaley][3];

for (i=0; i<scalex; ++i) {
 for (j=0; j<scaley; ++j) {
    v[i*scaley+j][0]=r*cos(j*2*M_PI/scaley)*cos(i*M_PI/(2*scalex));
    v[i*scaley+j][1]=r*sin(i*M_PI/(2*scalex));
    v[i*scaley+j][2]=r*sin(j*2*M_PI/scaley)*cos(i*M_PI/(2*scalex));
 }
}

glBegin(GL_QUADS);
for (i=0; i<scalex-1; ++i) {
  for (j=0; j<scaley; ++j) {
    glVertex3fv(v[i*scaley+j]);
    glVertex3fv(v[i*scaley+(j+1)%scaley]);
    glVertex3fv(v[(i+1)*scaley+(j+1)%scaley]);
    glVertex3fv(v[(i+1)*scaley+j]);
  }
}
glEnd();
}


void RenderScene() 
{
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity (); 

  glRotatef(fRotation,1,0,0);
  glColor3f(1,0,0);
  drawHalfSphere(25.0,25.0,0.5);
  glutSwapBuffers();
}

When i’m rotating the Hemi Sphere there is a Point, where the parts of the sphere disappear.
It’s like a Wall, behind i rotate the Sphere.

  • 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-02T07:45:27+00:00Added an answer on June 2, 2026 at 7:45 am

    Did you try, during initialization:

    glCullFace(GL_FRONT_AND_BACK);
    

    Or is your far plane too close:

     void gluPerspective(...,GLdouble zFar);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my code to automatically try multiple ways to create a database connection.
I want to try create something like Zend's Server Pagecache. What I want to
I want try to create this screen, but text fields on the right side
I want to try to create an image using NSdata. If imageWithData: method of
I try to create a JAVA EE application. In the business layer I want
I want to try to create an iPhone app using PHP and I do
So I try to create my own window system (because I want to have
I create a pipe using mkfifo /tmp/foo.pipe Now, I want to try reading from
I want to try create an effect where by when I trigger an event
I want to try to create a learning chess application as a school project.

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.