= #JxnPortable\docs\gallery\House2D.jxn

#ifndef owner
owner = @java.awt.Frame( "House3D" )
#endif
#JXN:include/SliderInclude.jxn
!
inf = slider.add( "inf", 2000., 0.1, 10000.)
ca = slider.add( "clipAngle", 0., 0., 10. )
h = slider.add( "h", 0., -2., 5. )
! #JXN:include/P3dInclude.jxn
p3d_dz    = slider.add( "dz",    10., 0.1,  10000. )
p3d_alpha = slider.add( "alpha", 22.,  -90.,  90. )
p3d_phi   = slider.add( "phi",  -45., -180., 180. )
p3d = @KmgPerspectiveProjection( p3d_phi, p3d_alpha, p3d_dz )
p3d.setClipAngle(ca);
!
l = -1.  ! left
m =  0.  ! mid
r = +1.  ! right
!
f = -1.5  ! front
b = +1.5  ! back
!
g =  0. - h ! ground
e =  1. - h ! edge
t =  2. - h ! top
!
!      0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5  6  7  8  9
xh = { m, l, l, l, l, r, r, r, r, m, m, r, r, r, r, l, l, l, l, m }  ! also works
xh = { m, l, l, l, l, r, r, r, r, m, m, l, l, l, l, r, r, r, r, m }
yh = { f, f, b, b, f, f, b, b, f, f, b, b, f, f, b, b, f, f, b, b }
zh = { t, e, e, g, g, g, g, e, e, t, t, e, e, g, g, g, g, e, e, t }
!
pf = plot( p3d ).setXYBounds( -12, -4, 12, 8 ).add( xh, yh, zh, B, 0, 3. )
!
! x-direction
pf.add( @JxnLine3DPainter( l, f, g, +inf, f, g ) ) 
pf.add( @JxnLine3DPainter( -inf, f, g, r, f, g ) ) 
pf.add( @JxnLine3DPainter( l, b, g, +inf, b, g ) ) 
pf.add( @JxnLine3DPainter( -inf, b, g, r, b, g ) ) 
pf.add( @JxnLine3DPainter( l, f, e, +inf, f, e ) ) 
pf.add( @JxnLine3DPainter( -inf, f, e, r, f, e ) ) 
pf.add( @JxnLine3DPainter( l, b, e, +inf, b, e ) ) 
pf.add( @JxnLine3DPainter( -inf, b, e, r, b, e ) ) 
!
! y-direction
pf.add( @JxnLine3DPainter( l, f, g, l, +inf, g ) ) 
pf.add( @JxnLine3DPainter( l, -inf, g, l, b, g ) ) 
pf.add( @JxnLine3DPainter( r, f, g, r, +inf, g ) ) 
pf.add( @JxnLine3DPainter( r, -inf, g, r, b, g ) ) 
pf.add( @JxnLine3DPainter( l, f, e, l, +inf, e ) ) 
pf.add( @JxnLine3DPainter( l, -inf, e, l, b, e ) ) 
pf.add( @JxnLine3DPainter( r, f, e, r, +inf, e ) ) 
pf.add( @JxnLine3DPainter( r, -inf, e, r, b, e ) ) 
pf.add( @JxnLine3DPainter( m, f, t, m, +inf, t ) ) 
pf.add( @JxnLine3DPainter( m, -inf, t, m, b, t ) ) 
!
! z-direction
pf.add( @JxnLine3DPainter( l, f, g, l, f, +inf ) ) 
pf.add( @JxnLine3DPainter( l, f, -inf, l, f, e ) ) 
pf.add( @JxnLine3DPainter( r, f, g, r, f, +inf ) ) 
pf.add( @JxnLine3DPainter( r, f, -inf, r, f, e ) ) 
pf.add( @JxnLine3DPainter( l, b, g, l, b, +inf ) ) 
pf.add( @JxnLine3DPainter( l, b, -inf, l, b, e ) ) 
pf.add( @JxnLine3DPainter( r, b, g, r, b, +inf ) ) 
pf.add( @JxnLine3DPainter( r, b, -inf, r, b, e ) ) 
!
! roof
xln = m + ( l - m ) inf
xlp = l + ( m - l ) inf
xrn = m + ( r - m ) inf
xrp = r + ( m - r ) inf
zn  = t + ( e - t ) inf
zp  = e + ( t - e ) inf
pf.add( @JxnLine3DPainter( l, f, e, xlp, f, zp ) ) 
pf.add( @JxnLine3DPainter( l, b, e, xlp, b, zp ) ) 
pf.add( @JxnLine3DPainter( xln, f, zn, m, f, t ) ) 
pf.add( @JxnLine3DPainter( xln, b, zn, m, b, t ) ) 
pf.add( @JxnLine3DPainter( r, f, e, xrp, f, zp ) ) 
pf.add( @JxnLine3DPainter( r, b, e, xrp, b, zp ) ) 
pf.add( @JxnLine3DPainter( xrn, f, zn, m, f, t ) ) 
pf.add( @JxnLine3DPainter( xrn, b, zn, m, b, t ) ) 
!
pf1 = pf
#JXN:include/Center1Include.jxn
#JXN:include/FrameInclude.jxn