# HalfLine to draw lines "to infinity"

I'd like to draw a simple figure illustrating geometric perspective (so-called "central-point perspective") in which perspective lines on two cubes are extended "to infinity," where they meet.

Here is my first attempt:

Graphics3D[
{
Translate[Cuboid[], {-3/2, 0, 0}],
Translate[Cuboid[], {1/2, 0, 0}],
Red, Thickness[0.02],
Line[{{-1/2, 0, 1}, {-1/2, 20, 1}}],
Line[{{-1/2, 0, 0}, {-1/2, 20, 0}}],
Line[{{1/2, 0, 1}, {1/2, 20, 1}}],
Line[{{1/2, 0, 0}, {1/2, 20, 0}}]},
Boxed -> False,
ViewPoint -> {0, -.9, .05},
PlotRegion -> {{0, 2}, {0, 50}, {0, 2}},
ViewAngle -> 20 \[Degree]] As you can see the red lines (by design) only extend a finite distance back. (I even had difficulty drawing them longer and re-setting the PlotRange.)

I'd like to draw HalfLine which, in theory, should extend to infinity, where all four red lines meet at the vanishing point.

Alas, I can't seem to make that work.

I think you would like something like this:

Graphics3D[{Translate[Cuboid[],{-3/2,0,0}],Translate[Cuboid[],
{1/2,0,0}],Red,Thickness[0.02],
HalfLine[{{-1/2,0,1},{-1/2,20,1}}],
HalfLine[{{-1/2,0,0},{-1/2,20,0}}],
HalfLine[{{1/2,0,1},{1/2,20,1}}],
HalfLine[{{1/2,0,0},{1/2,20,0}}]},Boxed->False,ViewVector->{{0,-5,1+1/2},
{0,-1,0.5}},ViewAngle->40Degree,PlotRange->{{-150,150},{-150,150},{-150,150}}]


giving: Note the use of ViewVector which is in coordinates of the plot, rather than using ViewPoint which is in non-dimensional units based on the dimensions of the plot. Furthermore, note that PlotRegion is changed to PlotRange.

• Thanks so much. Precisely what I needed here, and will use in many other figures. ($\checkmark$) Sep 30 '19 at 17:18