Figure 35
This size 5 control point dominates the object that we are trying to model
Figure 36
These size 3 control points were found to be the most visible, even near the back of the grid but were also the least dominating and didn’t occupy much of what they were modelling.
6.3.2 Eye Point
Recall that in section <6.2.4 3D to 2D mapping equations> we were required to specify the eye point. Now, while points Ex and Ez are given by the vanishing point of the camera the value Ey needed to be specified by us. We chose 1000 to be the value of Ey. If we used a number significantly less than this value then “fish bowl” distortion was evident, this is where the edges of the image appear to be far to close and the image produced is unrealistic. If values of Ey are significantly larger than 1000 then the image appears to as an isometric projection with no foreshortening. The results are shown below.
Figure 37
Above uses a Ey = 100, we see that the corner closest to us is distorted and doesn’t look at all like a right angle. This distortion is very undesirable as realistic representations of actual blocks are impossible to achieve.
Figure 38
This is the same prism, albeit in a different orientation, but with Ey = 1000. The difference between the two prisms is significant. In the Ey=1000 prism we see no distortion but some foreshortening in the depth (y) axis, into the page as drawn here, is evident, compare with the prism below, with Ey=10000.
Figure 39
At such a large distance away from the prism, 10000 pixels away from a side 100 RP, depth of the RP is particularly hard to capture, it is not even possible to see what is what with Ey=10000, from this we conclude that the constant Ey = 1000 is the most realistic, and hard wired this value into the code.
6.4 Final Specification
There was only one change to the original specification, and that was the inclusion of more prism colours. The original specification required only two, but through experimentation this needed to be modified to convey more meaning about the actions of the system based on the mouse position and also the button being down or not.
6.5 Documentation
Figure 40
This is an overall vi that is used to calculate information about both the 3D RP and the 2D RP, as well as any control points for the 2D RP
Inputs
|
Type
|
Description
|
Rotation
|
Double
|
The angle to rotate the input 3D prism by, in degrees, with clockwise being positive rotation
|
Scaling
|
Cluster of 3 doubles
|
The scaling vector which is used to scale the input 3D prism.
|
Translation
|
Cluster of 3 doubles
|
The translation vector to translate the input 3D prism, this should not translate the 3D prism in the z direction
|
3D Rectangular Prism in
|
Cluster of 8 3D points, each 3D point is a cluster of 3 doubles
|
The 3D prism we wish to scale, rotate, and translate, and map to a 2D prism
|
3D vanishing point
|
Cluster of 3 doubles
|
The Eye point described in 6.2.4, this is used to map the 3D prism to 2D
|
Screen Position (0)
|
Double
|
Defaults to zero, or should be hard wired to zero, this is the Sy variable talked about in 6.2.4, it changes the appearance of the 2D prism
|
Outputs
|
Type
|
Description
|
Control Points
|
Cluster of 5 2D points, each 2D points is a cluster of 2 integers
|
These are the locations of the centres of the control points for the input 3D prism after it has been mapped to 2D
|
2D Rectangular Prism
|
Cluster of 8 2D points each 2D point is a cluster of 2 integers
|
The 2D coordinates for the input 3D prism after it has been scaled rotated and translated and finally mapped to 2D
|
Rectangular prism
|
Cluster of 8 3D points each 3D point is a cluster of 3 doubles
|
The input 3D rectangular prism after scaling, rotation and translation factors have been applied
|
Figure 41
This vi is used to calibrate the 3D rectangular prism as described in section 6.2.9. It relies on a few coordinate system changes. Firstly in LabVIEW the coordinate system that in built picture controls is shown below left, the coordinate system we wish to use is shown below right. It is simple to change between the two coordinate systems though, but doing so requires the presence an additional input, the Y picture Height, this vi assumes that the Workspace is defined using LabVIEWs picture coordinate scheme.
x y
y x
Inputs
|
Type
|
Description
|
Workspace
|
Cluster of 4 2D points, each 2D points is a cluster of 2 integers
|
This comes from the calibration section, it defines the grid corners
|
Screen position
|
double
|
Should be hard wired to zero, unless some other value is desired. This is the Sy variable talked about in 6.2.4, it changes the appearance of the 2D prism, and can cause incorrect prism calibration if all screen positions are not the same
|
View Point
|
Cluster of 3 doubles
|
The Eye point described in 6.2.4, this is used to map the 3D prism to 2D
|
Y picture Height
|
integer
|
The number of pixels in the y (vertical) direction of the picture that is used to display the 2D RP image. This value is used to change coordinate of the workspace from labVIEW Cartesian coordinates to out our Cartesian coordinates.
|
Outputs
|
Type
|
Description
|
3D Rectangular Prism Output
|
Cluster of 8 3D points each 3D point is a cluster of 3 doubles
|
This is the calibrated 3D rectangular prism, calibrated based on the discussion in 6.2.4.
|
Share with your friends: |