X-Git-Url: https://eleni.mutantstargoat.com/git/?p=demo;a=blobdiff_plain;f=src%2Fmain.cc;h=107fb9d765a53c0a1d02f13d388d573cc991b2e8;hp=933bd6247b24529ca682471d52ac121ec3e9e9dc;hb=47982b199010496e34eefb95044275fb231cba18;hpb=243eb502c5dc70e586a9e81815234069bf623480 diff --git a/src/main.cc b/src/main.cc index 933bd62..107fb9d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -45,7 +45,7 @@ int win_h = 600; float phi = 25; float theta = 0; -float dist = 4; +float dist = 16; ShaderManager *sdr_man; @@ -119,7 +119,6 @@ static bool init(Gfx_API api) sdr_man = new ShaderManager; camera = new OrbitCamera; - camera->set_orbit_params(phi, theta, dist); // scene_ground = new Scene; // if(!scene_ground->load("data/ground.obj")) { @@ -158,11 +157,11 @@ static bool init(Gfx_API api) TerrainParams p; p.xsz = 50; p.ysz = 50; - p.max_height = 1; - p.xtiles = 1; //40; - p.ytiles = 1; // 40; - p.tile_usub = 8; - p.tile_vsub = 8; + p.max_height = 2; + p.xtiles = 20; + p.ytiles = 20; + p.tile_usub = 10; + p.tile_vsub = 10; p.num_octaves = 3; p.noise_freq = 10; p.coarse_heightmap = 0; @@ -233,11 +232,11 @@ static void clbk_motion(GLFWwindow *win, double x, double y) prev_y = y; if(button[0]) { - theta += dx; - phi += dy; + theta += dx * 0.5; + phi += dy * 0.5; - if(phi < -90) - phi = -90; + if(phi < 0) + phi = 0; if(phi > 90) phi = 90; } @@ -268,7 +267,7 @@ static void clbk_reshape(GLFWwindow *win, int width, int height) static void display() { - camera->set_orbit_params(phi, theta, dist); + camera->set_orbit_params(theta, phi, dist); // gfx_clear(0.76, 0.3, 0.43); gfx_clear(0.1, 0.1, 0.1);