Loic Cayou wrote:
Hi all,

I'm a real beginner on OSG and I want use it with Qt 4.5 on Win32. I have to export an activeX based on OSG (dev. with VS) on a Qt application. The main purpose it's to display an osg model, and to interactive with it (mouse and keyboard). I already use the adapterWidget class, that I found on example/osgViewerQt source browser. If I just use this class, my application run properly, but, this example use setSceneData() and only this method. I must use setSceneData() and addChild/removeChild methods in my application because I need show/hide some part of osg model when the user will want it.

There's no reason you can't use addChild/removeChild in that example.


And if I use this method, I get some graphics bug when I rotate the model with 
mouse. Indeed, some surfaces disappear to the view, and if I rotate my model it 
gives an impression of blinking. Also some parts of my model are shown over other 
parts, while they shouldn't. It's seem to be a zBuffer problem (frustum?). I use 
setProjectionMatrixAsOrtho instead setProjectionMatrixAsFrustum. If I use frustum 
my model disappear... With setProjectionMatrixAsOrtho, I can change near & far 
values, but it doesn't change anything...

You don't want to use Ortho or Ortho2D for this. It's completely the wrong approach for this kind of use case. Try using setProjectionMatrixAsPerspective instead, with a fov of 45.0 and the aspect ratio set appropriately. The viewer should handle setting the near/far planes for you, but you can use 0.01 and 1000.0 as starting values.

--"J"


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

Reply via email to