Previous Next Up Title Contents Index Functions Index Top Library

1.7.6. DRAWING A PARALLELEPIPED

	program p76
	include 'PHIGS.H'

	integer wkid, viewid, scenid,cubid,systid, listid(2)
	real viewpt(6)
	data wkid, viewid, scenid  / 1, 1, 10/
	data cubid,systid,listid /11,12, 11,12/
	data zoom                  / 1.0 /
	data xmin,ymin,zmin, xmax,ymax,zmax  / 10.,10.,5., 20.,30.,35. /
	data xmid,ymid,zmid /15.,20.,20./
	data viewpt /0.,1., 0.,1., 0.,1./

c---------------------------------------------------------------------

c	open PHIGURE and an X-window workstation (8887)*/
	call topph (6)
	call topwk (wkid,30,8887)

c	define 3D working domain
	call tdoma3 (xmin,ymin,zmin, xmax,ymax,zmax)

c	build parallelepiped
	call tcube (cubid, xmin,ymin,zmin, xmax,ymax,zmax)

c	build dotted line-type reference
	call tcosya (systid, xmid,ymid,zmid ,xmax,ymax,zmax,
  +             'X','Y','Z', 0.1,0.1)

c	insert a PHIGS-type line attribute in the structure 
	call tsln (systid,-1,PLDASH)

c	define scene
	call TSCENE (scenid,2,listid,viewid)
   
c	define a centered 2D view 
	call tv3spz (wkid,viewid,0.5,0.5,0.5,55.,25.,3.0,zoom,viewpt)
	
c	display scene on workstation 
	call ppost (wkid,scenid,1.0)
	call prst (wkid,PALWAY)

c	close workstation and PHIGURE 
	call tclwk (wkid)
	call tclph 
	end

This program displays a parallelepiped and a reference in 3D. The view is defined in perspective showing the Z axis vertical. As the domain has been defined as the limits of the parallelepiped, scene transformation changes it into a cube.


Previous Next Up Title Contents Index Functions Index Top Library