fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class projmatrix{
  5. public:
  6. float nera = 0.1, fra = 1000, fov = 90, aratio = HEIGHT / (float)WIDTH;
  7. float fovtan = 1 / tanf((fov * 0.5 / 180) * 3.14159);
  8. float m[4][4] = {0};
  9. m[0][0] = aratio * fovtan;
  10. m[1][1] = fovtan;
  11. m[2][2] = fra/(fra-nera);
  12. m[3][2] = (-fra*nera)/(fra-nera);
  13. m[2][3] = 1;
  14. };
  15.  
  16. int main() {
  17. // your code goes here
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:9: error: ‘m’ does not name a type; did you mean ‘tm’?
         m[0][0] = aratio * fovtan;
         ^
         tm
prog.cpp:10:9: error: ‘m’ does not name a type; did you mean ‘tm’?
         m[1][1] = fovtan;
         ^
         tm
prog.cpp:11:9: error: ‘m’ does not name a type; did you mean ‘tm’?
         m[2][2] = fra/(fra-nera);
         ^
         tm
prog.cpp:12:9: error: ‘m’ does not name a type; did you mean ‘tm’?
         m[3][2] = (-fra*nera)/(fra-nera);
         ^
         tm
prog.cpp:13:9: error: ‘m’ does not name a type; did you mean ‘tm’?
         m[2][3] = 1;
         ^
         tm
prog.cpp:6:58: error: ‘HEIGHT’ was not declared in this scope
         float nera = 0.1, fra = 1000, fov = 90, aratio = HEIGHT / (float)WIDTH;
                                                          ^~~~~~
prog.cpp:6:74: error: ‘WIDTH’ was not declared in this scope
         float nera = 0.1, fra = 1000, fov = 90, aratio = HEIGHT / (float)WIDTH;
                                                                          ^~~~~
prog.cpp:7:28: error: ‘tanf’ was not declared in this scope
         float fovtan = 1 / tanf((fov * 0.5 / 180) * 3.14159);
                            ^~~~
prog.cpp:7:28: note: suggested alternative: ‘rand’
         float fovtan = 1 / tanf((fov * 0.5 / 180) * 3.14159);
                            ^~~~
                            rand
stdout
Standard output is empty