Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
techmatt@gmail.com committed Jun 18, 2011
1 parent 6b36118 commit f30aae0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
5 changes: 0 additions & 5 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions common/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
2 changes: 1 addition & 1 deletion common/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
void Scene::Load(const Parameters &params, 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")
{
Expand Down
18 changes: 16 additions & 2 deletions sceneViewer/sceneViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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();

Expand Down

0 comments on commit f30aae0

Please sign in to comment.