Results 1 to 8 of 8

Thread: The Mystery of the Disappearing Mesh

  1. #1
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    San Diego, CA, USA
    Posts
    209

    The Mystery of the Disappearing Mesh

    I have a little program that I intend to work into a game, at current it has a handful of meshes that appear in random locations, and one that I can move around. I can move the camera around this one mesh in a manner alot like the camera in Homeworld. I can pan this camera around the mesh, and look at all sides of it, but something odd happens when the mesh is farther than about 380 units from the origin. When I pan the camera more than about 90 degrees from the Z axis, the mesh disappears. I tried turning off all of my culling code, so that all meshes were sent to the renderer, regardless of their position. Still happened. This seemed like an easy thing to fix, all I had to do was to recenter my coordinate system around the mesh in focus, now it cannot go outside the 380 units, right? Well, no. It still happens.

    So, to recap, I have a mesh that disappears when it is over 380ish units from the "Universal origin". When I render, I am using a coordinate system centered around my point of camera focus. All matricies are WRT the Universal Coordinates, but when I load these matricies, I translate the coordinate system to the position of the object in focus. My cullers aren't the cause, I commented those out. What could it be?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    King George, Virginia
    Posts
    132

    Re: The Mystery of the Disappearing Mesh

    far clipping plane?

    jebus

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    San Diego, CA, USA
    Posts
    209

    Re: The Mystery of the Disappearing Mesh

    no, thats not it, it doesnt matter how far away the mesh is from the camera. If you imagine the mesh "looking" down the Z axis. When the mesh and the camera are looking at each other, the mesh is visible. When I pan around the mesh, it remains visible until the camera is looking orthoganal to the Z axis, at that point in time, the mesh disappears. I have done some playing around, and come to find that this only happens when I have about a thousand or so meshes in my "world". I just had a crazy idea, mebbe I'll try setting the "look at" vector somewhere outside the face in question... That may work.


    [This message has been edited by 147-2 (edited 11-06-2002).]

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: The Mystery of the Disappearing Mesh

    You mention that you took out YOUR cullers, how about glDisable(GL_CULL_FACE)?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    San Diego, CA, USA
    Posts
    209

    Re: The Mystery of the Disappearing Mesh

    [QUOTE]Originally posted by 147-2:
    [B]no, thats not it, it doesnt matter how far away the mesh is from the camera. If you imagine the mesh "looking" down the Z axis. When the mesh and the camera are looking at each other, the mesh is visible. When I pan around the mesh, it remains visible until the camera is looking orthoganal to the Z axis, at that point in time, the mesh disappears. I have done some playing around, and come to find that this only happens when I have about a thousand or so meshes in my "world". I just had a crazy idea, mebbe I'll try setting the "look at" vector somewhere outside the face in question... That may work.

    Oh, yeah, and I also disabled the gl cullers. Didnt work

  6. #6
    Member Newbie
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    48

    Re: The Mystery of the Disappearing Mesh

    Do you have any clipping planes?
    Maybe your GL implementation buggy?
    Maybe a depth testing issue (the more |z_far - z_near| is, the more unprecise the depth buffer is). Try setting more bits for the depth buffer, if you're not using GLUT.
    Maybe your implementation misuses the arctan and generates a division by zero (by the OpenGL specification, implementations must not crash or terminate, even if a fatal error occurs). If the implementation tries to get an angle by it's sine and cosine using arctan and the cosine is zero, it will divide by it and so the result is undefined. Maybe that's the reason. Try updating your drivers/implementation, that could fix the problem.

    [This message has been edited by mm_freak (edited 11-06-2002).]
    Knowledge is Power

  7. #7
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    San Diego, CA, USA
    Posts
    209

    Re: The Mystery of the Disappearing Mesh

    Well, I found that it has to do with how many objects (or faces) are within a certain area. The meshes that I have been using are 3180ish faces apiece, and with 1700 of them floating around, that's a lot of faces. But when I expanded things to the level that my game actually will be, the problem disappeared... Probably because Im not rendering nearly as many models.

  8. #8
    Member Newbie
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    48

    Re: The Mystery of the Disappearing Mesh

    You should be able to render as many primitives as you want with OpenGL, since it's not object oriented. It's just drawn to the framebuffer and that's it, like you would draw lines and circles in a good old DOS graphics library.
    Knowledge is Power

Similar Threads

  1. gl_FrontFacing Mystery
    By Steven Walker in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 04-10-2006, 11:12 AM
  2. gluTessCallback mystery
    By AndersS in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-17-2004, 02:43 AM
  3. Rotation Mystery
    By glZigZag in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 09-27-2003, 01:44 AM
  4. problem : gl_lighting mystery
    By HamsterofDeath in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 02-09-2003, 08:44 AM
  5. Undefined symbol mystery
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-09-2002, 10:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean