Hi

it works other way:

assume you have window w*h with aspect w/h, and ortho projection x*y with same 
aspect. Window resizes to w1*h1 with some other aspect w1/h1 -> projection now 
will be either:
1) x , (y*w*h1/(w1*h)) <- if we keep horizontal fow constant
or:
2) x*w1*h/(w*h1) , y <- if we keep vertical fow constant

with your numbers it gives projection:
1) (-50, 50, -75, 75), aspect 2/3
2) (-33.(3), 33.(3), -50, 50), aspect 2/3
and your new window aspect is same 2/3

you will get different _scale_, but it's uniform across screen, there is no 
stretching or smth.

Cheers,
Sergey.

10.08.2012, 16:32, "Ron Mayer" <[email protected]>:
> hybr wrote:
>
>>  Hi, Ron
>>
>>  What meaning would have BOTH option?
>>
>>  Each of HORIZONTAL and VERTICAL keep your projection aspect ratio same as 
>> window aspect ratio, difference is which one of horizontal fow or vertical 
>> fow they keep constant ( other is changed to match window aspect ratio ).
>>
>>  Cheers,
>>  Sergey.
>
> Hi Sergey,
> I am using orthographic projection.
> When the window size changes it is not enough just to adjust only the width 
> or only the height of the frustum (projection matrix of camera), since doing 
> that will distort the objects in the world in one axis, wouldn't it? I 
> understand that maintaining an equal aspect ratio between the window and 
> projection matrix can be done by modifying only one axis, but I also want to 
> avoid my objects getting stretched or contracted in one axis.
>
> For example, let's say we start with a window of size 100X100, and a camera 
> with an orthographic projection matrix of:
> (left, right, bottom, top) = (-50, 50, -50, 50). [ignoring near, far]
>
> Now the user modifies the window size to 50X75.
> If we only scale the projection matrix horizontally this means that our new 
> projection matrix has the values of:
> (left, right, bottom, top) = (-25, 25, -50, 50).
> The width of the frustum was scaled by 1/2, but the height of the frustum did 
> not change.
>
> The window height is now 75, which means the objects will not look correct in 
> their Y values after the viewport transformation.
>
> On the other hand, I may be wrong, since there is no "BOTH" resize policy, 
> for a good reason that I can't see ... so I am trying to understand where is 
> my mistake.
>
> Thanks  :D
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=49225#49225
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to