Hi and welcome to OSG.
 
You need to make sure your viewport and projection matrix have
equivalent aspect ratios.
 
The best way to do this in MFC is to use the viewport dimensions that
your using (traits->width, traits->height) and then change your
projection matrix to match that aspect ratio.
 
-Steve
 
 
 
________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of TANG
Fangqin
Sent: Tuesday, July 15, 2008 10:34 AM
To: [email protected]
Subject: [osg-users] Using OsgViewerMFC to load a sphere
 
Hi All,
 
I am a beginner of OSG. 
I used OsgViewerMFC to load a sphere into the scene, but it displays as
an ellipsoid.
The radius doesn't seem to be equal in two orthotropic axes.
 
I find that it may be related to the width and height of the view window
when initializing.
 
The following codes are from OsgViewerMFC:
 
::GetWindowRect(m_hWnd, &rect);
...
traits->x = 0;
traits->y = 0;
traits->width = rect.right - rect.left;
traits->height = rect.bottom - rect.top;
...
osg::GraphicsContext* gc =
osg::GraphicsContext::createGraphicsContext(traits.get());
 
How to solve this?
Thanks for your advices in advance.
Tang
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to