Previous Next Up Title Contents General Index Functions Index Bookshelf

1.7.8. TRACÉ D'UN PARALLÉLÉPIPÈDE AVEC CONSERVATION DES DIMENSIONS


	program p78
	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 viewpt /0.,1., 0.,1., 0.,1./

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

c	ouverture de PHIGURE et du poste de travail */
	call topph (6)
	call topwk (wkid,30,8887)

c	definition d'un domaine cubique 3D de travail
	size = max(xmax-xmin,ymax-ymin)
	size = max(size,zmax-zmin)/2.0
	xmid = (xmin+xmax)/2.0
	ymid = (ymin+ymax)/2.0
	zmid = (zmin+zmax)/2.0
	xmindo = xmid - size
	xmaxdo = xmid + size
	ymindo = ymid - size
	ymaxdo = ymid + size
	zmindo = zmid - size
	zmaxdo = zmid + size
	call tdoma3 (xmindo,ymindo,zmindo, xmaxdo,ymaxdo,zmaxdo)

c	construction d'un parallelepipede
	call tcube (cubid, xmin,ymin,zmin, xmax,ymax,zmax)

c	construction du repère avec un type de ligne pointille
	call tcosya (systid, xmid,ymid,zmid ,xmax,ymax,zmax,
     +             'X','Y','Z', 0.1,0.1)

c	insertion d'un attribut PHIGS type de ligne dans la structure 
	call tsln (systid,-1,PLDASH)

c	definition de la scene
	call tscene (scenid,2,listid,viewid)

c	definition d'une vue centree 2D 
	call tv3spz (wkid,viewid,0.5,0.5,0.5,55.,25.,3.0,zoom,viewpt)
	
c	trace sur le poste de travail 
	call ppost (wkid,scenid,1.0)
	call prst (wkid,PALWAY)

c	fermeture du poste de travail et de PHIGURE 
	call tclwk (wkid)
	call tclph 
	end

Ce programme est identique au P76, mais le domaine est cubique de façon à éviter toute transformation de scène. Le cube est calculé comme étant le plus petit cube englobant le parallélépipède des limites aux données, ce parallélépipède étant centré dans le cube.


Previous Next Up Title Contents General Index Functions Index Bookshelf