> From: "Kraemer, Max, CTR" <[EMAIL PROTECTED]>
> Subject: [JAVA3D] Clipping Plane problem?
>
> I'm working on a 3D display of the Earth. I'm trying to draw everything to
> scale, so the Earth should have a diameter of about 12 million meters. I
> set my clipping planes in my view object. My front clipping plane is set
> to 0.1 meters, my back clipping plane is set to 100 times the diameter of
> the Earth, and both my front and back clipping policies are set to
> View.PHYSICAL_SCREEN. I initially move my view about five times the
> diameter of the Earth.
>
> When I try to rotate my view about the Earth, however, the 3D display
> flickers and cuts off parts of the Earth in wierd places. I don't have this
> problem when I cut my scale down so the Earth is 1 meter in diameter. Does
> anyone have any idea what's going on? Is there anything else I need to set?
> Is there anything I'm doing wrong?
This is a classic problem with the depth buffer algorithm when using a
perspective view. If the ratio of the back clip plane distance over the front
clip plane distance is greater than 1000, then you may loose depth buffer
resolution towards the back of your scene.
The greater the ratio, the worse the problem is. You have a ratio of
1.2e+07m/1e-1m = 1.2e+8, which will lead the extreme front portion of your scene
taking up almost all of the depth buffer resolution (I'd guess that the front
0.1% of your scene is mapping to 99.999% of your depth buffer, leaving the other
99.9% only 0.001% of your depth buffer). This is a consequence of the math used
for the perspective view and is not specific to Java3D.
When you make the earth 1 meter is diameter, the back clip distance is 100m, and
the ratio is 100m/0.1m = 1000, which is why the display looks OK.
You can use higher ratios if your hardware has more depth resolution (24 or 32
bits instead of 16).
Doug Gehringer
Sun Microsystems
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".