Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

OpenGL provides strange Output

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 PGmeiner   Members   

122
Like
Likes
Like

Posted 19 June 2001 - 08:13 AM

Hello everywhere, I had some problems with Drawing rectangles in OpenGL. When I define a Perspective Projection-Matrix and set the PolygonMode to GL_LINE and rotate the rectangle around the y-axis then sometimes in some special positions the Lines who create the Rectangles disappears partial. What can be the reason for this strange phenomena. Here is the Projection and Rendering-Code is use for the above described example: Projection-Function: GLfloat fAspect = (GLfloat) w/(GLfloat) h; glViewport( 0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode (GL_PROJECTION); glLoadIdentity (); double angle = calculateAngle(h, 40); gluPerspective(angle, fAspect, 5.0f, 400); glMatrixMode (GL_MODELVIEW); glLoadIdentity (); gluLookAt(2.0, 1.0, 3.0, // eye 0.0, 5.0, -1.0, // center 0.0, 0.0, 1.0);// dir.vector Render-function: glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glClear(GL_COLOR_BUFFER_BIT); glRectd(-5 ,-5, 5, 5); glRotatef(0.3f, 0.0, 1.0, 0.0); I hope somebody can tell me the reason for that. regards peter gmeiner Peter Gmeiner

#2 wikidsmot   Members   

122
Like
Likes
Like

Posted 19 June 2001 - 08:42 AM

a short answer would be to try this instead of your call to gluPerspective:

gluPerspective( angle, fAspect, .01f, 10000 );

#3 SirKnight   Members   

316
Like
Likes
Like

Posted 19 June 2001 - 10:07 AM

Yes, like wikidsmot showed. The problem is that your near clip plane is too far away. If you need that near clip plane to be that far away, then you would need to translate your whole scene farther out down the -z axis.

-SirKnight




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.