<div dir="ltr"><br><div>hi, I am using 3.4.0 with VisualStudio 2013, Win 8.1/x64, which all built fine (examples all work as expected).</div><div><br></div><div>So, I wrote  a very simple program, which unfortunately renders the cube offset from the horizontal axis, instead of being centered. The bounding sphere center = 0,0,0.  If I instead add:</div><div><br></div><div>view1.setUpViewInWindow(0, 0, image_width, image_height);<br></div><div><br></div><div>then it renders as expected at the center of the window with the default node trackball camera manipulator.</div><div><br></div><div> Would anyone have a clue why am I observing this behavior and how to</div><div>correct the problem? </div><div><br></div><div><div>#include "stdafx.h"</div><div>#include <stdio.h></div><div>#include <stdlib.h></div><div>#include <iostream></div><div><br></div><div>#include <osg/Node></div><div>#include <osg/Group></div><div>#include <osg/Geode></div><div>#include <osg/Geometry></div><div>#include <osgDB/ReadFile></div><div>#include <osgGA/TrackballManipulator></div><div>#include <osg/ShapeDrawable></div><div>#include <osg/MatrixTransform></div><div>#include <osg/StateAttribute></div><div>#include <osg/PositionAttitudeTransform></div><div>#include <osgGA/NodeTrackerManipulator></div><div>#include <osg/LineWidth></div><div>#include <osg/Transform></div><div>#include <osgText/Text></div><div>#include <osgUtil/PolytopeIntersector></div><div>#include <osgViewer/Viewer></div><div>#include <osg/Viewport></div><div>#include <osg/NodeCallback></div><div>#include <osg/Notify></div><div><br></div><div>#include <ctype.h></div></div><div><br></div><div><div>int _tmain(int argc, _TCHAR* argv[])</div><div>{</div><div><br></div></div><div><div><span class="" style="white-space:pre">        </span>float dimx = 2.0, dimy = 2.0, dimz = 2.0;</div><div><span class="" style="white-space:pre">  </span>osg::ref_ptr<osg::Box> cube_primitive(new osg::Box(osg::Vec3f(0, 0, 0), dimx, dimy, dimz));</div><div><span class="" style="white-space:pre">  </span>osg::ref_ptr<osg::ShapeDrawable> shape(new osg::ShapeDrawable(cube_primitive.get()));</div><div><span class="" style="white-space:pre">        </span>shape->setColor(osg::Vec4(8.0, 0.2, 0.0, 1.0));</div><div><span class="" style="white-space:pre"> </span>osg::ref_ptr<osg::Geode> shapegeode = new osg::Geode;</div><div><span class="" style="white-space:pre">        </span>shapegeode->addDrawable(shape.get());</div><div><span class="" style="white-space:pre">   </span>osg::Group * SceneNode = new osg::Group;</div><div><span class="" style="white-space:pre">   </span>SceneNode->addChild(shapegeode);</div><div><br></div><div><span class="" style="white-space:pre">       </span>osg::BoundingSphere bsphere = SceneNode->getBound();</div><div><span class="" style="white-space:pre">    </span>osg::Vec3d center = bsphere.center();</div><div><span class="" style="white-space:pre">      </span>printf(" *****bsphere: %f,%f,%f\n", center.x(), center.y(), center.z());</div><div><br></div><div><span class="" style="white-space:pre">        </span>osgViewer::Viewer view1;</div><div><span class="" style="white-space:pre">   </span>view1.setSceneData(SceneNode);</div></div><div><br></div><div><div><span class="" style="white-space:pre">     </span>view1.realize();</div><div><span class="" style="white-space:pre">   </span>view1.run();</div></div><div><br></div><div><div><span class="" style="white-space:pre">       </span>return 0;<br></div><div>}</div></div></div>