はじめまして、ofVboとゆう組み込み式の関数を使って、クラスを制作しているのですが
ofVboには定数値であるofVec3fの配列が必要となっています。
以下のコードを見ていただけるとわかると思います
C++
1//ヘッダ 2 class VboSphere{ 3 public: 4 ofVbo SphereVbo; 5 static const int xverts = 74; 6 static const int yverts = 74; 7 static const int Num = (xverts)*(yverts)+xverts; 8 ofVec3f spvert[Num]; 9 ofFloatColor spcol[Num]; 10 int SpCount = 2296; 11 }; 12 VboSphere *_vbsp; 13 void SetSphere(int xvert,int yvert,float radius);
C++
1void SZ::SetSphere(int xv, int yv, float r) { 2 3 _vbsp = new VboSphere; 4 5... 6 _vbsp->SphereVbo.setVertexData(_vbsp->spvert, _vbsp->Num, GL_DYNAMIC_DRAW); 7 _vbsp->SphereVbo.setColorData(_vbsp->spcol, _vbsp->Num, GL_DYNAMIC_DRAW); 8}
ヘッダファイルで
C++
1static const int xverts = 74; 2 static const int yverts = 74; 3 static const int Num = (xverts)*(yverts)+xverts;
としている箇所がありますが、これらの値(xverts、yverts)をSetSphere関数の引数である,xv,yvに置き換えたいのです
しかし、これらは静的な変数ですので、書き換えが不可能です、、いったいどうすれば書き得られるような実装にできるのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/24 11:39
2016/10/24 12:57