Change reorient to support future camera controls
This commit is contained in:
parent
53a10a8b43
commit
f7ac3c397a
2 changed files with 2 additions and 4 deletions
|
@ -50,9 +50,6 @@ void OPGLWidget::paintGL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPGLWidget::reorient() {
|
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]};
|
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);
|
float s_mag = pow(pow(s[0], 2) + pow(s[1], 2) + pow(s[2], 2), 0.5);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ protected:
|
||||||
void reorient();
|
void reorient();
|
||||||
|
|
||||||
int mtl_idx = -1;
|
int mtl_idx = -1;
|
||||||
float loc[3] = {10, 0, 10};
|
float loc[3] = {0, 0, 10};
|
||||||
|
float f[3] = {0, 0, -1};
|
||||||
ObjectLoader obj;
|
ObjectLoader obj;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue