예제 #1
0
   void OSGDebugDrawInterface::AddAxes(const dtEntity::Matrix& m, const dtEntity::Vec4f& color, 
      float size, float duration, bool depthTestEnabled)
   {
      float arroww = 0.1f;
      osg::Vec3 p0(0, 0, 0);
      osg::Vec3 p1(0, 0, 1);
      osg::Vec3 p2(0, 1, 0);
      osg::Vec3 p3(1, 0, 0);

      osg::Vec3 p1a(arroww, 0, 1 - arroww);
      osg::Vec3 p1b(-arroww, 0, 1 - arroww);

      osg::Vec3 p2a(arroww, 1 - arroww, 0);
      osg::Vec3 p2b(-arroww, 1 - arroww, 0);

      osg::Vec3 p3a(1 - arroww, 0, arroww);
      osg::Vec3 p3b(1 - arroww, 0, -arroww);

      std::vector<osg::Vec3> lines(18);
      lines[0] = m * p0; lines[1] = m * p1;
      lines[2] = m * p0; lines[3] = m * p2;
      lines[4] = m * p0; lines[5] = m * p3;

      lines[6] = m * p1; lines[7] = m * p1a;
      lines[8] = m * p1; lines[9] = m * p1b;

      lines[10] = m * p2; lines[11] = m * p2a;
      lines[12] = m * p2; lines[13] = m * p2b;

      lines[14] = m * p3; lines[15] = m * p3a;
      lines[16] = m * p3; lines[17] = m * p3b;

      AddLines(lines, color, size, duration, depthTestEnabled);
   }
int main(void)
{
	p3a();
	p3b();
	p3c();
	return 0;
}
예제 #3
0
파일: main.c 프로젝트: gabrielarpino/C-Labs
int main( int argc, char *argv[] )
{
    if( argc < 2 )
    {
        printf("Expecting at least one argument. Please try again\n");
    }
    else if(argc==2)
    {
        if(atoi(argv[1])==3)
        {
            printf("Expecting two arguments for this part. Please try again.\n");
        }
        else
        {
            if(atoi(argv[1])==1)
            {
                p1();
            }
            else if(atoi(argv[1])==2)
            {
                p2();
            }
            else
            {
                printf("Incorrect argument supplied.\n");
            }
        }
    }
    else if(argc==3)
    {
        if(atoi(argv[1])!=3)
        {
            printf("Expecting two arguments only for Part 3. Please try again.\n");
        }
        else
        {
            if(atoi(argv[2])==1)
            {
                p3a();
            }
            else if(atoi(argv[2])==2)
            {
                p3b();
            }
        }
    }
    else
    {
        printf("The argument supplied is %s\n", argv[1]);
    }
}