Frustum
Demo code is here
- In canvas.js there is the Frustum function.
- This is just an implementation of glFrustum
- I always have problems getting this adjusted as I want it.
- So I continued to build my simple interface.
- BTW, I seem to have a visible surface problem too.
- The view starts at
- Look at (0,0,0)
- Eye at (0,1.3, -3.6)
- Near = 1.8
- Far is 20, this really doesn't matter as long as it is "far" enough.
- Left and right are +/- 3
- Top is 3, bottom is -1
- I added member functions to the canvas to change many of these values.
- I added choices to the menu to change many of these as well.
- Anything you need clarified here?
Field Of View
- A second way to specify the frustum is the fov command.
- This takes an angle between the top and the bottom of the screen
- (stolen image)
- The second argument is the aspect ratio between width and height
- 1 means width = height.
- less than 1 means width > height.
- Greater than means the other way.
- The third and fourth arguments are the near and far plane.
- This is really just another way to specify a frustum.
- And there is a function in MV.js
- By the way, the two matrices are slightly different
- Frustum is the generic case where you don't have to be symmetric
- left ≠ -right
- top ≠ -bottom
- For FOV these hold, as you only specify angles.
- So look at the two derived matrices on 255 and 256 if you really care about this.