A three-dimensional shaping apparatus comprising: an electron gun that generates an electron beam; at least one first deflector that deflects the electron beam one-dimensionally or two-dimensionally; at least one lens that is provided between said electron gun and said first deflector, and focuses the electron beam; a second deflector that is provided between said electron gun and said first deflector, and deflects the electron beam one-dimensionally or two-dimensionally; and a controller (304, 305, 307) that controls the deflection directions and scanning speeds determined by said first deflector and said second deflector, wherein said controller (304, 305 307) controls the direction of the deflection of the electron beam by said second deflector so that the direction of the deflection of the electron beam by said second deflector is different from the direction of the deflection of the electron beam by said first deflector; wherein said controller (304, 305, 307) is adapted to operate said first deflector when the electron beam scans a region where powder is melted; wherein said controller (304, 305, 307) is adapted to operate said first deflector and said second deflector when the electron beam scans a region where the powder is not melted; wherein said controller (304, 305, 307) is adapted to control the scanning speeds determined by said first deflector and said second deflector so that the scanning speed determined by said second deflector is higher than the scanning speed determined by said first deflector; and wherein said apparatus is adapted such that, while the first deflector operates, heat given by the electron beam to the metal powder is diffused when the electron beam scans a region where the powder is not melted, the heat being diffused over the shaping surface by operation of said second deflector, so as to prevent unintended melting of the powder in the region where the powder is not melted. an electron gun that generates an electron beam; at least one first deflector that deflects the electron beam one-dimensionally or two-dimensionally; at least one lens that is provided between said electron gun and said first deflector, and focuses the electron beam; a second deflector that is provided between said electron gun and said first deflector, and deflects the electron beam one-dimensionally or two-dimensionally; and a controller (304, 305, 307) that controls the deflection directions and scanning speeds determined by said first deflector and said second deflector, wherein said controller (304, 305 307) controls the direction of the deflection of the electron beam by said second deflector so that the direction of the deflection of the electron beam by said second deflector is different from the direction of the deflection of the electron beam by said first deflector; wherein said controller (304, 305, 307) is adapted to operate said first deflector when the electron beam scans a region where powder is melted; wherein said controller (304, 305, 307) is adapted to operate said first deflector and said second deflector when the electron beam scans a region where the powder is not melted; wherein said controller (304, 305, 307) is adapted to control the scanning speeds determined by said first deflector and said second deflector so that the scanning speed determined by said second deflector is higher than the scanning speed determined by said first deflector; and wherein said apparatus is adapted such that, while the first deflector operates, heat given by the electron beam to the metal powder is diffused when the electron beam scans a region where the powder is not melted, the heat being diffused over the shaping surface by operation of said second deflector, so as to prevent unintended melting of the powder in the region where the powder is not melted.