yutarochan / simple-openni

Automatically exported from code.google.com/p/simple-openni
0 stars 0 forks source link

examples use wrong angles (in degrees) for perspective() #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The "user3D" example has:

  perspective(95,
              float(width)/float(height), 
              10,150000);

For an hazardous coincidence, this gives reasonable results, but Processing's 
perspective() method takes the first parameter in radians, not degrees.

Try 96 instead of 95 and you'll see unexpected results.

The 95 is actually being interpreted as 95 modulus 2PI radians, which is 
0.752220432, so you can replace 95 with 0.752220432 and the result will be the 
same, but people will know what the code is doing.

It is approximately 43 degrees by the way.

Original issue reported on code.google.com by matteosi...@gmail.com on 16 Jul 2011 at 5:01

GoogleCodeExporter commented 8 years ago
Thanks for the reminder, i'm used to opengl, so i mixed stuff up.
Will change this,

thanks!

Original comment by m...@paus.ch on 18 Jul 2011 at 12:22