Changeset 8432

Show
Ignore:
Timestamp:
06/12/08 18:16:55
Author:
robert
Message:

Filled out exercises

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/07_databases/7e_ReadCallback/7e_ReadCallback.cpp

    r8264 r8432  
    5656     
    5757    viewer.setSceneData(osgDB::readNodeFiles(arguments)); 
    58     if (viewer.getSceneData()) 
     58    if (!viewer.getSceneData()) 
    5959    { 
    6060        std::cout<<"No data loaded, please specify a file"<<std::endl; 
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/10_callbacks/10d_DrawCallbacks/10d_DrawCallbacks.cpp

    r8117 r8432  
    66int main( int argc, char **argv ) 
    77{ 
    8     std::cout<<"TODO "<<argv[0]<<std::endl; 
     8    // This exercise will explore the use 
     9    // of draw callbacks. 
     10     
     11    // 1. Load the cow.osg model attach draw callback 
     12    //    to the leaf geometry to control override the 
     13    //    the normal rendering of the geometry to make 
     14    //    it blink on/off every ten frames. 
     15    //     
     16    //    Hints I: use a print message to confirm that your 
     17    //    draw callback is being called each frame. 
     18    // 
     19    //    Hints II: call the drawable->drawImplemenation(RenderInfo&) 
     20    //    to do the rendering of the actual geometry 
     21    // 
     22    // 
     23    // 2. Is your callback being called as often as you'd expect? 
     24    // 
     25    //    Hint III: osg::Drawable uses display lists by default so 
     26    //    will on call the draw callback once to compile the display 
     27    //    list and then just call the display list thereafter.  To 
     28    //    make sure its called each frame disable display lists via 
     29    //    drawable->setUseDisplayList(false) at scene graph setup 
    930     
    1031    return 0; 
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/10_callbacks/10e_CameraCallbacks/10e_CameraCallbacks.cpp

    r8117 r8432  
    66int main( int argc, char **argv ) 
    77{ 
    8     std::cout<<"TODO "<<argv[0]<<std::endl; 
     8    // This exercise will explore the use 
     9    // of camera draw callbacks. 
     10     
     11    // 1. Load the cessnafire.osg model use a camera post draw callback 
     12    //    to capture the screen, for a single frame, to an image and  
     13    //    write it out to screenimage.jpg 
     14    // 
     15    // 2. Write an event handler that is coupled with the above callback to 
     16    //    enable the draw callback in response to pressing a key to capture 
     17    //    the screen for the next frame. 
     18    // 
     19    // 3. Add a key to the event handler and support into draw callback for 
     20    //    capturing a continous screen of frames and write out to a series 
     21    //    of images. 
     22    // 
     23    // 4. Discuss performance of your solution and possible ways of to improve it. 
    924     
    1025    return 0; 
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/11_nodekits/11a_osgText/11a_osgText.cpp

    r8120 r8432  
    66int main( int argc, char **argv ) 
    77{ 
    8     std::cout<<"TODO "<<argv[0]<<std::endl; 
    9      
     8    // This exercise fleshes out how one  
     9    // can use osgText NodeKit 
     10    // 
     11    // 1. Create a scene graph from a group 
     12    //    that contains text drawables of  
     13    //    variying character size. 
     14    // 
     15    // 
     16    // 2. Change the text to vary the font 
     17    //    between the differnt text drawables 
     18    //    Hint: You can use Windows .ttf font 
     19    //    font files or OpenSceneGraph-Data/fonts 
     20    // 
     21    // 3. Change the text so that one text object 
     22    //    stays in object space, another is rotated 
     23    //    to the face the camera, another that is 
     24    //    scaled automatically to screen space 
     25 
    1026    return 0; 
    1127} 
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/11_nodekits/11b_osgParticle/11b_osgParticle.cpp

    r8120 r8432  
    66int main( int argc, char **argv ) 
    77{ 
    8     std::cout<<"TODO "<<argv[0]<<std::endl; 
    9      
     8    // This exercise fleshes out how one  
     9    // can use osgParticle NodeKit 
     10    // 
     11    // 1. Load lz.osg into a viewer and explore the model, 
     12    //    contemplate how lovery it'll be to blow it up!! 
     13    // 
     14    // 2. Add a pick handler to the viewer to get the  
     15    //    intersection of the mouse pointer with the  
     16    //    terrain - print out the x,y,z world coords 
     17    //    of these intersections. 
     18    // 
     19    // 3. In response the pick event add an  
     20    //    osgParticle::ExplosionEffect to the root of  
     21    //    the scene at the picked x,y,z world coords.  
     22    // 
     23    // 4. Add smoke and fire effects with parameters that 
     24    //    suit the explosion (experiment). 
     25    // 
     26    // 5. Add a cessna into the scene, and animate it via 
     27    //    an animation path callback.  See what happens when 
     28    //    you pick it... discuss what's happening 
     29    // 
     30    // 6. Now attach the effects to the cessna subgraph to 
     31    //    make it animate correctly. Discuss the results. 
     32    //  
     33    // 7. Modify the moving model case so that smoke/fire  
     34    //    animation is in world coords, but the source stays 
     35    //    local to the cessna.      
     36 
    1037    return 0; 
    1138} 
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/11_nodekits/11c_osgSim/11c_osgSim.cpp

    r8120 r8432  
    66int main( int argc, char **argv ) 
    77{ 
    8     std::cout<<"TODO "<<argv[0]<<std::endl; 
     8    // This exercise fleshes out how one  
     9    // can use elements the osgSim NodeKit 
     10    // 
     11    // 1. Create a viewer, and load the lz.org model 
     12    // 
     13    // 2. Create a subgraph containing   
     14    //    text such as the address of your company 
     15    //    and place the text on the XY plane hovering 
     16    //    over the lz data 
     17    // 
     18    // 3. Create an OverlayNode to decorate the lz subgraph 
     19    //    and attach text subgraph to the OverlayNode as  
     20    //    the overlay subgraph 
     21    // 
     22    // 4. View the resulting overlay texture resolution, 
     23    //    discuss the visual quality 
     24    // 
     25    // 5. Change the RTT technique used by OverlayNode and 
     26    //    examine the changes in visual quality.  
    927     
    1028    return 0;