sane defaults for controls
This commit is contained in:
parent
7f22c0372b
commit
ffc535354d
|
|
@ -5,8 +5,8 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
// --------------------------- Basic Constants ---------------------------
|
// --------------------------- Basic Constants ---------------------------
|
||||||
const int INITIAL_WINDOW_WIDTH = 200;
|
const int INITIAL_WINDOW_WIDTH = 800;
|
||||||
const int INITIAL_WINDOW_HEIGHT = 150;
|
const int INITIAL_WINDOW_HEIGHT = 600;
|
||||||
|
|
||||||
const double epsilon = 1e-10f;
|
const double epsilon = 1e-10f;
|
||||||
const double infty = 1e15f; // This value is used to represent missing values in data
|
const double infty = 1e15f; // This value is used to represent missing values in data
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ void parseDate(char* string, int dayOfYear) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget::Widget(GLFWwindow* window) :
|
Widget::Widget(GLFWwindow* window) :
|
||||||
opacityK(0),
|
opacityK(63),
|
||||||
sigmoidShift(0.5f),
|
sigmoidShift(0.5f),
|
||||||
sigmoidExp(-250.0f),
|
sigmoidExp(-250.0f),
|
||||||
tfComboSelected(2),
|
tfComboSelected(2),
|
||||||
|
|
@ -59,10 +59,10 @@ Widget::Widget(GLFWwindow* window) :
|
||||||
paused(true),
|
paused(true),
|
||||||
renderOnce(false),
|
renderOnce(false),
|
||||||
bgColor(Color3::init(0.1f, 0.1f, 0.1f)),
|
bgColor(Color3::init(0.1f, 0.1f, 0.1f)),
|
||||||
date(0),
|
date(301),
|
||||||
samplesPerPixel(1),
|
samplesPerPixel(1),
|
||||||
alphaAcumLimit(0.4f),
|
alphaAcumLimit(0.01f),
|
||||||
opacityConst(100),
|
opacityConst(53),
|
||||||
showSilhouettes(false),
|
showSilhouettes(false),
|
||||||
silhouettesThreshold(0.02f)
|
silhouettesThreshold(0.02f)
|
||||||
{
|
{
|
||||||
|
|
@ -73,14 +73,6 @@ Widget::Widget(GLFWwindow* window) :
|
||||||
ImGui_ImplGlfw_InitForOpenGL(window, true);
|
ImGui_ImplGlfw_InitForOpenGL(window, true);
|
||||||
ImGui_ImplOpenGL3_Init();
|
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->fps = (char*)malloc(512*sizeof(char));
|
||||||
this->dateString = (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);
|
sprintf(this->fps, "%.3f fps\n", fps);
|
||||||
ImGui::Text(this->fps);
|
ImGui::Text(this->fps);
|
||||||
|
|
||||||
// we have data from 2012-01-01 til 2012-09-11 == 255 days
|
|
||||||
ImGui::SetNextItemWidth(20.0f * ImGui::GetFontSize());
|
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;
|
this->dateChanged = true;
|
||||||
parseDate(this->dateString, this->date);
|
parseDate(this->dateString, this->date);
|
||||||
}
|
}
|
||||||
|
|
@ -206,11 +197,14 @@ void Widget::render() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::resetCamera() {
|
void Widget::resetCamera() {
|
||||||
this->cameraPos = Point3::init(50.0f, -50.0f, -75.0f); // Camera for partially trimmed data set
|
this->cameraPos = Point3::init(69.5f, -19.5f, 59.5f); // Camera for partially trimmed data set
|
||||||
// this->cameraPos = Point3::init(300.0f, 200.0f, -700.0f); // Camera for full data set
|
this->pitch = -19.5;
|
||||||
|
this->yaw = -4.825;
|
||||||
Vec3 h_center = Vec3::init((float)VOLUME_WIDTH/2.0f, (float)VOLUME_HEIGHT/2.0f, (float)VOLUME_DEPTH/2.0f);
|
this->roll = -0.0;
|
||||||
this->cameraDir = (h_center - this->cameraPos).normalize();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ void getSpeed(std::vector<float>& speedData, int idx = 0) {
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
std::vector<float> data;
|
std::vector<float> data;
|
||||||
getTemperature(data, 7); // 20121028
|
getTemperature(data, 254); // 20121028
|
||||||
// getSpeed(data, 294);
|
// getSpeed(data, 294);
|
||||||
|
|
||||||
std::cout << "DATA size: " << data.size() << std::endl;
|
std::cout << "DATA size: " << data.size() << std::endl;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue