1. A virtual endoscopic image generation device comprising: a memory to execute executable instructions; and a hardware processor to execute the stored instructions, which when executed by the hardware processor cause the hardware processor to perform the following operations: obtain a three-dimensional image of a subject containing a plurality of structures; extract at least one structure from the three-dimensional image; determine a virtual view point position and a virtual direction of line of sight in a body cavity of the subject; store a display attribute defined for each of the plurality of structures, the display attribute defining an opacity that is changed depending on a distance from the virtual view point position; and change the opacity defined in the display attribute of the extracted structure depending on a distance between the virtual view point position and the extracted structure, and generating, from the three-dimensional image, a virtual endoscopic image containing the extracted structure having the display attribute with the changed opacity viewed from the virtual view point position in the direction of line of sight, wherein the opacity is chanced such that the opacity is 0 when the distance is equal to or greater than a first threshold value and equal to or smaller than a second threshold value, and the opacity is 1 when the distance is equal to a third threshold value between the first and the second threshold values.