プログラムの書き出しの部分です。
#include <GLUT/glut.h>
#include <stdlib.h>
GLfloat ctrlpoints[4][3] = {
{300,666, 0.0},
{302,694, 0.0},
{300,721, 0.0},
{306,743, 0.0}
};
GLfloat ctrlpoints1[4][3] = {
{306,743, 0.0},
{360,768,0.0},
{432,779, 0.0},
{510,788, 0.0}
};
#include <GLUT/glut.h>
#include <stdlib.h>
int a;
a=100;
GLfloat ctrlpoints[4][3] = {
{300,666, 0.0},
{302+a,694, 0.0},
{300+a,721, 0.0},
{306,743, 0.0}
};
エラーの形としては
initializer element is not a compile-time constant
です。
また、2直線を接続させたまま表示させたい事もあり、例えば
#include <GLUT/glut.h>
#include <stdlib.h>
int a,b,c;
a=306;
b=743;
c=0.0;
GLfloat ctrlpoints[4][3] = {
{300,666, 0.0},
{302,694, 0.0},
{300,721, 0.0},
{a,b, c}
};
GLfloat ctrlpoints1[4][3] = {
{a,b, c},
{360,768,0.0},
{432,779, 0.0},
{510,788, 0.0}
};
どこで変数を定義し、glfloat中で用いれば良いのか教えて頂けると大変助かります。
宜しくお願いします。