Using the "Pview" tool to preview models

No matter which content creation tools our artists are using, we can be sure that these programs have different ways of displaying models than the Panda3D engine. This can be quite annoying for artists to work with, as they would have to export their work and wait for the game assets to be repackaged. Then they would have to start the game and load the model, just to check what it looks like in the game. This is not what we want to happen.

Instead, we want to have a little application that allows artists to quickly load a model so they can preview how Panda3D displays their work. Luckily, we do not need to write this program ourselves, as the Panda3D developers already implemented a little tool called Pview for this situation. This recipe will give you a short introduction to this tool.

How to do it...

Let's explore the features of the Pview tool:

  1. Open a new command prompt window.
  2. Type the following command and press the Enter key:
    pview l panda panda-walk
    
  3. Hold down the left mouse button and move the mouse to pan the panda around.
  4. Push and hold the right mouse button, move the mouse forward and back to zoom in and out.
  5. Hold down the Alt key on your keyboard while holding the left mouse button and moving the mouse to rotate the panda around its center point.
  6. Center the Panda in the window by pressing the C key on your keyboard.
  7. Press W once to turn on wireframe rendering. Press the key a second time to switch back to normal rendering.
  8. Turn on basic lighting by hitting L.
  9. 9 Press the COMMA key multiple times to toggle through different background colors.
  10. Open a new window. Press the Shift and W keys at the same time.
  11. To close the newly opened window again, use the Q key.
  12. 12 Open animation controls using the A key:
    How to do it...
  13. Take a screenshot of the current window by pressing F9.
  14. Press Escape to quit.

How it works...

While operating, the tool does not need any further explanation; we should take a quick look at the command line parameters that we used to start the program. The -l option makes Pview load the model data asynchronously, which means that the window appears immediately, and the model will be visible after a short loading delay. The first argument after this option is the model or actor to preview, which is mandatory. Optionally, as we do in this recipe, the second argument is the name of an .egg or .bam file containing animation data. Pview will load the first animation it finds contained within that .egg or .bam file and then begin playing the animation in a continuous loop.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset