rugmodelscale can be changed live now

This commit is contained in:
Zeno Rogue 2018-01-28 12:21:10 +01:00
parent 29e2589fcb
commit f6957614b8
1 changed files with 14 additions and 4 deletions

18
rug.cpp
View File

@ -1526,9 +1526,8 @@ void show() {
dialog::addSelItem(XLAT("native geometry"), XLAT(gwhere ? ginf[gwhere].name : "hyperbolic"), 'n');
else
dialog::addSelItem(XLAT("radar"), radar_distance == RADAR_INF ? "" : fts4(radar_distance), 'r');
if(!rug::rugged)
dialog::addSelItem(XLAT("model scale factor"), fts(modelscale), 'm');
else
dialog::addSelItem(XLAT("model scale factor"), fts(modelscale), 'm');
if(rug::rugged)
dialog::addSelItem(XLAT("model iterations"), its(queueiter), 0);
dialog::addSelItem(XLAT("field of view"), fts(fov) + "°", 'f');
// dialog::addSelItem(XLAT("protractor"), fts(protractor * 180 / M_PI) + "°", 'f');
@ -1575,12 +1574,23 @@ void show() {
else if(uni == 'r')
addMessage(XLAT("This just shows the 'z' coordinate of the selected point."));
else if(uni == 'm') {
dialog::editNumber(modelscale, 0.1, 10, .1, 1, "model scale factor",
dialog::editNumber(modelscale, 0.1, 10, rugged ? .001 : .1, 1, "model scale factor",
"This is relevant when the native geometry is not Euclidean. "
"For example, if the native geometry is spherical, and scale < 1, a 2d sphere will be rendered as a subsphere; "
"if the native geometry is hyperbolic, and scale > 1, a hyperbolic plane will be rendered as an equidistant surface. "
);
dialog::scaleLog();
if(rug::rugged) {
static ld last;
last = modelscale;
dialog::reaction = [] () {
for(auto p:points) {
for(auto& e: p->edge) e.len *= modelscale / last;
enqueue(p);
}
last = modelscale;
}
}
}
else if(uni == 'p') {
rug_perspective = !rug_perspective;