Besides its predicted promising high electron mobilities at room temperature, PtSe2 bandgap sensitively depends on the number of monolayers combined by van der Waals interaction according to our calculations. We understand this by using bandstructure calculations based on the density functional theory. It was found that the front orbitals of VBM and CBM are contributed mainly from pz and px+y orbitals of Se which are sensitive to the out-plane and in-plane lattice constants, respectively. The van der Waals force enhances the bonding out-of-plane, which in-turn influences the bonding in-plane. We found that the thickness dependent bandgap has the same origin as the strain dependent bandgap, which is from the change of the front orbital interactions. The work shows the flexibilities of tuning the electronic and optical properties of this compound in a wide range.