summaryrefslogtreecommitdiff
path: root/client2.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-03-17 01:02:46 +0100
committerFlorian Jung <flo@windfisch.org>2015-03-17 01:02:46 +0100
commit19c9b57b5787371c2e645e523478ed5c0acd3f77 (patch)
tree3d961b0d5b31525764f3381e9238927404a42304 /client2.cpp
parentd46f908b372f58de307ab19c267f31dcced65416 (diff)
follow
Diffstat (limited to 'client2.cpp')
-rw-r--r--client2.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/client2.cpp b/client2.cpp
index 6593db2..fc6d741 100644
--- a/client2.cpp
+++ b/client2.cpp
@@ -588,6 +588,7 @@ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
ModuloRingbuffer ringbuf_phi(RINGBUF_SIZE, -180,180);
ModuloRingbuffer ringbuf_psi(RINGBUF_SIZE, -180,180);
ModuloRingbuffer ringbuf_psi2(40, -180,180);
+ ModuloRingbuffer ringbuf_theta2(40, -180,180);
ModuloRingbuffer ringbuf_theta(RINGBUF_SIZE, -180,180);
@@ -661,6 +662,7 @@ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
ringbuf_phi.put(navdata.phi);
ringbuf_psi.put(navdata.psi);
ringbuf_psi2.put(navdata.psi);
+ ringbuf_theta2.put(navdata.theta);
ringbuf_theta.put(navdata.theta);
double xdiff = fixup_range( ringbuf_x.get() - px_per_deg*ringbuf_psi.get(), -virtual_canvas_width/2, virtual_canvas_width/2);
@@ -671,8 +673,8 @@ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//if (fabs(ydiff) < px_per_deg) ydiff = 0.0;
//if (fabs(adiff) < 2) adiff = 0.0;
- xdiff*=0.5;
- ydiff*=0.5;
+ xdiff*=0.02;
+ ydiff*=0.02;
adiff*=0.5;
total_x = fixup_range(total_x - xdiff, -virtual_canvas_width/2, virtual_canvas_width/2);
total_y = total_y - ydiff;
@@ -725,8 +727,10 @@ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glUseProgram(drawFromCanvasProgram);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, canvasTex);
- glUniform1f(uniEyeYaw,3.1415+(float)total_x/virtual_canvas_width*2*PI);
- glUniform1f(uniEyePitch,(float)total_y/px_per_deg/180.*PI);
+ glUniform1f(uniEyeYaw,3.1415+ringbuf_psi2.get()/180.*PI);
+ glUniform1f(uniEyePitch,-ringbuf_theta2.get()/180.*PI);
+ //glUniform1f(uniEyeYaw,3.1415+(float)total_x/virtual_canvas_width*2*PI);
+ //glUniform1f(uniEyePitch,(float)total_y/px_per_deg/180.*PI);
glUniform1f(uniEyeRoll,0);
glDrawArrays(GL_TRIANGLES, 0, 6);