Hi all,

I'm having some issues with AutoTransform (scale to screen) and wide aspect viewports. To reproduce do something like:

export OSG_WINDOW="0 0 800 600"
osgautotransform

Then zoom out until only "Autoscale with no min, max limits" is visible. Then make the aspect of the window larger/wider. You will see that the size of the text gets smaller.

I've followed that AutoTransform uses CullStack->pixelSize() (to determine its scale) and that this uses CullingSet::computePixelSizeVector().

I can't quite follow the code in computePixelSizeVector, but noticed that the scaleRatio depends on both horizontal and vertical scales, but AFAIK OSG automatically adjusts the projection matrix so that only vertical scale matters. If I change:

float scaleRatio = 0.7071067811f/sqrtf(scale_00.length2()+scale_10.length2());

into

float scaleRatio  = 0.5/sqrtf(scale_10.length2());

then the osgautotransform example behaves like I would expect, i.e. the text stays the same size no matter what the window aspect. I'm not sure this is a "solution" though.

So my questions:
- What does the output of computePixelSizeVector represent? Can I write in a matrix multiplation form? MVP*vec?
- Will it work for ortho projections?

thanks
jp

BTW, the text getting smaller for wide aspect is also present in the osgtext example for the pixel_size_on_screen line.

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to