Please see my answer in this thread, which includes a snippet of source for drawing 3D scatterplots in R via rgl: A: R package used for PCA plotting in a paper (rice RNA-Seq)
As noted in comments, viewing a 3D structure on a 2D surface - like a screen or a piece of paper - can be problematic, in that it is not easy to communicate point depth. It can be easy to misinterpret a figure that shows point clusters, which end up being illusions once the plot is seen from a different angle of rotation.
My answer discusses one way to deal with this problem, namely to make a set of figures rotated at, say, 5 or 10 degree increments, stitched into an animation that shows how points actually disperse.
To reduce the amount of work in making GIF animations, I created a web application called Cubemaker that allows more flexible interaction than the static view that rgl offers. This tool was made originally to share interactive views of PCA and PCoA datasets, but it will import any three-dimensional dataset, along with optional metadata.
More information about Cubemaker is available here and here in this slide deck
Cubemaker will let you make color and other metadata changes, reorient the cube, animate its rotation, and share changes and view settings via a persistent web link that can be emailed, posted in a blog, or embedded in a presentation. It is useful for exploring PCA or PCoA results, and if things look genuinely interesting, then more time can be spent on programming rgl to make a publication-quality figure.
I am still confused about why you would do a 3D plot of a PCA, but in any case this has been asked before: R package used for PCA plotting in a paper (rice RNA-Seq)
Mmmhh... Why are you confused? Conceptually plotting 3 components is the same as plotting 2 (or 1). I guess most PCA plots show the first 2 components only because A) 2D plots look good on paper and most of the information is anyway in the 1st and 2nd PC B) 3D plots are usually tricky to visualize on 2D devices.