diff --git a/doc/tutorial/rendering/tutorial-panda3d.dox b/doc/tutorial/rendering/tutorial-panda3d.dox index 9ee001aa6c..7a6ada5a62 100644 --- a/doc/tutorial/rendering/tutorial-panda3d.dox +++ b/doc/tutorial/rendering/tutorial-panda3d.dox @@ -3,4 +3,23 @@ \tableofcontents \section tutorial-panda3d-intro Introduction + +\snippet tutorial-panda3d-renderer.cpp Renderer set + +\snippet tutorial-panda3d-renderer.cpp Subrenderers + +\snippet tutorial-panda3d-renderer.cpp Adding subrenderers + +\warning ADD plot + +\snippet tutorial-panda3d-renderer.cpp Scene configuration + + +\section tutorial-panda3d-full-code Full code + + + + +\include tutorial-panda3d-renderer.cpp + */ diff --git a/tutorial/ar/tutorial-panda3d-renderer.cpp b/tutorial/ar/tutorial-panda3d-renderer.cpp index 8f5f7f601b..ffa71f4cf2 100644 --- a/tutorial/ar/tutorial-panda3d-renderer.cpp +++ b/tutorial/ar/tutorial-panda3d-renderer.cpp @@ -160,12 +160,20 @@ int main(int argc, const char **argv) if (backgroundPathCstr) { backgroundPath = backgroundPathCstr; } + const std::string objectName = "object"; + + //! [Renderer set] vpPanda3DRenderParameters renderParams(vpCameraParameters(300, 300, 160, 120), 240, 320, 0.01, 10.0); vpPanda3DRendererSet renderer(renderParams); renderer.setRenderParameters(renderParams); + renderer.setVerticalSyncEnabled(false); + renderer.setAbortOnPandaError(true); + if (debug) { + renderer.enableDebugLog(); + } + //! [Renderer set] - const std::string objectName = "object"; - + //! [Subrenderers init] std::shared_ptr geometryRenderer = std::make_shared(vpPanda3DGeometryRenderer::vpRenderType::OBJECT_NORMALS); std::shared_ptr cameraRenderer = @@ -180,8 +188,9 @@ int main(int argc, const char **argv) std::make_shared("blur", grayscaleFilter, false); std::shared_ptr cannyFilter = std::make_shared("canny", blurFilter, true, 10.f); + //! [Subrenderers] - + //! [Adding subrenderers] renderer.addSubRenderer(geometryRenderer); renderer.addSubRenderer(cameraRenderer); renderer.addSubRenderer(rgbRenderer); @@ -192,23 +201,13 @@ int main(int argc, const char **argv) renderer.addSubRenderer(grayscaleFilter); renderer.addSubRenderer(blurFilter); renderer.addSubRenderer(cannyFilter); - - } - - renderer.setVerticalSyncEnabled(false); - renderer.setAbortOnPandaError(true); - if (debug) { - renderer.enableDebugLog(); } - - std::cout << "Initializing Panda3D rendering framework" << std::endl; renderer.initFramework(); + //! [Adding subrenderers] - std::cout << "Loading object " << modelPath << std::endl; + //! [Scene configuration] NodePath object = renderer.loadObject(objectName, modelPath); - std::cout << "Adding node to scene" <printStructure(); + <<<<<<< HEAD + rgbRenderer->printStructure(); if (!backgroundPath.empty()) { vpImage background; vpImageIo::read(background, backgroundPath); @@ -230,7 +230,14 @@ int main(int argc, const char **argv) std::cout << "Setting camera pose" << std::endl; renderer.setCameraPose(vpHomogeneousMatrix(0.0, 0.0, -0.3, 0.0, 0.0, 0.0)); - unsigned h = renderParams.getImageHeight(), w = renderParams.getImageWidth(); + ====== = + renderer.setCameraPose(vpHomogeneousMatrix(0.0, 0.0, -0.3, 0.0, 0.0, 0.0)); + //! [Scene configuration] + + rgbRenderer->printStructure(); + + >>>>>>> c386b93ae(tutorial structure) + unsigned h = renderParams.getImageHeight(), w = renderParams.getImageWidth(); std::cout << "Creating display and data images" << std::endl; vpImage normalsImage; vpImage cameraNormalsImage;