I have the following formulas to sample points uniformly on a unit sphere in 3D space:
$x = \sqrt{1-u^2} sin\phi$
$y = \sqrt{1-u^2} cos\phi$
$z = u$
where $u \in [-1,1]$ and $\phi \in [0,2\pi]$.
Now think of a plane which separates the sphere in the middle, defined by the normal vector $(0,1,0)$. If I want to sample the hemisphere over this plane I simple change the sampling interval of $\phi$ to $[0,\pi]$.
Now consider another plane defined by a normal vector $(x,y,z)$ which again separates my sphere. How can I sample the points in the hemisphere over this plane without simply rejecting the "false" ones?
Thanks
EDIT: I forgot to mention that my first idea was to calculate the points on the hemisphere at the origin over the plane with the normal $(0,1,0)$. Then I could rotate these points with matrices. The angles can be determined by comparing $(0,1,0)$ and the normal of the new plane but this seems a bit overkill...