pseudogonal mode

This commit is contained in:
Zeno Rogue 2021-10-15 22:36:43 +02:00
parent e3c80b70bf
commit cb75ba44dc
4 changed files with 26 additions and 2 deletions

View File

@ -2183,6 +2183,11 @@ EX void show3D() {
if((WDIM == 2 && GDIM == 3) || prod)
dialog::addBoolItem_action(XLAT("fixed Y/Z rotation"), vid.fixed_yz, 'Z');
if(WDIM == 2 && GDIM == 3) {
add_edit(vid.pseudogonal);
// add_edit(vid.depth_bonus);
}
if(true) {
dialog::addBreak(50);
dialog::addSelItem(XLAT("projection"), current_proj_name(), 'M');
@ -2297,6 +2302,10 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
->editable(0, 24, 1, "number of parallels drawn", "", 'n');
param_f(linepatterns::parallel_max, "parallel_max")
->editable(0, 360*degree, 15*degree, "last parallel drawn", "", 'n');
param_f(vid.depth_bonus, "depth_bonus", 0)
->editable(-5, 5, .1, "depth bonus in pseudogonal", "", 'b');
param_b(vid.pseudogonal, "pseudogonal", false)
->editable("make the tiles flat", 'p');
param_f(vid.depth, "depth", "3D depth", 1)
->editable(0, 5, .1, "Ground level below the plane", "", 'd')
->set_extra([] {

View File

@ -601,8 +601,19 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
#endif
if(1) {
int s = fsh.b[id].s;
int e = fsh.b[id].e-1;
for(int t=0; t<e-s; t++) {
int e = fsh.b[id].e-1;
hyperpoint ctr = Hypc;
for(int t=0; t<e-s; t++)
ctr += orthogonal_move(may_kleinize(hpc[s+t]), dfloor_table[k]);
ctr = normalize(ctr);
if(vid.pseudogonal) for(int t=0; t<e-s; t++) {
hyperpoint v1 = orthogonal_move(may_kleinize(hpc[s+t]), dfloor_table[k]) - ctr;
hyperpoint v2 = orthogonal_move(may_kleinize(hpc[s+t+1]), dfloor_table[k]) - ctr;
texture_order([&] (ld x, ld y) {
hpcpush(normalize(ctr + v1 * x + v2 * y));
});
}
if(!vid.pseudogonal) for(int t=0; t<e-s; t++) {
hyperpoint v1 = may_kleinize(hpc[s+t]) - C0;
hyperpoint v2 = may_kleinize(hpc[s+t+1]) - C0;
texture_order([&] (ld x, ld y) {

View File

@ -1177,6 +1177,8 @@ EX string cgi_string() {
V("ASH", ONOFF(vid.gp_autoscale_heights));
V("LT", fts(vid.lake_top));
V("LB", fts(vid.lake_bottom));
if(GDIM == 3 && vid.pseudogonal)
V("PS", fts(vid.depth_bonus));
}
V("3D", ONOFF(vid.always3));

View File

@ -400,6 +400,8 @@ struct videopar {
ld lake_top, lake_bottom;
ld rock_wall_ratio;
ld human_wall_ratio;
bool pseudogonal; // in 3D modes
ld depth_bonus; // to fiix the placement of 3D models in pseudogonal -- not working currently
int tc_alpha, tc_depth, tc_camera;
ld highdetail, middetail;