How to expand 2D graphic and functions to 3D? So I have a program that enables the user to draw 2D-objects. To rotate them, to move them, and so on, all in 2D.

I want to expand the 2D objects and functions to 3D which I don't expect to be too difficult, but still difficult enough that I don't want to reinvent the wheel.


  What is the process of migrating 2D to 3D algorythms called in
  computer engineering? And of course the follow-up question, if there
  is nothing on the web for that search term: What's it called in
  everyday computer engineering? Are there general concepts how best to
  expand a set of 2D-algorithms and -objects to 3D at all?
In most 3D graphics pipelines (e.g., OpenGL) points and direction vectors are represented with 4D homogeneous points (x, y, z, w) and their respective transformations are stored as 4x4 matrices. We can use the same representations for 2D and treat the z-value as the "stacking order" of our 2D shapes.

For example, for a 2D CW rotation about the origin we can use a 3D rotation about the z-axis:

       _                               _
      | cos(angle)  -sin(angle)  0   0  |
  M = | sin(angle)   cos(angle)  0   0  |
      |    0             0       1   0  |
      |    0             0       0   1  |
       -                               -


So to rotate a 2D point (x,y) about the origin we simply compute

  M * [x, y, 0, 1]^T


With 2D geometry we simply perform a orthographic projection into the rectangular region we wish to view. The pipeline is already designed to sort objects by their z-value for hidden-surface removal so defining a stacking order of 2D objects is trivial with the machinery in place.

Making the jump to 3D is a matter of generalizing the geometry and transformations with the added dimension. All of the usual affine transformations (rotation, scale, translation, shear, ...) generalize in a very simple way.

The biggest new concepts in 3D  is setting up a virtual camera (defined by a simple affine view matrix)  and you now have to project your 3D geometry down to 2D to create an image -- this can be done using parallel or perspective projections. Perspective projections require perspective foreshortening based on distance from the camera -- we can make very clever use of the homogeneous representation and a division by z to pull this off. This is standard material for most introductory graphics textbooks / courses. 

Anyway, there's a start....