view UI code/6Dbox.h @ 25:8eb530e0601b

textured hand moves correctly to 6 midi params.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 28 Oct 2014 15:19:22 +0000
parents b339acf124df
children 8d7ae43b2edd
line wrap: on
line source
//
//  6Dbox.h
//  riftathon
//
//  Created by Robert Tubb on 27/10/2014.
//
//

#ifndef __riftathon___Dbox__
#define __riftathon___Dbox__
#include "3DboxGL.h"
#include <iostream>

class Leap6DBox : public Leap3DBoxGL {
    
public:
    Leap6DBox(float ax,
                float ay,
                float awidth,
                float aheight,
                float azx,
                float azy,
                const UIProps& props);

    
    void drawIndicatorBlob(float x, float y, float z, ofColor c);
    void draw6DOFIndicatorBlob(float x, float y, float z, ofColor c, float r, float p, float yaw);
    void setTexture(ofImage* img);
    void setValue(int index, int value);
    void setValueAndScale(int index, int value);
private:
    float hw, hh, hl, scale;
    float minAngVal, maxAngVal;
    void setUpHandMesh();
    void setUpThumb(ofPoint baseTR, ofPoint baseBR);
    void makeTexFace(ofPoint LT, ofPoint RT, ofPoint  RB, ofPoint LB);
    float rollVal, pitchVal, yawVal;
    
    ofMesh handMesh;
    ofImage* texImg;
    ofImage defaultImage;
};


#endif /* defined(__riftathon___Dbox__) */