What does scale mean in PARALLEL_PROJECTION with SCALE_EXPLICIT policy?

Does anyone know how the parallel projection view is scaled?
I'm using:
view.setScreenScalePolicy(View.SCALE_EXPLICIT); / /specifies that the scale is taken directly from the user-provided screenScale attribute
First of all, I tried two ways of changing the scale:
1. Scaling in the view
view.setScreenScale(scale); // Sets the screen scale value for this view. This is used when the screen scale policy is SCALE_EXPLICIT. The default value is 1.0 (i.e., unscaled).
2. Scaling in the transform matrix
Transform3d t=new Transform3d();
t.lookAt(new Point3d(eye),new Point3d(center),new Vector3d(up));
t.setScale(scale);
objTrans.setTransform(t); // Sets the scale component of the current transform; any existing scale is first factored out of the existing transform before the new scale is applied.
Note: t.getScale() returns 1.0 by default, until a scale is applied.
Both seem to have the same result, and I'm not sure which is better.
Now what's weird is to figure out what the "default" scale is?
I made a cube model, centered on the origin, resized it until it fix well on the screen without any scale applied. I found a 0.2 length cube accomplished this. Then I measured the pixel size of the window and cube and I found this relation:
Cube_size (in pixels) = window width (in pixels) *0.55; // Measured factor varied only slightly from 0.5414 to 0.5544 depending on window size and aspect ratio.
I found the window height had no effect on the pixel size of the cube.
My 0.2 length cube filled 55% of the width, so a 0.36 length cube fills the full window width. I verified this.
This means if I want to assign the scale by the number of physical units wide I want visible, I need to include a 0.36 correction factor to the scale:
view.setScreenScale(0.36/width);
This works - my 0.2 length cube fills the full width when width=0.2. I verified this works for other sized models too.
Although this works, I really don't like mysteries, and I'm becoming convinced other problems (properly setting the FrontClipDistance and BackClipDistance for a given model and view) are related.
I really HATE that these transforms don't seem to be written out anywhere, in any documentation I can find.
Has anyone else worked with the SCALE_EXPLICIT policy in PARALLEL_PROJECTION view?
Any help is appreciated!
Tom Ruen

I'm trying to scale a 3d representation of the human body so that it always remains the same distance from a virtual camera regardless of resolution. I need it to be the same virtual distance from the virtual camera as a subject would be from a real 35mm camera.
I tried the following code:
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
          Canvas3D canvas = new Canvas3D(config);
          SimpleUniverse universe = new SimpleUniverse(canvas);
          canvas.getView().setScreenScalePolicy(View.SCALE_SCREEN_SIZE);
          System.out.println(canvas.getScreen3D().getPhysicalScreenWidth());
          System.out.println(canvas.getScreen3D().getPhysicalScreenHeight());
          canvas.getScreen3D().setPhysicalScreenWidth(0.005);
          canvas.getScreen3D().setPhysicalScreenHeight(0.005*0.8);And it does seem to "zoom out" ever so slightly (using 0.005). However, it appears that the boundingsphere is such that the objects begin to be not drawn as one "shrinks the scene", thus effectively zooming out. Scaling the scene up is fine, but i need to scale it down - ie shrink it.
The reason I am attempting to use this method rather than applying a transform on the viewingPlatform is because I purposefully did not want to have to adjust the bounding sphere.
Can you give me any help on why scaling up works really well with most values >actual screen size, but scaling down is very iffy, and only shrinks the scene with values MUCH less than the actual screen value. Even then, i start to get holes where polygons arent drawn anymore.
Thanks

Similar Messages

Maybe you are looking for

  • Premiere CS6 not opening in OS X 10.9.1 Mavericks.

    Hey guys. I'm so tired at this point...I spent almost two working days trying to make AE and Premiere work after updating OS X yesterday to 10.9.1. AE works, but Premiere CS6 doesn't even open. It starts but then I get the beach ball and after severa

  • Turning screen Lumia 920

    The screen of my Lumia 920 doesn't turn automaticly anymore. Can I change the settings somewhere?

  • Firefox crashes getting more frequent - maybe associated with Symantec PGP?

    In January Firefox crashed 6 times. On 1/22 I did a full reinstall of Firefox. Did not crash again until 2/25 but then crashed 3 times in 4 days. In March has crashed 5 times in first 12 days. Don't know if crash report is simply blocked from occurri

  • How to restart gwtdomain

    i can't start gwddomain, who can tell me how to restart gwtdomain.

  • E03 Program RSUSR003 Reports Security violation in SM21

    Hello All, I am getting below error in SM21: "E03 Program RSUSR003 Reports Security violation" ============================================================ Documentation for system log message E03 : The specified program encountered a problem. A shor