Camera DOF display [SOLVED!]
Posted: Sun May 01, 2011 6:53 pm
I've been meaning to do this for a while and finally found the time. Unfortunately, now I have the time, it seems I don't have the intelligence
I'd like to have spline rectangles displayed in the OpenGL viewport of the camera that show where the near and far focus points are.
I've used the equations from here http://www.dofmaster.com/equations.html (using a circle of confusion value of 0.019 for my Canon EOS 300D)
I've come across three stumbling blocks;
1. writing equations in Softimage's Equation editor is a nightmare if you can't create variables (which you can't - I did try rewriting the equations as a Scripted Operator but got even more lost!)
2. some of the Maxwell parameters are not accessible to the equation editor. I'm not sure if this a permanent issue but I was trying to use 'MaxwellCameraAttrs.FStop' in the equation editor but I kept getting errors and so had to type the value (5.6) in explicitly
3. I'm not very good at Math The equations seem to work (to a certain extent) but there is definitely something wrong.
H - I have created a green square as the Hyperfocal distance (H) (using the equation from above) and this seems to react well to camera (and interest) movements as well as changes to the focal length and F-Stop. I've had to make the whole equation negative as the camera's z positive value is out of the back of the camera, not the front! Although I'm not sure if this plane should always be at the same distance as the camera's interest??
Dn - I then created a blue square for the Near Distance (Dn), again using the equations (this is where variables would come in handy!) but this seems to move somewhat inversely to how I'd expect it.
Df - The red square is the Far Distance (Df) but this is actually behind the camera! (despite the making the whole equation negative)
And then the whole thing seem to melt down when moving the interest too close to the camera (under the Hyperfocal distance) with the red and blue squares inverting wildly!
Here's a Softimage 2012 scene with what I have so far;
http://www.richardosborn.com/maxwell/be ... 010511.zip
If anyone has the time (or inclination) to check through my math, I'd greatly appreciate it
I'd like to have spline rectangles displayed in the OpenGL viewport of the camera that show where the near and far focus points are.
I've used the equations from here http://www.dofmaster.com/equations.html (using a circle of confusion value of 0.019 for my Canon EOS 300D)
I've come across three stumbling blocks;
1. writing equations in Softimage's Equation editor is a nightmare if you can't create variables (which you can't - I did try rewriting the equations as a Scripted Operator but got even more lost!)
2. some of the Maxwell parameters are not accessible to the equation editor. I'm not sure if this a permanent issue but I was trying to use 'MaxwellCameraAttrs.FStop' in the equation editor but I kept getting errors and so had to type the value (5.6) in explicitly
3. I'm not very good at Math The equations seem to work (to a certain extent) but there is definitely something wrong.
H - I have created a green square as the Hyperfocal distance (H) (using the equation from above) and this seems to react well to camera (and interest) movements as well as changes to the focal length and F-Stop. I've had to make the whole equation negative as the camera's z positive value is out of the back of the camera, not the front! Although I'm not sure if this plane should always be at the same distance as the camera's interest??
Dn - I then created a blue square for the Near Distance (Dn), again using the equations (this is where variables would come in handy!) but this seems to move somewhat inversely to how I'd expect it.
Df - The red square is the Far Distance (Df) but this is actually behind the camera! (despite the making the whole equation negative)
And then the whole thing seem to melt down when moving the interest too close to the camera (under the Hyperfocal distance) with the red and blue squares inverting wildly!
Here's a Softimage 2012 scene with what I have so far;
http://www.richardosborn.com/maxwell/be ... 010511.zip
If anyone has the time (or inclination) to check through my math, I'd greatly appreciate it