From f7ac3c397a58d6e60285b1726adf883ecd689911 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Wed, 3 May 2023 16:28:08 +0500 Subject: [PATCH] Change reorient to support future camera controls --- opglwidget.cpp | 3 --- opglwidget.h | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/opglwidget.cpp b/opglwidget.cpp index 4cf24ee..b7f0211 100644 --- a/opglwidget.cpp +++ b/opglwidget.cpp @@ -50,9 +50,6 @@ void OPGLWidget::paintGL() { } void OPGLWidget::reorient() { - float F_mag = pow(pow(loc[0], 2) + pow(loc[1], 2) +pow(loc[2], 2), 0.5); - GLfloat f[] = {-loc[0]/F_mag, -loc[1] / F_mag, -loc[2] / F_mag}; - GLfloat s[] = {-f[2], 0, f[0]}; float s_mag = pow(pow(s[0], 2) + pow(s[1], 2) + pow(s[2], 2), 0.5); diff --git a/opglwidget.h b/opglwidget.h index 206fa48..e5430a5 100644 --- a/opglwidget.h +++ b/opglwidget.h @@ -12,6 +12,7 @@ protected: void reorient(); int mtl_idx = -1; - float loc[3] = {10, 0, 10}; + float loc[3] = {0, 0, 10}; + float f[3] = {0, 0, -1}; ObjectLoader obj; };