I read that TikZ, PSTricks and MetaPost are 2D vector graphics packages while Asymptote is considered 3D. However I also know that you can specify 3D coordinates in say TikZ so that drawing a 3D diagram in TikZ is not merely drawing its projection onto 2D. Given these considerations, what really is meant by 2D or 3D graphics and what is the difference between them?
|
TikZ is not really a 3D package. It provides a third dimension but in the plane of the other two. You can give drawings some perspective to make it look like they're 3D, but that's really up to the user. I wouldn't call something truly 3D unless I can change the viewing point in one place and have the diagram render from that point of view automatically. Here's a problem: take four points in three-space and draw the tetrahedron that they define. How would you do that in TikZ? It's easy to connect the four vertices, but depending on the viewer's perspective, some vertices and/or edges are going to be hidden by other ones. So they should be rendered differently or not at all. How do you determine which parts are hidden? In this example it's probably just a linear algebra problem based on the vertices and the perspective. But if you add something to the diagram you might occlude stuff you've already drawn. So a systematic 3D rendering can't be done until the whole diagram is defined. There are programs like Sketch 3D which allow you to define the figures, makes the calculations and outputs TikZ code. But it doesn't come built into TikZ. Edit: Herbert notified me of the |
|||||||
|
|
pst-solides3d can handle hidden lines and surfaces. |
|||||
|