-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f02118
commit 1a6c9cf
Showing
7 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015 Liangliang Nan <[email protected]> | ||
* https://3d.bk.tudelft.nl/liangliang/ | ||
* | ||
* This file is part of Easy3D. If it is useful in your research/work, | ||
* I would be grateful if you show your appreciation by citing it: | ||
* ------------------------------------------------------------------ | ||
* Liangliang Nan. | ||
* Easy3D: a lightweight, easy-to-use, and efficient C++ library | ||
* for processing and rendering 3D data. | ||
* Journal of Open Source Software, 6(64), 3255, 2021. | ||
* ------------------------------------------------------------------ | ||
* | ||
* Easy3D is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License Version 3 | ||
* as published by the Free Software Foundation. | ||
* | ||
* Easy3D is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
********************************************************************/ | ||
|
||
#include <easy3d/viewer/offscreen.h> | ||
#include <easy3d/util/resource.h> | ||
|
||
|
||
using namespace easy3d; | ||
|
||
|
||
int offscreen() { | ||
const std::string file_name = resource::directory() + "/data/bunny.ply"; | ||
OffScreen os; | ||
if (!os.add_model(file_name)) { | ||
LOG(ERROR) << "failed to load model. Please make sure the file exists and format is correct."; | ||
return EXIT_FAILURE; | ||
} | ||
|
||
bool failed(false); | ||
if (!os.render("bunny-0.png")) | ||
failed = true; | ||
if (!os.render("bunny-1.png", 2.0f, 0)) | ||
failed = true; | ||
if (!os.render("bunny-2.png", 2.0f, 4, 0)) | ||
failed = true; | ||
if (!os.render("bunny-3.png", 2.0f, 4, 1)) | ||
failed = true; | ||
if (!os.render("bunny-4.png", 2.0f, 4, 2)) | ||
failed = true; | ||
|
||
LOG_IF(failed, ERROR) << "offscreen renderer failed to render the scene"; | ||
return failed ? EXIT_FAILURE : EXIT_SUCCESS; | ||
} |