Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed May 24, 2024
1 parent 5a143d3 commit a6ff73a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
19 changes: 19 additions & 0 deletions doc/tutorial/rendering/tutorial-panda3d.dox
Original file line number Diff line number Diff line change
Expand Up @@ -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

*/
41 changes: 24 additions & 17 deletions tutorial/ar/tutorial-panda3d-renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vpPanda3DGeometryRenderer> geometryRenderer =
std::make_shared<vpPanda3DGeometryRenderer>(vpPanda3DGeometryRenderer::vpRenderType::OBJECT_NORMALS);
std::shared_ptr<vpPanda3DGeometryRenderer> cameraRenderer =
Expand All @@ -180,8 +188,9 @@ int main(int argc, const char **argv)
std::make_shared<vpPanda3DGaussianBlur>("blur", grayscaleFilter, false);
std::shared_ptr<vpPanda3DCanny> cannyFilter =
std::make_shared<vpPanda3DCanny>("canny", blurFilter, true, 10.f);
//! [Subrenderers]


//! [Adding subrenderers]
renderer.addSubRenderer(geometryRenderer);
renderer.addSubRenderer(cameraRenderer);
renderer.addSubRenderer(rgbRenderer);
Expand All @@ -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" <<std::endl;

renderer.addNodeToScene(object);

vpPanda3DAmbientLight alight("Ambient", vpRGBf(0.2));
Expand All @@ -220,7 +219,8 @@ int main(int argc, const char **argv)
vpPanda3DDirectionalLight dlight("Directional", vpRGBf(2.0), vpColVector({ 1.0, 1.0, 0.0 }));
renderer.addLight(dlight);

rgbRenderer->printStructure();
<<<<<<< HEAD
rgbRenderer->printStructure();
if (!backgroundPath.empty()) {
vpImage<vpRGBa> background;
vpImageIo::read(background, backgroundPath);
Expand All @@ -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<vpRGBf> normalsImage;
vpImage<vpRGBf> cameraNormalsImage;
Expand Down

0 comments on commit a6ff73a

Please sign in to comment.