3D: Fixed bug with 0 values

Testing for a var returns false if x = 0
Changed to test if var is defined