You divide by Z - or in the case of modern graphics you divide by W. This is the perspective projection.

Before matrices were widely used this was the formula used for dividing by Z.

Screen.x=(View.x*Dist_To_Plane)/(View.z+CenterScreen.x);
Screen.y=(View.y*Dist_To_Plane)/(View.z+CenterScreen.y);

But with matrices this can be done quite easily and it can also then be added into the graphics pipeline that already uses matrices quite heavily. The advantage is you don't have to change your projection function significantly to perspective project your vertices into screen space.

You really need to buy a book on the mathematics of 3D graphics in order to understand how it all works.

Translation is really just this:

x+=distance_x;
y+=distance_y;
z+=distance_z;

But because of the way we multiply or concatenate matrices a 4x4 homogneous matrix works very well for this:

[1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[distance_x,distance_y,distance_z,1]

A simple concatenation function (and not by any means the fastest) for a 4x4 matrix. Matrix is assumed to be a 4x4 array - again not the best way.


Code:
void MatMultiply(float mat1[4][4],float mat2[4][4],float result[4][4])
{
  for (int i=0;i<4;i++)
  {
	for (int j=0;j<4;j++)
	{
	  result[i][j]=0.0f;
	  for (int k=0;k<4;k++)
	  {
		result[i][j]+=mat1[i][k]*mat2[k][j];
	  }
	}
  }
}

And a simple world transform function.

Code:
void WorldTransform(vertex *vtxs,int numvtxs,float wm[4][4])
{
  for (int i=0;i<numvtxs;i++)
  {
	float lx=vtxs[i].model.x;
	float ly=vtxs[i].model.y;
	float lz=vtsx[i].model.z;
 
	float wx,wy,wz=0.0f;
 
	wx=lx*wm[0][0]+ly*wm[1][0]+lz*wm[2][0]+wm[3][0];
	wy=ly*wm[0][1]+ly*wm[1][1]+lz*wm[2][1]+wm[3][1];
	wz=lz*wm[0][2]+ly*wm[1][2]+lz*wm[2][2]+wm[3][2];
	vtxs[i].world.x=wx;
	vtxs[i].world.y=wy;
	vtxs[i].world.z=wz;
   }
}
But thankfully in DirectX you don't need to worry about all of this because it is done for you. No more tracking of model, world, view, and screen vertexes/coordinates. But the above code is from a software 3D engine I wrote quite some time ago.