I am looking at producing CGI displays of human heads via C++ and OpenGL
I have just started to learn C++ and would like to ask for any guidance that could be given.
//Using laser line triangulation scanning of the human head to obtain
//surface co-ordinates computing through CGI for 3D display (OpenGL)
//Step 1 a program for reading xyz co-ordinate values into an array
//and then further dividing into three coloum array's
//Code::Blocks 8.02 in C++ GNC GCC Compiler
{ {2.9, -105.8, -57.4}, // i 0
{3.0, -104.8, -58.6}, // i 1
{3.1, -103.9, -59.7}, // i 2
{3.1, -103.0, -60.2}, // i 3
{3.1, -102.1, -60.8}, // i 4
};
int i;
int j;
{
// Loop to populate the array matrix
for(i=0; i<5; i++)
for(j=0; j<3; j++)
{
cout<<array[i][j]<<" \n"; //Check array matrix has formed
// It will work up to here then I am lost
}
//ax[5] = array[5][3]; // Make array ax pull off first coloum
{
// for(j=0;j<1;j++);
//j=0;j<3; gives coloums XYZ
//j=0;j<1; gives coloum X rows 0-4 X values
//j=1;j<2; gives coloum Y rows 0-4 Y values
//j=2;j<3; gives coloum Z rows 0-4 Z values
// Matrix of values
// X Y Z
//
//j0 j1 j2
{ {2.9, -105.8, -57.4},// i 0
{3.0, -104.8, -58.6},// i 1
{3.1, -103.9, -59.7},// i 2
{3.1, -103.0, -60.2},// i 3
{3.1, -102.1, -60.8},// i 4
};
int i;
int j;
cout.setf(ios_base::fixed,ios_base::floatfield);//Sets floating point
cout.precision(2); //Resets the number of units after . point
for(i=0;i<5;i++) {
for(j=0;j<1;j++) {
ax[i] = array[i][j]; // Loop through 0-1 and pass values to array ax
}
}
for(i=0;i<5;i++) {
for(j=1;j<2;j++) {
ay[i] = array[i][j]; // Loop through 1-2 and pass values to array ay
}
}
for(i=0;i<5;i++) {
for(j=2;j<3;j++) {
az[i] = array[i][j]; // Loop through 2-3 and pass values to array az
}
}
cout<<"ENTERTIES"<<"\n"<<"3DFACES"<<"\n"; //File format for .DXF
for(i=0;i<5;i++) {
cout<<"10"<<"\n"<<ax[i]<<"\n"<<"20"<<"\n"<<ay[i]<<"\n"<<"30"<<"\n"<<az[i]<<"\n";
}
cout<<"EOF";
return 0;
}
[\code]