yes that's right, the perspective projection is the point where you can
solve the problem.

"intercepting all resizing of the windows" sounds like a lot of work but in
fact means nothing but overloading a single method and re-calculating the
perspective transformation for the following frames in this method.

The API doc cited sounds like setWindowResizePolicy() should serve exactly
this purpose, but if it doesn't work yet i find this workaround well worth
considering.

i have never done if for perspective projection but here is an example of
how it works for ortho projection (this is for immediate mode, don't know if
this also works in retained mode):

    public static void updateViewParameters(Canvas canvas) {

        double w=canvas.getSize().width;
        double h=canvas.getSize().height;

        Transform3D proj=new Transform3D();
        proj.ortho(0,w,0,h,-200.,200.);

        canvas.getView().setCompatibilityModeEnable(true);
        canvas.getView().setLeftProjection(proj);
        canvas.getView().setRightProjection(proj);

        haveValidView=true;
    }

In order to get this working for perspective projection, instead of ortho
you must call

public void perspective(double fovx,
                        double aspect,
                        double zNear,
                        double zFar)


in class Transform3D, and first calculate "fovX" and "aspect" from the
canvas size. "aspect" should be simply w/h, and "fovX" should be easily
calculated with some trigonometry (something like Math.tan(width/zNear), but
this is only a guess! look up your math books).

just a bit of experimenting... it's a pity that setWindowResizePolicy()
isn't functioning but this way you should get it go. good luck!

-- julian



-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Olivier fillon
Sent: Tuesday, February 22, 2000 5:01 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] ?? View.setWindowResizePolicy(VIRTUAL_WORLD)


Hi Neil,
this won't be of much good news for you but for us, we have not managed to
succeed here.
I display a map of my site view from an eagle view with a PERSPECTIVEmode
view.
A member of my team spent some time 6 month ago trying to solve the problem:
 we would like to see more of the world when the window on the world gets
bigger, not a bigger world
He ultimately succeeded by intercepting all resizing on the window and
calling our own scale method which is NOT what we really want and is so
messy i have removed it from our implementation.

As a possible hint for a clue, if i remember well, it was working well
before with a PARALLEL projection mode.
All this experience based on j3d 1.1.3.
I may try to have a look at our code to see if i can get more clues

Hope it helps

Olivier Fillon    Minestar Project
[EMAIL PROTECTED]  Mincom Limited
Ph.+61-7-3303-3344               61 Wyandra Street
Fax+61-7-3303-3232               Teneriffe Qld. 4005.
Australia
Company home page: http://www.mincom.com/
Personal home page: http://www.powerup.com.au/~fillon
--- A word from our sponsor ---
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this E-mail are the opinion of the
writer only and are not endorsed by Mincom Limited unless expressly stated
otherwise.

--
-----Original Message-----
From: Neil Daniels <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, February 22, 2000 1:47 PM
Subject: [JAVA3D] ?? View.setWindowResizePolicy(VIRTUAL_WORLD)


>I want to set up the view so that a resize of the window does not resize
the
>objects - simple, right?
>
>Per the docs, I use:
>
>         u.getViewer().getView().setWindowResizePolicy(View.VIRTUAL_WORLD);
>
>(where 'u' is a SimpleUniverse)
>
>However, this doesn't seem to actually work - when I enlarge the window the
>objects in it enlarge also.  What else needs to be done?
>
>For demo purposes, I'm attaching a modified version of the HelloUniverse
>which has been posted up here (thanks are due to Scott Decker and Phelim
>Kelly for that piece of code...).  (I also modified that code to show a
grid
>'floor', which makes it easier to show their example of moving the view
>rather than the objects.)  Originally I was going to remove the rotation
and
>substitute some key or mouse behavior to move the viewpoint, but now I'm
>puzzled about the resizing issue.  The additions I made to the "communal"
>code are marked as such....
>
>Any hints or clues? I'm open for suggestions.
>
>Thanks,
>Neil Daniels
>
>Note: docs read: "A value of VIRTUAL_WORLD implies that the original image
>remains the same size on the screen but the user sees more or less of the
>virtual world depending on whether the window grew or shrank in size"
>

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