Windows Multimedia DDK (mddkqh.hlp) (Table of Contents; Topic list)
JOYCALIBRATE
                                                 Contents Index Back
────────────────────────────────────────────────────────────────────────────
JOYCALIBRATE
 
        The JOYCALIBRATE structure contains calibration values for the
        three axes of an absolute position device.
 
        typedef struct joycalibrate_tag {
            UINT wXbase;
            UINT wXdelta;
            UINT wYbase;
            UINT wYdelta;
            UINT wZbase;
            UINT wZdelta;
        } JOYCALIBRATE;
 
Fields
        WORD wXbase
            Specifies a base calibration value for the x axis.
 
        WORD wXdelta
            Specifies a delta calibration value for the x axis.
 
        WORD wYbase
            Specifies a base calibration value for the y axis.
 
        WORD wYdelta
            Specifies a delta calibration value for the y axis.
 
        WORD wZbase
            Specifies a base calibration value for the z axis.
 
        WORD wZdelta
            Specifies a delta calibration value for the z axis.
 
Comments
        Use the base and delta values returned in this structure to
        convert actual device values to the logical value range
        specified by the driver.
 
        The base values represent the lowest logical value that the
        driver returns for a given axis. The delta values are
        multipliers that the driver should use when mapping the value
        returned by the device into the value range established by the
        driver.
 
        The following formula is used to calculate the delta values:
 
        Delta = (LogicalMax-LogicalMin) / (DeviceMax-DeviceMin)
 
        where LogicalMax and LogicalMin represent the maximum and
        minimum logical coordinate values for the axis, as defined by
        the JOYCAPS structure. DeviceMax and DeviceMin represent the
        actual values returned by the device.
 
        The following formula is used to calculate the base values:
 
        Base = DeviceMin * Delta - LogicalMin
 
        where DeviceMin represents the minimum value returned by the
        device, Delta represents the delta value calculated using the
        first formula, and LogicalMin represents the minimum value
        returned by the driver (as defined by the JOYCAPS structure).
 
                                       -♦-