Advertisement
Guest User

OpenGL project

a guest
Jul 19th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 15.56 KB | None | 0 0
  1. //#include<windows.h>  /** Only for windows */
  2. #include<GL/glut.h>
  3.  
  4. /** Define for animation and some translation of clouds only */
  5. static GLfloat cl1=560,cl2=300, clo1=560,clxp=0,clxm=200;
  6. static GLfloat c4x=600,c4y=560;
  7. static GLfloat c3y=560;
  8. static GLfloat c6x=1100,c6y=480;
  9. static GLfloat c7x=-1000,c7y=560;
  10. static GLfloat c8x=820,c9x=-2800;
  11. /** Define END */
  12.  
  13.  
  14. /** Global Variable defination for trees, clouds, robot and car */
  15. float yll=36,ylu=130,yln=80,yrh=320,ye=328,yre=325,yrf=348,yrnc=295,rlh=492,rrh=708,rla=495,rra=705,wty=45;
  16. float sx=1,sy=1,sz=1,fsx=1,fsy=1,fsz=1,tx=0,ty=0,tz=0;
  17. int tpos=640,ftx=0,fty=0,ftz=0,rxa=0,rya=0,flag=0,vflag=0,fflag=0,vtx=520,allover=0,i=0;
  18. /** Define END */
  19.  
  20.  
  21. void spinDisplay(void) /** This is a function for use only animation purpose of clouds */
  22.  
  23. {
  24.  
  25.     cl1 +=0.2;
  26.     if (cl1 > 800) /** If cloud 1 is out of window(800) then reverse back to previous size */
  27.     {
  28.         cl1=560;
  29.         clxm=200;
  30.     }
  31.  
  32.     clo1+=0.2;     /** This is for cloud 2 */
  33.     if (clo1 > 650)
  34.     clo1=560;
  35.  
  36.     clxp+=.005;
  37.     clxm-=.5;
  38.  
  39.  
  40.  
  41.     c4x+=.2;        /** This is for cloud 4 and it's moving x & y axis*/
  42.     c4y+=.2;
  43.  
  44.     if (c4y > 750)
  45.     {
  46.         c4x=600;
  47.         c4y=560;
  48.     }
  49.  
  50.  
  51.     c3y+=.02;
  52.     if (c3y > 650)
  53.     c3y=560;
  54.  
  55.  
  56.     c6y +=0.1;       /** This is for cloud 6 and it's moving x & y axis*/
  57.     c6x +=0.6;
  58.     if (c6y > 700)
  59.     {
  60.         c6y=480;
  61.         c6x=1100;
  62.     }
  63.  
  64.  
  65.     c7x-=.3;         /** This is for cloud 7 and it's moving x & y axis*/
  66.     c7y+=.1;
  67.  
  68.     if (c7y > 650)
  69.     {
  70.         c7y=560;
  71.         c7x=-1000;
  72.     }
  73.  
  74.     c8x-=.5;
  75.     if(c8x<600)
  76.     {
  77.         c8x=820;
  78.     }
  79.  
  80.     c9x-=.3;
  81.     if(c9x<-2900)
  82.     c9x=-2800;
  83.  
  84.     glutPostRedisplay();  /** glutPostRedisplay() marks the current window as needing to be redisplayed */
  85. }
  86.  
  87.  
  88.  
  89. void tree()   /** Function for creating trees */
  90. {
  91.     //Tree's Base
  92.     glColor3f(0.325,0.208,0.039);
  93.     glScalef(1.5,0.3,0.3);
  94.     glTranslatef(0,-10,0);
  95.     glutSolidSphere(10,20,20); /// (radius, slices(num of subdivision z axis), stacks(num of subdivision))
  96.     glTranslatef(0,10,0);
  97.     glScalef(1/1.5,1/0.3,1/0.3);
  98.     glutSolidCube(12);
  99.  
  100.     //Tree
  101.     glColor3f(0.196, 0.804, 0.196);
  102.     for(int c=0;c<=16;c+=5)
  103.     {
  104.         glTranslatef(c,25,0);   /** (x,y,z) */
  105.         glScalef(1,0.8,1);
  106.         glutSolidSphere(20,20,20);
  107.         glScalef(1,1/0.8,1);
  108.         glTranslatef(-c,-25,0);
  109.     }
  110. }
  111.  
  112. void trans()   /** This anouther transformation function (Only for robot and the car) **/
  113. {
  114.     if (yll<130)
  115.     {
  116.         yll+=1;
  117.         ylu+=1;
  118.         yln+=1;
  119.     }
  120.     else if(yrh>240)
  121.     {
  122.         yrh-=1;
  123.         yre-=1;
  124.         yrf-=1;
  125.         ye-=1;
  126.         yrnc-=1;
  127.     }
  128.     else if(yll<220)
  129.     {
  130.         yll+=1;
  131.     }
  132.     else if(rlh<=560)
  133.     {
  134.         rlh+=1;
  135.         rrh-=1;
  136.         rla+=0.9;
  137.         rra-=0.9;
  138.     }
  139.     else if(rxa<=90)
  140.     {
  141.         rxa+=1;
  142.         tz-=2;
  143.         ty+=1.2;
  144.     }
  145.     else
  146.     {
  147.         flag=1;
  148.         rxa=0;
  149.         sx=1.3;
  150.         sy=0.5;
  151.         sz=1;
  152.     }
  153. }
  154.  
  155. void clouds()   /** function for clouds */
  156. {
  157.     //Sky Clouds
  158.     glColor3ub(196,217,245);
  159.     glTranslatef(0,0,0);
  160.     glScalef(1.6,1,1);
  161.     glutSolidSphere(30,25,25);
  162.     glScalef(1/1.6,1,1);
  163.     glTranslatef(0,0,0);
  164.  
  165.     glTranslatef(0,0,30);
  166.     glScalef(1.6,1,1);
  167.     glutSolidSphere(30,25,25);
  168.     glScalef(1/1.6,1,1);
  169.     glTranslatef(0,0,-30);
  170.  
  171.     glTranslatef(0,0,-40);
  172.     glScalef(1.6,1,1);
  173.     glutSolidSphere(30,25,25);
  174.     glScalef(1/1.6,1,1);
  175.     glTranslatef(0,0,40);
  176.  
  177.     glTranslatef(40,0,0);
  178.     glScalef(1.6,1,1);
  179.     glutSolidSphere(30,25,25);
  180.     glScalef(1/1.6,1,1);
  181.     glTranslatef(-40,0,0);
  182.  
  183.     glTranslatef(-40,0,0);
  184.     glScalef(1.6,1,1);
  185.     glutSolidSphere(30,25,25);
  186.     glScalef(1/1.6,1,1);
  187.     glTranslatef(40,0,0);
  188. }
  189.  
  190.  
  191. void sky()  /** A function for clouds */
  192. {
  193.     glPushMatrix();
  194.     glColor3f(0.275, 0.510, 0.706);
  195.     glBegin(GL_QUADS);
  196.     glColor3ub(30, 144, 255);
  197.     glVertex3i(-2400,0,500);
  198.     glColor3ub(26,59,110);
  199.     glVertex3i(3500,0,500);
  200.     glColor3ub(31,72,134);
  201.     glVertex3i(3600,1200,500);
  202.     glColor3ub(255,255,204);
  203.     glVertex3i(-2400,1200,500);
  204.     glEnd();
  205.     glPopMatrix();
  206. }
  207.  
  208. void road()  /** A function for road between trees */
  209. {
  210.  
  211.     glPushMatrix();
  212.     glColor3f(0.4,0.4,0.4);
  213.     glTranslatef(0,-120,0);
  214.     glBegin(GL_QUADS);
  215.     glVertex3i(-2400,0,300);
  216.     glVertex3i(3500,0,300);
  217.     glVertex3i(3600,100,300);
  218.     glVertex3i(-2400,100,300);
  219.     glEnd();
  220.     glPopMatrix();
  221.  
  222. }
  223.  
  224. void background()
  225. {
  226.  
  227.     //Floor
  228.  
  229.     glPushMatrix();
  230.     glBegin(GL_QUADS);
  231.     glColor3f(0.6,0.4,0.2);
  232.     glVertex3i(-2400,0,0);
  233.     glVertex3i(3600,0,0);
  234.     glVertex3i(3600,0,500);
  235.     glVertex3i(-2400,0,500);
  236.     glEnd();
  237.     glPopMatrix();
  238.  
  239.  
  240.     for(int c=-400;c<=1500;c+=300)
  241.     {
  242.         //Trees on Right Side
  243.         glTranslatef(c,170,0);
  244.         tree();
  245.         glTranslatef(-c,-170,0);
  246.     }
  247.  
  248.     glPushMatrix();
  249.     glTranslatef(clxm,cl1,300);
  250.     clouds();  /** clouds define **/
  251.     glTranslatef(-200,-560,-300);
  252.     glEnd();
  253.     glPopMatrix();
  254.  
  255.  
  256.     glPushMatrix();
  257.     glTranslatef(0,clo1,10);
  258.     clouds();  /** clouds define **/
  259.     glTranslatef(0,-560,-10);
  260.     glEnd();
  261.     glPopMatrix();
  262.  
  263.  
  264.  
  265.     glPushMatrix();
  266.     glTranslatef(1200,560,50);
  267.     clouds();  /** clouds define **/
  268.     glTranslatef(-1200,-560,-50);
  269.     glEnd();
  270.     glPopMatrix();
  271.  
  272.  
  273.  
  274.     glPushMatrix();
  275.     glTranslatef(c4x,c4y,400);
  276.     clouds();  /** clouds define **/
  277.     glTranslatef(-600,-560,-400);
  278.     glEnd();
  279.     glPopMatrix();
  280.  
  281.  
  282.  
  283.     glPushMatrix();
  284.     glTranslatef(550,c3y,50);
  285.     clouds();  /** clouds define **/
  286.     glTranslatef(-550,-560,-50);
  287.     glEnd();
  288.     glPopMatrix();
  289.  
  290.  
  291.  
  292.  
  293.     glPushMatrix();
  294.     glTranslatef(c7x,c7y,500);
  295.     clouds();  /** clouds define **/
  296.     glTranslatef(1000,-560,-500);
  297.     glEnd();
  298.     glPopMatrix();
  299.  
  300.  
  301.  
  302.     glPushMatrix();
  303.     glTranslatef(4000,560,1200);
  304.     clouds();  /** clouds define **/
  305.     glTranslatef(-4000,-560,-1200);
  306.     glEnd();
  307.     glPopMatrix();
  308.  
  309.     glPushMatrix();
  310.     glTranslatef(3750,560,1200);
  311.     clouds();  /** clouds define **/
  312.     glTranslatef(-3750,-560,-1200);
  313.     glEnd();
  314.     glPopMatrix();
  315.  
  316.     glPushMatrix();
  317.     glTranslatef(c6x,c6y,300);
  318.     clouds();  /** clouds define **/
  319.     glTranslatef(-1100,-480,-300);
  320.     glEnd();
  321.     glPopMatrix();
  322.  
  323.  
  324.  
  325.     glPushMatrix();
  326.     glTranslatef(c8x,460,250);
  327.     clouds();  /** clouds define **/
  328.     glTranslatef(-820,-420,-250);
  329.     glEnd();
  330.     glPopMatrix();
  331.  
  332.  
  333.     glPushMatrix();
  334.     glTranslatef(c9x,520,800);
  335.     clouds();  /** clouds define **/
  336.     glTranslatef(2800,-560,-800);
  337.     glEnd();
  338.     glPopMatrix();
  339.  
  340. }
  341.  
  342. void robot()     /** Robot part **/
  343. {
  344.     /** These three lines for rotating after animation **/
  345.     glRotatef(rxa,1,0,0);
  346.     glTranslatef(tx,ty,tz);
  347.     glScalef(sx,sy,sz);
  348.  
  349.     //Robot Head
  350.     glColor3f(0.824, 0.412, 0.118);
  351.     glTranslatef(600,yrh,200);
  352.     glScalef(1.8,1,0.2);
  353.     glutSolidSphere(25,50,50);
  354.     glScalef(1/1.8,1,1/0.2);
  355.     glTranslatef(-600,-yrh,-200);
  356.  
  357.     //Left Ear
  358.     glColor3f(0.2,0.2,0.7);
  359.     glTranslatef(564,ye,200);
  360.     glScalef(0.15,1,0.2);
  361.     glutSolidCube(50);
  362.     glScalef(1/0.15,1,1/0.2);
  363.     glTranslatef(-564,-ye,-200);
  364.  
  365.     //Right Ear
  366.     //glColor3f(0,0,1);
  367.     glTranslatef(636,ye,200);
  368.     glScalef(0.15,1,0.2);
  369.     glutSolidCube(50);
  370.     glScalef(1/0.15,1,1/0.2);
  371.     glTranslatef(-636,-ye,-200);
  372.  
  373.     //Robot Eye
  374.     glColor3f(0.502, 0.000, 0.000);
  375.     glTranslatef(600,yre,200);
  376.     glScalef(1,0.10,0.15);
  377.     glutSolidCube(72);
  378.     glScalef(1,1/0.10,1/0.15);
  379.     glTranslatef(-600,-yre,-200);
  380.  
  381.     //Robot Neck
  382.     glColor3f(0.7,0.7,0.7);
  383.     glTranslatef(600,yrnc,200);
  384.     glScalef(3.5,1,0.1);
  385.     glutSolidCube(15);
  386.     glScalef(1/3.5,1,1/0.1);
  387.     glTranslatef(-600,-yrnc,-200);
  388.  
  389.     //Robot Left Arm
  390.     glColor3f(1,0,0);
  391.     glTranslatef(rla,280,200);
  392.     glScalef(1.2,0.4,0.2);
  393.     glutSolidSphere(25,50,50);
  394.     glScalef(1/1.2,1/0.4,1/0.2);
  395.     glTranslatef(-rla,-280,-200);
  396.  
  397.     //Robot Right Arm
  398.     glColor3f(1,0,0);
  399.     glTranslatef(rra,280,200);
  400.     glScalef(1.2,0.4,0.2);
  401.     glutSolidSphere(25,50,50);
  402.     glScalef(1/1.2,1/0.4,1/0.2);
  403.     glTranslatef(-rra,-280,-200);
  404.  
  405.     //Robot Left Knee
  406.     glColor3f(1.0, 0.0, 1.0);
  407.     glTranslatef(545,yln,200);
  408.     glScalef(1.3,0.5,0.2);
  409.     glutSolidSphere(25,50,50);
  410.     glScalef(1/1.3,1/0.5,1/0.2);
  411.     glTranslatef(-545,-yln,-200);
  412.  
  413.     //Robot Right Knee
  414.     glColor3f(1.0, 0.0, 1.0);
  415.     glTranslatef(650,yln,200);
  416.     glScalef(1.3,0.5,0.2);
  417.     glutSolidSphere(25,50,50);
  418.     glScalef(1/1.3,1/0.5,1/0.2);
  419.     glTranslatef(-650,-yln,-200);
  420.  
  421.     glColor3f(1,0.639,0.102);
  422.     glTranslatef(600,155,200);
  423.     glScalef(1,0.45,0.2);
  424.     glutSolidSphere(60,5,5);
  425.     glScalef(1,1/0.45,1/0.2);
  426.     glTranslatef(-600,-155,-200);
  427.  
  428.     //Robot Body
  429.     glColor3f(0.2,0.2,0.7);
  430.     glTranslatef(600,228,200);
  431.     glScalef(1.3,1,0.6);
  432.     glutSolidCube(120);
  433.     glScalef(1/1.3,1,1/0.6);
  434.     glTranslatef(-600,-228,-200);
  435.  
  436.     //Robot Left Leg Part 1
  437.     //glColor3f(0,0,0.9);
  438.     glTranslatef(550,ylu,200);
  439.     glScalef(0.8,1.2,0.2);
  440.     glutSolidCube(60);
  441.     glScalef(1/0.8,1/1.2,1/0.2);
  442.     glTranslatef(-550,-ylu,-200);
  443.  
  444.     //Robot Right Leg Part 1
  445.     //glColor3f(0,0,0.9);
  446.     glTranslatef(650,ylu,200);
  447.     glScalef(0.8,1.2,0.2);
  448.     glutSolidCube(60);
  449.     glScalef(1/0.8,1/1.2,1/0.2);
  450.     glTranslatef(-650,-ylu,-200);
  451.  
  452.     //Robot Left Leg Part 2
  453.     //glColor3f(0,0,0.9);
  454.     //glColor3f(0.2,0.2,0.7);
  455.     glTranslatef(550,yll,200);
  456.     glScalef(1,1.2,0.2);
  457.     glutSolidCube(60);
  458.     glScalef(1,1/1.2,1/0.2);
  459.     glTranslatef(-550,-yll,-200);
  460.  
  461.     //Robot Right Leg Part 2
  462.     //glColor3f(0,0,0.9);
  463.     glTranslatef(650,yll,200);
  464.     glScalef(1,1.2,0.2);
  465.     glutSolidCube(60);
  466.     glScalef(1,1/1.2,1/0.2);
  467.     glTranslatef(-650,-yll,-200);
  468.  
  469.     //Robot Left Hand
  470.     //glColor3f(0,0,0.9);
  471.     glTranslatef(rlh,220,200);
  472.     glScalef(0.8,1.8,0.2);
  473.     glutSolidCube(60);
  474.     glScalef(1/0.8,1/1.8,1/0.2);
  475.     glTranslatef(-rlh,-220,-200);
  476.  
  477.     //Robot Right Hand
  478.     //glColor3f(0,0,0.9);
  479.     glTranslatef(rrh,220,200);
  480.     glScalef(0.8,1.8,0.2);
  481.     glutSolidCube(60);
  482.     glScalef(1/0.8,1/1.8,1/0.2);
  483.     glTranslatef(-rrh,-220,-200);
  484.  
  485.     glScalef(1/sx,1/sy,1/sz);
  486.     glTranslatef(-tx,-ty,-tz);
  487.     glRotatef(-rxa,1,0,0);
  488. }
  489.  
  490.  
  491. void vehicle()  /** Car Part **/
  492. {
  493.     glTranslatef(ftx,fty,ftz);
  494.     glScalef(fsx,fsy,fsz);
  495.  
  496.     if(vflag==1)
  497.     {
  498.  
  499.         //Vehicle Hood
  500.         glColor3f(1,0.639,0.102);
  501.         glBegin(GL_QUADS);
  502.         glVertex3i(vtx,35,200);
  503.         glVertex3i(vtx+60,35,200);
  504.         glVertex3i(vtx+60,90,200);
  505.         glVertex3i(vtx,58,200);
  506.         glEnd();
  507.  
  508.         //Front Wheel
  509.         glColor3f(0.2,0.2,0.2);
  510.         glTranslatef(540,wty,200);
  511.         glScalef(1.7,1,0.2);
  512.         glutSolidSphere(12.5,50,50);
  513.         glScalef(1/1.7,1,1/0.2);
  514.         glTranslatef(-540,-wty,-200);
  515.  
  516.         //Rear Wheel
  517.         glColor3f(0.2,0.2,0.2);
  518.         glTranslatef(655,wty,200);
  519.         glScalef(1.7,1,0.2);
  520.         glutSolidSphere(12.5,50,50);
  521.         glScalef(1/1.7,1,1/0.2);
  522.         glTranslatef(-655,-wty,-200);
  523.     }
  524.  
  525.     glColor3f(0.2,0.2,0.7);
  526.     glTranslatef(600,60,200);
  527.     glScalef(sx,sy,sz);
  528.     glRotatef(rya,0,1,0);
  529.     glutSolidCube(120);
  530.     glRotatef(-rya,0,1,0);
  531.     glScalef(1/sx,1/sy,1/sz);
  532.     glTranslatef(-600,-60,-200);
  533.  
  534.  
  535.     glScalef(1/fsx,1/fsy,1/fsz);
  536.     glTranslatef(-ftx,-fty,-ftz);
  537. }
  538.  
  539. void calc()  /** A calculation function for calculating the car animation **/
  540. {
  541.     if(rya<=90)
  542.     {
  543.         rya+=1;
  544.         sx+=0.002;
  545.         sz-=0.01;
  546.     }
  547.     else if(fsx<=2.5)
  548.     {
  549.         fsx+=0.05;
  550.         fsy+=0.05;
  551.         fsz+=0.05;
  552.         ftx-=20;
  553.         fty-=10;
  554.     }
  555.     else
  556.     {
  557.         vflag=1;
  558.     }
  559.     if(vflag==1&&vtx>=465)
  560.     {
  561.         vtx-=1;
  562.     }
  563.     else if(vtx<465&&wty>=30)
  564.     {
  565.         wty-=0.5;
  566.     }
  567.     else if(wty<30)
  568.     {
  569.         allover=1;
  570.     }
  571.     if(allover==1)
  572.     {
  573.         if(i<=540)
  574.         {
  575.             ftx-=5;
  576.             i++;
  577.         }
  578.         else if(i>540)
  579.         fflag=1;
  580.     }
  581. }
  582.  
  583. void display()   /** A display function for displaying every objects **/
  584. {
  585.  
  586.     sky();
  587.     background();
  588.     road();
  589.  
  590.     if(flag==0)  /** flag = 0 for robot with animation **/
  591.     {
  592.         trans();
  593.         robot();
  594.     }
  595.     else if(flag==1)  /** flag = 1 for car with animation **/
  596.     {
  597.         calc();
  598.         vehicle();
  599.     }
  600.  
  601.     //Draw Trees alongside the road
  602.     for(int c=-400;c<=1500;c+=300)
  603.     {
  604.         //Trees on Left Side
  605.         glTranslatef(c,110,0);
  606.         tree();
  607.         glTranslatef(-c,-110,0);
  608.     }
  609.     glFlush();
  610.     glutSwapBuffers();
  611. }
  612.  
  613. void changeSize(int w, int h)
  614. {
  615.     if(h == 0)
  616.     h = 1;
  617.     float ratio = 1.0* w / h;
  618.  
  619.     glMatrixMode(GL_PROJECTION);  /** This is used for projectiong when it's scaling and translating **/
  620.     glLoadIdentity();      /** glLoadIdentity replaces the current matrix with the identity matrix **/
  621.     glViewport(0, 0, w, h);  /** (x, y, width, height) **/
  622.     gluPerspective(78,ratio,1,500);  /** (fovy, aspect, znear, zfar) **/
  623.     glMatrixMode(GL_MODELVIEW);
  624. }
  625.  
  626. //void Timer(int value)   /** Declaration of timer function **/
  627. /*{
  628.     if(fflag==0)
  629.     {
  630.         glutTimerFunc(10,Timer,0);
  631.         glutPostRedisplay();
  632.     }
  633.  
  634. }*/
  635.  
  636. void myinit()  /** I have initialized background color and window size**/
  637. {
  638.     glClearColor(1.0,1.0,1.0,1.0);
  639.     glOrtho(0,1200,0,640,0,500);
  640.     //glutTimerFunc(5000,Timer,0);   /** glutTimerFunc registers a timer callback to be triggered in a specified number of milliseconds. **/
  641. }
  642.  
  643.  
  644.  
  645.  
  646.  
  647. int main(int argc,char **argv)
  648. {
  649.     glutInit(&argc,argv);
  650.     glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);  /** This double buffered window. This overrides GLUT_SINGLE if it is also specified. **/
  651.     glutInitWindowPosition(0,0);
  652.     glutInitWindowSize(1200,640);
  653.  
  654.     glutCreateWindow("A Robotic Car by OpenGL");
  655.     glutReshapeFunc(changeSize);
  656.     glutDisplayFunc(display);
  657.     glutIdleFunc(spinDisplay);
  658.     myinit();
  659.     trans();
  660.     glutMainLoop();
  661. }
  662.  
  663.  
  664. /********************************/
  665. /******** Documentation *********/
  666. /********************************/
  667.  
  668. /**
  669.  
  670. --> glutSolidSphere()
  671. radius
  672. The radius of the sphere.
  673. slices
  674. The number of subdivisions around the Z axis (similar to lines of longitude).
  675. stacks
  676. The number of subdivisions along the Z axis (similar to lines of latitude).
  677.  
  678.  
  679. --> glViewPort(x, y, width, height)
  680. glViewPort -- is in screen pixel units: that's it, it has nothing to do with the 3D world
  681. "inside" your graphics card. It just tells wich part of the window will be used for
  682. rendering (or just will be visible).
  683.  
  684. glOrtho -- instead changes the "inner" world and is OpenGL units: More OpenGL units will fit
  685. into the visible part of the screen, so "bigger" objects will fit easily into viewable area
  686. if you increase the ortho size.
  687.  
  688.  
  689. --> gluPerspective(fovy, aspect, zNear, zFar)
  690. fovy -- Specifies the field of view angle, in degrees, in the y direction.
  691.  
  692. aspect -- Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
  693.  
  694. zNear -- Specifies the distance from the viewer to the near clipping plane (always positive).
  695.  
  696. zFar -- Specifies the distance from the viewer to the far clipping plane (always positive).
  697.  
  698. **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement