diff --git a/interface/src/Hand.cpp b/interface/src/Hand.cpp index f7076aae64..4c6e293fc8 100644 --- a/interface/src/Hand.cpp +++ b/interface/src/Hand.cpp @@ -24,6 +24,7 @@ Hand::Hand(glm::vec3 initcolor) scale.x = 0.07; scale.y = scale.x * 5.0; scale.z = scale.y * 1.0; + renderPointer = true; } void Hand::reset() @@ -41,6 +42,7 @@ void Hand::reset() void Hand::render() { + const float POINTER_LENGTH = 10.0; glPushMatrix(); glTranslatef(position.x, position.y, position.z); glRotatef(yaw, 0, 1, 0); @@ -50,6 +52,15 @@ void Hand::render() glScalef(scale.x, scale.y, scale.z); //glutSolidSphere(1.5, 20, 20); glutSolidCube(1.0); + if (renderPointer) { + glBegin(GL_TRIANGLES); + glColor3f(1,0,0); + glNormal3f(0,-1,0); + glVertex3f(-0.4,0,0); + glVertex3f(0.4,0,0); + glVertex3f(0,0,-POINTER_LENGTH); + glEnd(); + } glPopMatrix(); } diff --git a/interface/src/Hand.h b/interface/src/Hand.h index aa64bc1620..7019cdea22 100644 --- a/interface/src/Hand.h +++ b/interface/src/Hand.h @@ -30,6 +30,7 @@ public: void setTarget(glm::vec3 t) { target = t; }; void processTransmitterData(char * packetData, int numBytes); float getTransmitterHz() { return transmitterHz; }; + void setRenderPointer(bool p) { renderPointer = p; }; private: glm::vec3 position, target, velocity, color, scale; float pitch, yaw, roll, pitchRate, yawRate, rollRate; @@ -37,6 +38,7 @@ private: timeval transmitterTimer; float transmitterHz; int transmitterPackets; + bool renderPointer; }; diff --git a/interface/src/main.cpp b/interface/src/main.cpp index e189b5c715..099a26ee33 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -98,10 +98,10 @@ ParticleSystem balls(0, false, // Wrap? 0.02, // Noise 0.3, // Size scale - 0.0 // Gravity + 0.0 // Gravity ); -Cloud cloud(0, // Particles +Cloud cloud(20000, // Particles box, // Bounding Box false // Wrap ); @@ -540,8 +540,9 @@ void display(void) glEnable (GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LINE_SMOOTH); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); + glPushMatrix(); glLoadIdentity(); @@ -569,6 +570,7 @@ void display(void) glColor3f(1,0,0); glutSolidSphere(0.25, 15, 15); + // Draw cloud of dots glDisable( GL_POINT_SPRITE_ARB ); glDisable( GL_TEXTURE_2D ); @@ -614,7 +616,8 @@ void display(void) //glm::vec3 test(0.5, 0.5, 0.5); //render_vector(&test); - + + glPopMatrix(); // Render 2D overlay: I/O level bar graphs and text @@ -683,6 +686,7 @@ void display(void) glPopMatrix(); + glutSwapBuffers(); framecount++; }