Skip to content

Commit 5100323

Browse files
ShinP00rfenollp
authored andcommitted
reset camera with O (#76)
1 parent bd96115 commit 5100323

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ The actual file being represented below [is data/BigPictureBG.tga](http://www.do
2525

2626
```shell
2727
./configure -d RELEASE && cd build && make
28-
./voidstar --move --spin ../data/*
28+
./voidstar --move ../data/*
2929
# Press H and L to switch between files
3030
# Use A W S D Z X and your mouse to move in the 3D space
3131
# Press F for full screen
3232
# Use the arrows to slide and enlarge the sliding window
33-
# Press M to slide the window to the end and SPACE to spin the shape
33+
# Press M to slide the window to the end
34+
# SPACE to toggle spinning the shape
35+
# Press O to reset the camera position
3436
# ESC to quit
3537
```
3638

src/Arguments.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ usage(const char* prgname) {
2121
<< " -w, --sliding Length of sliding window" << std::endl
2222
<< " -s, --slide-step Amount of points slid" << std::endl
2323
<< " -m, --move Move sliding window forward" << std::endl
24-
<< " -n, --spin Spin shape on itself" << std::endl
24+
<< " -n, --spin Don't spin shape on itself" << std::endl
2525
<< std::endl
2626
<< " -b, --begin begin offset for the range" << std::endl
2727
<< " -e, --end end offset for the range" << std::endl
@@ -96,7 +96,7 @@ parseArgs(int argc, char *argv[]) {
9696
args->move_window = true;
9797
break;
9898
case 'n':
99-
args->spin_shape = true;
99+
args->spin_shape = false;
100100
break;
101101
case 's':
102102
args->sliding_step = std::stoul(optarg);

src/Scene3D.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ Scene3D::load(std::shared_ptr<Algorithm> algorithm) {
8888
std::cout << "#indices: " << Manager::size2str(indices_.size()) << std::endl;
8989
load_buffers();
9090

91-
camera_.setPosition(glm::vec3(0, 0, 4));
92-
camera_.setNearAndFarPlanes(0.1, 100.);
91+
// camera_.setPosition(glm::vec3(0, -0.1, 3));
92+
// camera_.lookAt(glm::vec3(0,0,4));
93+
// camera_.setNearAndFarPlanes(0.1, 100.);
9394
}
9495

9596
bool
@@ -115,7 +116,10 @@ Scene3D::update(std::shared_ptr<Manager> manager, float elapsedTime) {
115116
camera_.offsetPosition(elapsedTime * move_speed_ * -glm::vec3(0,1,0));
116117
else if (events->keyDown('X'))
117118
camera_.offsetPosition(elapsedTime * move_speed_ * glm::vec3(0,1,0));
118-
119+
if (events->keyPressed('O')) {
120+
camera_.setPosition(glm::vec3(0, -0.1, 3.8));
121+
camera_.lookAt(glm::vec3(0,0,4));
122+
}
119123
if (events->keyPressed(' '))
120124
manager->args()->spin_shape = !manager->args()->spin_shape;
121125
if (events->keyPressed('M'))

src/include/Arguments.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ struct Arguments {
1313
range_begin(0), range_end(0),
1414
fullscreen(false),
1515
keep_chrome(false),
16-
sliding_window_length(2*1024), sliding_step(1024), move_window(false),
17-
spin_shape(false)
16+
sliding_window_length(37*1024), sliding_step(1024), move_window(false),
17+
spin_shape(true)
1818
{}
1919

2020
std::vector<std::string> paths;

0 commit comments

Comments
 (0)