00001 00002
00003 namespace eval camera {
00004
00005 proc drawCameraPinholeFOV { camera {depth 2} } {
00006 00007 00008
00009 set x [expr $depth * tan([$camera getApertureU]/2)]
00010 set y [expr $depth * tan([$camera getApertureV]/2)]
00011 set z $depth
00012
00013 00014 polyline 2 0 0 0 -$x -$y $z
00015 00016 polyline 2 0 0 0 $x -$y $z
00017 00018 polyline 2 0 0 0 $x $y $z
00019 00020 polyline 2 0 0 0 -$x $y $z
00021 00022 polyline 2 -$x $y $z $x $y $z
00023 00024 polyline 2 -$x -$y $z $x -$y $z
00025 00026 polyline 2 -$x -$y $z -$x $y $z
00027 00028 polyline 2 $x -$y $z $x $y $z
00029 }00030
00031 proc drawCameraBarretoFOV { camera {depth 2.0} {nbSlices 10} } {
00032 set gdheCmds [camera::gdheCameraBarretoFOV $camera $depth $nbSlices]
00033 foreach cmd $gdheCmds {
00034 eval $cmd
00035 }
00036 }00037
00038 }00039
00040 package provide camera 0.1