From ffc535354d7297b413e8cccf4be8079f657b549c Mon Sep 17 00:00:00 2001 From: djairoh Date: Mon, 20 Jan 2025 15:57:35 +0100 Subject: [PATCH] sane defaults for controls --- src/consts.h | 4 ++-- src/gui/input/Widget.cpp | 32 +++++++++++++------------------- src/main.cu | 2 +- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/consts.h b/src/consts.h index 4d2fd7b..5457594 100644 --- a/src/consts.h +++ b/src/consts.h @@ -5,8 +5,8 @@ #include // --------------------------- Basic Constants --------------------------- -const int INITIAL_WINDOW_WIDTH = 200; -const int INITIAL_WINDOW_HEIGHT = 150; +const int INITIAL_WINDOW_WIDTH = 800; +const int INITIAL_WINDOW_HEIGHT = 600; const double epsilon = 1e-10f; const double infty = 1e15f; // This value is used to represent missing values in data diff --git a/src/gui/input/Widget.cpp b/src/gui/input/Widget.cpp index 8eeb371..2e6c405 100644 --- a/src/gui/input/Widget.cpp +++ b/src/gui/input/Widget.cpp @@ -51,7 +51,7 @@ void parseDate(char* string, int dayOfYear) { } Widget::Widget(GLFWwindow* window) : - opacityK(0), + opacityK(63), sigmoidShift(0.5f), sigmoidExp(-250.0f), tfComboSelected(2), @@ -59,10 +59,10 @@ Widget::Widget(GLFWwindow* window) : paused(true), renderOnce(false), bgColor(Color3::init(0.1f, 0.1f, 0.1f)), - date(0), + date(301), samplesPerPixel(1), - alphaAcumLimit(0.4f), - opacityConst(100), + alphaAcumLimit(0.01f), + opacityConst(53), showSilhouettes(false), silhouettesThreshold(0.02f) { @@ -73,14 +73,6 @@ Widget::Widget(GLFWwindow* window) : ImGui_ImplGlfw_InitForOpenGL(window, true); ImGui_ImplOpenGL3_Init(); - this->cameraPos = Point3::init(59.0f, 77.5f, -18.0f); // Camera for partially trimmed data set - this->pitch = 0.7; - this->yaw = 4.85; - this->roll = -0.010; - this->cameraDir = Vec3::getDirectionFromEuler(pitch, yaw, roll); - - this->bgColor = Color3::init(0.1f, 0.1f, 0.1f); - this->lightPos = Point3::init(1.5, 2.0, -1.0); this->fps = (char*)malloc(512*sizeof(char)); this->dateString = (char*)malloc(512*sizeof(char)); @@ -164,9 +156,8 @@ void Widget::tick(double fps) { sprintf(this->fps, "%.3f fps\n", fps); ImGui::Text(this->fps); - // we have data from 2012-01-01 til 2012-09-11 == 255 days ImGui::SetNextItemWidth(20.0f * ImGui::GetFontSize()); - if (ImGui::SliderInt("Day of year", &this->date, 1, 255, "%d", ImGuiSliderFlags_NoInput)) { + if (ImGui::SliderInt("Day of year", &this->date, 1, 365, "%d", ImGuiSliderFlags_NoInput)) { this->dateChanged = true; parseDate(this->dateString, this->date); } @@ -206,11 +197,14 @@ void Widget::render() { } void Widget::resetCamera() { - this->cameraPos = Point3::init(50.0f, -50.0f, -75.0f); // Camera for partially trimmed data set - // this->cameraPos = Point3::init(300.0f, 200.0f, -700.0f); // Camera for full data set - - Vec3 h_center = Vec3::init((float)VOLUME_WIDTH/2.0f, (float)VOLUME_HEIGHT/2.0f, (float)VOLUME_DEPTH/2.0f); - this->cameraDir = (h_center - this->cameraPos).normalize(); + this->cameraPos = Point3::init(69.5f, -19.5f, 59.5f); // Camera for partially trimmed data set + this->pitch = -19.5; + this->yaw = -4.825; + this->roll = -0.0; + this->cameraDir = Vec3::getDirectionFromEuler(pitch, yaw, roll); + + // Vec3 h_center = Vec3::init((float)VOLUME_WIDTH/2.0f, (float)VOLUME_HEIGHT/2.0f, (float)VOLUME_DEPTH/2.0f); + // this->cameraDir = (h_center - this->cameraPos).normalize(); } diff --git a/src/main.cu b/src/main.cu index ce7945e..562dc4a 100644 --- a/src/main.cu +++ b/src/main.cu @@ -55,7 +55,7 @@ void getSpeed(std::vector& speedData, int idx = 0) { int main() { std::vector data; - getTemperature(data, 7); // 20121028 + getTemperature(data, 254); // 20121028 // getSpeed(data, 294); std::cout << "DATA size: " << data.size() << std::endl;