Hi, Desiree.
Thank you very much.

My application is very similar than yours.
Our scene has several layers too, but the diference is that the viewer can
inmerse in it,
so the ratio of 3000 isn't good. (We didn�t see all the scene, only a piece
of it)

I have realized than:

        To  have a good vision of furthest  objects in my scene, front
clipping plane must be far from the viewer (Example : Front=100m Back =
3000m for distances of 6000m)

        To have a good vision of nearest objects in my scene, front clipping
plane must be near the viewer (Example: Front=1m, Back=1500m for distances
of 30 m)


Thank you very much for the suggest of changing dinamically the clipping
planes. I'm getting information about the ZBuffer  resolution, and when I
would have all the
information I'll send it to the list.

Regards.

Alvaro.






-----Mensaje original-----
De: Desiree Hilbring <[EMAIL PROTECTED]>
Para: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Fecha: viernes 25 de mayo de 2001 12:12
Asunto: Re: [JAVA3D] Test program (fwd) for Grafic card question


>Hi Alvaro,
>
>I don't know, if this does help you, but my application is setting the
>clipping distances like the following:
>
>My 3D-Scene consists of several layers (like in CAD or GIS-Systems)
>Each layer has a bounding box. Out of this bounding box I am
>calculating an approximate middle point for my current scene.
>Then I am calculating the distance, which is necessary to go back
>along the z-Axis to see the entire scene. With this distance I am
>moving the viewing platform. My actual 3D-Objects are live somewhere near
>(0,0,0). I am calculating this distance in the following method:
>
>    /**
>     * Calculates the values for InitialPosition from the WorldBox
>     * and range
>     * of baseheight
>     */
>    public void setInitialPosition(WorldBox wb) {
>        this.wb=wb;
>        // middle of WorldBox
>        this.xm=(wb.getLrx()+wb.getUlx())/2;
>        this.ym=(wb.getUly()+wb.getLry())/2;
>        // default of field of view is PI/4 in Java3D
>        // disBaseHeight is depending from viewing frustum
>        if (wb instanceof WorldVolume) {
>            WorldVolume wv = (WorldVolume) wb;
>            baseHeightdiff = wv.uz - wv.lz;
>        }
>        else baseHeightdiff = 0;
>
>        float distBaseHeight;
>        if (gis3dView == null) {
>            distBaseHeight =
>                (float) (baseHeightdiff/Math.atan(Math.PI/8.d));
>        }
>        else {
>            distBaseHeight =
>                (float)
(baseHeightdiff*gis3dView.getHeightScale()/Math.atan(Math.PI/8.d));
>        }
>
>        // distXYRange is depending from viewing frustum
>        float distXYRange =
>                (float)((wb.getLrx()-wb.getUlx())/Math.atan(Math.PI/8.d));
>
>        // get the greater of both, to see entire scene
>        if (distBaseHeight > distXYRange)
>            this.dist = distBaseHeight;
>        else {
>            this.dist = distXYRange;
>        }
>    }
>
>
>I am calculating my font and back clipping distances out of dist:
>
>double back=intposcurrent.getDist()+intposcurrent.getDist()/8.0d;
>double front = (intposcurrent.getDist()-intposcurrent.getDist()/2.0)/7.0;
>
>------------- back clipping plane
>
>   ------
>   |  . |      (0,0,0)                  -
>   |    |                               |
>   ------                                       |
>------------- front clippping plane     |
>                                        |
>                                        |
>                                         calculated distance
>                                        |
>                                        |
>                                        |
>                                        |
>                                        |
>                                        |
>      .      viewing platform           -
>
>
>
>
>In my case it happens to be that the ratio between the distances is a lot
>smaller than 3000. But I am thinking of adding a check for the ratio.
>Additionally it would be possible to calculate the smallest and greatest z
>out of the bounding box, instead of just adding a part of the calculated
>distance (the values above are just try and error values which are fitting
>my needs).
>
>Another problem I had, was zooming into the scene without the objects
>being clipped. So I am adjusting the front and back clipping planes, while
>zooming on the fly. For this I extended MouseZoome and overloaded the
>method transformChanged():
>
>    /**
>     * Adjust clipping planes
>     *
>     * @see Method getFrontClipDistance() in class GIS3dView
>     */
>    public void transformChanged(Transform3D transform) {
>        Vector3d v3d = new Vector3d();
>        transform.get(v3d);
>        double dist = v3d.z;
>        double newfront = (v3d.z-v3d.z/2.0)/7.0;
>        if (newfront < 0) {
>            newfront = -newfront;
>        }
>        double newback = newfront * 500;
>        view.setFrontClipDistance(newfront);
>        view.setBackClipDistance(newback);
>    }
>
>Here I am setting the back plane with a ratio of 500 after the front
>plane.
>
>Desiree
>
>oooooooooooooooooooooooooooooooooooooooooooooooo
>Desiree Hilbring
>
>Institut fuer Photogrammetrie und Fernerkundung
>Universitaet Karlsruhe, Germany
>email: [EMAIL PROTECTED]
># 0721 6083676
>oooooooooooooooooooooooooooooooooooooooooooooooo
>
>
>On Wed, 23 May 2001, alvaro zabala wrote:
>
>> Desiree, only a question.
>> How do you get the nearest point to your ViewingPlatform?
>>
>> I'm in a terrain (QuadArray), of 10 x 10 Km., and I want to view the
>> furthest side (at 10000 m from the init)
>>
>> I tried these lines (suggest of Renoir)
>>
>> double radius = 100.0;
>> vista.setFrontClipDistance(radius*(2.0/5000.0));
>>  vista.setBackClipDistance(radius*2.0);
>>
>> and the result is in the atachment-
>>
>>
>>
>> -----Mensaje original-----
>> De: Desiree Hilbring <[EMAIL PROTECTED]>
>> Para: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>> Fecha: mi�rcoles 23 de mayo de 2001 18:02
>> Asunto: Re: [JAVA3D] Test program (fwd) for Grafic card question
>>
>>
>> >>
>> >> If that doesn't work in your main application then we can try keeping
the
>> >forward/back clip ratio
>> >> to a constant.  I see from your later mail you have used this
solution.
>> >Are you keeping the
>> >> ratio to 3000 or a smaller number?
>> >
>> >I was using this all the time in my main application and was playing
>> >around with a ratio between 500 and 3000. Desiree
>> >
>> >>
>> >> cheers,
>> >>
>> >> Chris
>> >>
>> >>
>> >> --
>> >>                   ,--_|\
>> >>                  /  Oz  \
>> >> Chris Thorne    :)_.--._/
>> >> [EMAIL PROTECTED]     v
>> >>
>> >>
>> >
>>
>===========================================================================
>> >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".
>>
>
>===========================================================================
>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".

===========================================================================
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".

Reply via email to