Let $X$ be a vector space. Then a set $D \subseteq X$ is called convex if
$$ \forall x,y \in D, \lambda \in [0,1]: (1-\lambda) x + \lambda y \in D ~~.$$
Intuitively this means that for any two points in the set, the line joining them is fully contained in $D$ as well.
I think this intuition works reasonbly well for more exotic spaces than $\mathbb{R}^3$. In any case, working with the definition is what gives the right answers.