From f30aae07cc27a405b01cc61036581db17568e6ec Mon Sep 17 00:00:00 2001 From: "techmatt@gmail.com" Date: Sat, 18 Jun 2011 18:58:18 +0000 Subject: [PATCH] --- TODO.txt | 5 ----- common/Model.cpp | 1 + common/Scene.cpp | 2 +- sceneViewer/sceneViewer.cpp | 18 ++++++++++++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/TODO.txt b/TODO.txt index d7e6dd7..98e181b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,13 +1,8 @@ make linux build infrastructure: test under Mac, Cygwin, Linux -convert scenes from SceneStudio format into SceneDatabase format: more elaborate naming convention, unneeded stuff thrown out, expand transforms to ASCII -Load SceneDatabase format into sceneViewer -convert models from SceneStudio format into SceneDatabase format: use obj -Load objs into sceneViewer and modelViewer Make field files - tags, names, description, downloads/views, textures, Zernike descriptor Write modelViewer and sceneViewer interfaces - look at font rendering - - camera interface - toggle through scenes - load fields \ No newline at end of file diff --git a/common/Model.cpp b/common/Model.cpp index 46d1900..45a390b 100644 --- a/common/Model.cpp +++ b/common/Model.cpp @@ -6,6 +6,7 @@ Model::Model(const std::string &directory, const std::string &baseFilename) { + std::cout << " Loading model: " << baseFilename << '\n'; // // Note that this obj loader is not designed to function on all possible obj files, and does not handle improperly formatted files correctly // diff --git a/common/Scene.cpp b/common/Scene.cpp index 4cfc3c3..1dcf3ef 100644 --- a/common/Scene.cpp +++ b/common/Scene.cpp @@ -7,7 +7,7 @@ void Scene::Load(const Parameters ¶ms, const std::string &filename, Assets &assets) { std::string sceneFilename = params.databaseDirectory + "scenes/" + filename + ".txt"; - std::cout << "Loading " << sceneFilename << '\n'; + std::cout << "Loading Scene: " << sceneFilename << '\n'; auto lines = Utility::GetFileLines(sceneFilename, 2); if(lines[0] != "StanfordSceneDatabase" || lines[1] != "version 1.0") { diff --git a/sceneViewer/sceneViewer.cpp b/sceneViewer/sceneViewer.cpp index c73ae6c..4d1d11d 100644 --- a/sceneViewer/sceneViewer.cpp +++ b/sceneViewer/sceneViewer.cpp @@ -9,14 +9,19 @@ void SceneViewer::Init() { _params.Init("parameters.txt"); - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); + std::cout << "Usage: Modify parameters.txt to change which scene is loaded\n"; _scene.Load(_params, _params.defaultScene, _assets); _camera.Reset(Vec3f(100.0f, 100.0f, 100.0f), Vec3f(0.0f, 0.0f, 1.0f), Vec3f(0.0f, 0.0f, 0.0f)); std::cout << "Initialization done\n"; + + std::cout << "\n[W/A/S/D/R/F]: Translate camera\n"; + std::cout << "[2/4/6/8]: Look around\n"; + std::cout << "[Left mouse drag]: Look around\n"; + std::cout << "[Right mouse drag]: Pan camera\n"; + } void SceneViewer::ReSize(int windowWidth, int windowHeight) @@ -79,6 +84,12 @@ void SceneViewer::KeyPress(unsigned char key) case 'd': _camera.Strafe(-moveDistance); break; + case 'r': + _camera.Jump(moveDistance); + break; + case 'f': + _camera.Jump(-moveDistance); + break; case '2': _camera.LookUp(angleDistance); break; @@ -103,6 +114,9 @@ void SceneViewer::Render() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, _windowWidth, _windowHeight); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glMatrixMode( GL_PROJECTION ); glLoadIdentity();