comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Drawing 3D Objects properly
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Drawing 3D Objects properly [message #32054 is a reply to message #31975] Thu, 05 September 2002 14:07 Go to previous messageGo to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
Try reducing the ZCLIP range..

If I made ZCLIP=[999,-999] / 100, the problem went away.

Here's why:

The hardware Z buffer has limited precision. Many Z buffers have only 16
bits per pixel and it varies with the implementation. This may explain why
the problem appears worse on some systems as compared to others. In
addition, if you are on a machine that supports OpenGL, you may see some
differences between the hardware and software renderers, because the Z
buffer depths may be different between the OpenGL on your machine and the
IDL software renderer (Mesa).

When you draw a unit polygon like this that takes up about 2 units in a Z
buffer range of [-999, 999], you are only using 1/1000th of the Z buffer.
So, if the Z buffer is 16-bit, you are only going to be using 64 of the
possible 64K Z buffer values. This results in essentially 64 discreet
"depth" values used while drawing these two polygons. If the polygons get
close enough in Z as you spin them around, the Z values of some of the
pixels after the view projection will map to the same Z buffer value. When
there is a tie in Z, the drawing order becomes the deciding factor.

The graphics system (OpenGL) maps the Z part of the viewport to the Z buffer
differently, depending on the PROJECTION, which may account for the
difference there. When the projection is perspective, the ZCLIP-to-Zbuffer
mapping is not linear. This means that you might be able to resolve the
polygons at one end of the ZCLIP space and not the other. This explains why
you were not able to resolve the polygons in the perspective projection.

If you were to make the ZCLIP values really big, you'd start to see
stitching effects in both projections.

In general, you don't want to set your ZCLIP values to such large numbers.
It is better to get them closer to the actual extents of your model.

This problem did not show up in XOBJVIEW because XOBJVIEW walks the graphics
tree you provide to determine the Z extents of your data.

Try setting ZCLIP to [10,-10].

Hope this helps,
Karl
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL5.6?
Next Topic: Antialiasing under IDL 5.5

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 03:33:01 PDT 2025

Total time taken to generate the page: 0.32509 seconds