1)The link that previously sent is not a having a complete code - it is only a partial example. Of course, you can simulate a 3D network topology under ns-3 using
‘GaussMarkovMobilityModel’ and ‘RandomBoxPositionAllocator'.
2) but even if you can simulate a 3D network topology, you can visualize your 3D network only on a 2D canvas of NetAnimator since NetAnimator only can support 2D simulations. If you wish to visualize your network in 3D, then you should use another extension+tool called NetSimulyzer. NetSimulyzer is a freely available software.
For using NetSimulyzer, you will need two things
a) the NetSimulyzer ns-3 extension
For installing this extension you may use the procedure provided in the official page of NetSimulyzer
https://github.com/usnistgov/NetSimulyzer-ns3-moduleOr may use the following one
b) the NetSimulyzer 3D visualization tool (just like NetAnimator)
For installing this 3D visualization tool you may use the procedure provided in the official page of NetSimulyzer
https://github.com/usnistgov/NetSimulyzerOr may use the following one
In fact, you can use NetAnim as well as Netsimulyzer to visualize your 3D network scenario.
But if you visualyze your 3D network using NetAnim, then it will just project it in its 2D canvas as follows:.

But, it is possible to visualize the same using NetSimulyzer. In that case you will see the actual 3D output of your simulation like below :

But for that, you have to learn and do lot of things.
But, for a scholarly research simulation, 3D visualization is not at all necessary because in such cases you will only need analyze the trace outputs of the simulation (the visualization will not be a important thing).
So if 2D outputs are sufficient, then using NetSimulyzer is not at all necessary. As Gabriel mentioned, you can also use pyviz also to visualize your network.
Charles Pandian,