Difference between revisions of "C++:3D Exercises"

From Progzoo
Jump to: navigation, search
Line 1: Line 1:
Show the point of intersection where the plane A, B, C meets the line DE.
 
The normal is shown.
 
 
The end points D and E are shown. Also the point of intersection is also marked with a sphere.
 
 
GLfloat A[3] = {1, 0, 0};
 
GLfloat B[3] = {-1, 2, 0};
 
GLfloat C[3] = {0, 1, 3};
 
GLfloat D[3] = {-1,-1,-1};
 
GLfloat E[3] = {1,2,3};
 
 
 
The normal to the plane has also been shown.
 
The normal to the plane has also been shown.
 
<question>
 
<question>
Line 34: Line 23:
 
int main(int argc, char **argv)
 
int main(int argc, char **argv)
 
{
 
{
   float *A = new float[3];
+
   float *A={1,0,1};
  A={1,0,1};
 
 
   cout << A[0]<<" "<<A[1]<<" "<<A[2]<< endl;
 
   cout << A[0]<<" "<<A[1]<<" "<<A[2]<< endl;
 
   return 0;
 
   return 0;

Revision as of 08:17, 23 November 2011

The normal to the plane has also been shown.


[Font] [Default] [Show] [Resize] [History] [Profile]