Hi Robert,
    
      As you had suggested, I tried creating the osgViewer::CompositeViewer 
object and to it attached the osgViewer::View. Further, as shown in 
osgMultipleCameras example, the traits structure was filled accordingly. The 
problem I am now facing is how to attach the MFC Window to the GraphicsContext 
/ osgViewer. OSGMFC achieved this by passing the window handle using 
GetSafeHwnd() to Producer::RenderSurface. But I could not locate a mechanism of 
passing any such information to the osgViewer::View or CompositeViewer or 
Viewer. One Win32WindowingSystemInterface class  I could locate, but there too 
I could not find a way out.
   
  Regards
   
  Harash. 

Robert Osfield <[EMAIL PROTECTED]> wrote:
  HI Harash,

The lastest dev versions (SVN and 1.9.x series) of the OSG have support for 
multiple views onto one or more scenes, this is supported by the 
osgViewer::CompositeViewer class.  To use this you'll create a osgViewer::View 
for each view you have and this to the CompostiteViewer object (you'll maintain 
one per app).  

For each View you'll probably just have one master Camera, and to this you need 
to attach what it'll be rendering to - a GraphicsContext/GraphicsWindow.  To 
attach a GraphicsWindow you'll need to create it, and in your case most likely 
attaching it to a pre-existing MFC window, this is possible by the 
inheritedWindowData filed in osg::GraphicsContext::Triats structure used to 
describe the window you want to create. 

This is a lot to take in, so take it bit by bit, first up familiarise yourself 
with the osgcamera and osgmultiplecamera examples, the later uses 
CompositeViewer.

I wouldn't recommend looking too long at OSGMFC as this is very old now, long 
before the new osgViewer library included with the OSG. 


Robert.

  On 5/4/07, Harash Sharma <[EMAIL PROTECTED]> wrote:    Hi Robert,
   
      I have started using OSG the previous month. It is fantastic. But I have 
a lot of queries which I intend to clear through you. I am using VS-2005. My 
application uses the standard Document - View Architecture provided by MFC. The 
application is of Multiple Document Interface type. The software is supposed to 
load a scene graph database and use multiple views to render this scene with 
each view attached to a different camera position. I downloaded the recommended 
OSGMFC sample application for the purpose of learning the mechanism to do so. 
Now my doubts: 
   
  1. The osgDB reads the file in the view class, which means that each time I 
open a new window, the database is reloaded. Is it true that due to 
maintainence of multiple copies of the scene, the memory consumption increases? 
   
  2. Next I tried to move the reference pointer to the scene node to the 
document class and read the scene database once and for all in the Document 
class. The program works fine as long as only one view window is opened. The 
moment we open another window, the whole texture disappears. Why does this 
happen? What is the best way to achieve what I am doing with high efficiency 
and minimum memory utilisation. 
   
   
  Regards
   
   
  Harash


  
  
---------------------------------
  Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.   

_______________________________________________
osg-users mailing list
[email protected] 
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

              
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to