The algorithm for computer simulation of x-ray images of mobile inspection systems is considered. Educational software which implements this algorithm is described. The goal is to develop the software that not only allows to view the final x-ray image but to design complex scene of 3d objects in interactive way and then use it to render the x-ray projection. The parameters required for precise and realistic x-ray image simulation are considered. They are the objects geometry and position, size and position of the detector and radiation source, the beam energy and other characteristics. Next, the algorithm and formulas for projection of 3D object onto detectors pane are given. Then, the algorithm for calculation of pixel color in greyscale is provided. It is based on traditional ray tracing algorithms like z-buffer used in computer graphics. The input data is the scene of complex 3D objects designed with built-in 3D editor in stereolithographic format. The file in stereolithographic format is used both to store the scene geometry and the characteristics of materials associated to its objects. The distance traveled by the beam inside the object is calculated using the ordered list of the mesh nodes of the object. As the basis of this algorithm is the law of attenuation for X-rays the attenuation coefficients stored in database are also used. Finally the picture of example 3D scene with hidden prohibited goods and rendered x-ray image with these goods visible are provided.
Keywords: computer modelling, computer graphics, computeraided drawing, x-ray, ray tracing, cargo control, stereolithography