Ports:
	marmite			CentOS-5.5
	bokhara			fc8 64
	xebec			solaris 10

Install HEAD:
	solaris	shanti	
	  cp -p build/solaris/ds9 /rom-48/hea0/soft/saord/bin/.
	linux	shanti	
	  cp -p build/linux/ds9 /rom-48/hea1/soft/Linux/i686/saord/bin/.
	linux64	shanti	
	  cp -p build/linux64/ds9 /rom-48/hea1/soft/Linux/x86_64/saord/bin/.
	MacOSX 10.5 shanti
	  cp -p build/darwinleopard/ds9 /rom-48/hea1/soft/saord/Leopard_i386/bin/.	  cp -p build/darwinleopard/ds9.zip /rom-48/hea1/soft/saord/Leopard_i386/bin/.

macports-
  for doc html2ps
      sudo port install wget
      sudo port install ImageMagick
  for darwinlion (be sure to set PKG_CONFIG_PATH)
      sudo port install pkgconfig

apple.com:
	http://www.apple.com/downloads/
	Submit Downloads

Source:
	ast		http://starlink.jach.hawaii.edu/starlink/AST
	wcssubs		ftp://cfa-ftp.harvard.edu/pub/gsc/WCSTools
	funtools	/data/mmti/CVSROOT
	pcc		http://pcc.ludd.ltu.se/
			http://pcc.ludd.ltu.se/ftp/pub/pcc/
			http://pcc.ludd.ltu.se/ftp/pub/pcc-libs/
	tcc		http://bellard.org/tcc/

Build:
	# cvs- back out changes
	cvs update -j 1.5 -j 1.4 foo.c
	# reset sticky tag
	cvs update -A

HTML Comment: <!-- something -->
	
Future:
	VO Image Archive
	VO/Chandra Footprint server
	FOV (http://aladin.u-strasbg.fr/java/FOVs.xml)

	Illustrate mode
	Remote Observing
	Windows64
	MacOSX
	Non-Model File Browser
	FITS structure viewer
	2D surface plot
	Topcat like plot
	Mosaic Reprojection
	Astrometry.net
	Catalog to 3D cube
	Catalog matching

List
	- 7.0.1
	ds9 -grid -zoom to .5 -wcs sky galactic -wcs skyformat degrees *.fits

	- 7.1
	  bin
	    3rd axis reset after apply
	  3rd axis cut 2d image

	  vo ddt- samp to ds9

	  windows native plot print
	  check/update blt
	  update tcl/tk8.6
	  xpa/samp PhotoCmd
	  LoadURL Photo
	  xpa-talk

	  3D other
	    zoom 3rd axes
	    border
	    compass
	    grids
	      rotate text
	      ps text over grid
	    SIP
	    prefs for AUTOSCAN value
	    keyContext vs context vs currentContext
	    mosaics
	    macros $url() | $image(3d)
	    Magnifier-  bitbit off by .5?
	    magnifier cursor
	    cleanup frame.C vs frame3d.C
	    panner/widget blank issue while rotating: only at vp=0,0 and depth=1
	    wcszoom for point regions
	    zoom[0]!=zoom[1]
	    panner arrows (see marker arrows)
	    config instead of forget? (layout vert)
	    special modes
	      +-x frames, updated as current slice moves
	      line cut down 3rd axis-> new image

	    markers
	      compass
	      arrows

	  save (fits)
	    current wcs
	    cube
	    mosaic
	    crop

	  saveimage fits 
	    ZPX/TNX
	    SIP
	    SCAMP (TPV?)
	    HPX

	  other
	    windows- astAnnul too slow (for large data cubes)
	    analysis: compress fits
	    warp cursor weirdness (framebase)
	    check saveas fits (LTMV?)
	  smooth
	    smooth over crop only
	    use threads
	  regions
	    epanda issue (ds9.mosaic.fk4.reg)
	    cleanup- CB procs tcl
	        rm var(proc,distCB), var(proc,editCB)
	        line/projection/ruler
		annulus/ellipse annulus/box annulus
		panda/bpanda/epanda
		vector
		projection
	  drop frametruecolor
	    colormap begin/motion/end? (lock colorbar)
	    rotate begin/motion/end?
	  analysis.sh- add filename tests
	    move filter strings from file.C to fitsimage.C
	    image[ext][sec]
	    table[ext][filter][slicefilter]
	  crop2d
	    fix -crop x y w h wcs galatic arcsec issue
	    GUI cross mosaic edges
	    dialog (for each mosaic)
	  cleanup
	    refreshinfobox
	      clearinfobox
	      clearpixeltable
	      cleargraph
	    updatestatic?
	    tile mode
	      grid axis
	  build pcc for lion

	-structure
	  check tcl/tk lib for zip dir
	  absolute dir for mount point
	    (alexeys problem with ssh mounted disks, can we use /tmp?)
	    tcl/tk lib
	    encodings
	    help
	    fov
	    source ?.tcl (ds9.tcl)

	  SIGBUS- look for EXC_BAD_ACCESS also

	  -64 bit FITS Fitsy++ fits keywords (test64bit.fits)

	  clean up configure mods (use autoreconf)
	    blt
	    html
	    tclxml
	    tcllib
	    zip

	  macosx
	    tk
	      generic/tkEvent
	      macosx/tkMacOSXDraw.c blt w==0
	      xlib/X11/Xlib.h

	-Bugs

	[ds9|?]parser.Y allow 1e-01" and 1e-01' for vvalue
	toggle frame (with mosaics) infobox blinks out
	iraf lines
	adjust cmap with red bg (seeing white)
	when rebin, update wcs param dialog
	plot
	  xerr yerr problems
	  check for nan
	preserve scale
	bscale/bzero bscale=-1 issue
	cygwin/iraf windows problem (return filename in cygwin format)
	Fix updating graphs while rotate/zoom/pan
	Panzoom- update dialog while rotate/zoom/pan
	small pixel problem (Alexander Menshchikov)
	regions, (ellipse/box/line) very elongated, text is too far from box
	make sure image server dialogs are below when saveas
	bin bin table 3d, smooth, rebin
	rgb, current blue, cut paste regions
	display header mosaic (one line if all the same)

	-MacOSX

	drag-out image,text
	Alex Menshchikov: arrow keys for menus MacOSX 
	load contour dialog (focus on ok after menu change)

	-Windows

	::ttk::checkbutton vo.tcl (tri state check)
	clip regions
	glob?
	screen aspect ratio
	print dpi (for text)
	variable dashed lines
	  display
	  print
	$ds9 -url 'ftp://sao-ftp/foo.fits'	
	analysis tasks will not abort
	start on other drives than C:/flash drives

	-Analysis

	return which button from xpa analysis message
	ProcessAnalysisCmd- tests/analysis.sh
	group macro expansion
	add/replace mouse button analysis bindings.
	$web(http:chandra-ed.harvard.edu/rebin.html?$XPA_METHOD)
	marker analysis support($region (select))
	sort param variables to fix $sub vs $subimage problem
	check 'open | ' fork/exec?
	$(shell variable) macro

	-Analysis Plot

	sort data when loading user data
	crosshairs with x,y,value display
	x axis- end points with reasonable values
	one/multiple window options
	better bltGraph.pro fix

	-Backup

	masks (per context: filename,color,mark)
        problem alloc/channel/socket/var loads
	  multiple extension fits data cube
	  mosaic image iraf/wcs/wfpc2
	  mosaic iraf/wcs
	  rgb image
	  rgb cube

	-Binning

	bin (disregard TDMIN/TDMAX checkbox) Diab
	binning center with bin<1
	DS9_BINKEY
	rm cols restriction or define DS9_FILTER
	bin data cube- auto title
	add file[bin][filter] (depth, function, block, etc)
	binning-- too many updateClip() calls
	why scan each time bin? can we save min/max?
	add file[bin][filter] (depth, function, block, type?, etc)
	bin add x:diminsion,y:diminsion to parser (ciao like syntax)

	-Blink

	blink mode with fast flash
	select which frames to blink
	non-modal dialog (simular to ximtool)

        -Catalog

	NonFK5 sky_in sky_out ICRS Comments
	---    ------ ------- ---- --------
	NED    yes    yes     no
	SIMBAD yes    yes     yes
	CDS    yes    yes     no   (no ecl)
	CXC    no     no      no
	SKYBOT no     no      no

	scatter chart for catalogs
	clear/delete frame, close all catalogs
	load catalog via stdin
	delete frame/delete dialog
	new catalog
	delete region/row
	add region/row
	filter local catalog at load

	-Comm
	
	event feedback via xpa/samp

	-Contours

	contour copy/paste? (save in var?)
	dashed for neg
	clip contours to mosaic segment
	clip overlay contours to image boundries

	-Examine

	xpa imexam return frame # (patrick broos)

	-Fits

	blocking
	gzip/compress/pack- use magic number instead of file ext
	gzip fits in/out (buffer size?)
	reorder x/y/z data cube-  data/DHT33_carina.fits
	hduname support
	TNULLn ascii/binary tables
	FITS compression long long

	-Graphs (Horz/Vert)

	MacOSX print
	Windows print
	postscript print
	set range limits
	don't clip numbers on ends
	large numbers (500000 verse 5e5)

	-GUI

	tcl var for each (like hv)
	  analysis
	  markers

	buttons reorder
	cursor-to dialog
	menus params via shortcuts
	language textvariable
	  color (plot.tcl)
	  dlabel,clabel,dist,system,sky,skyformat
	"Load As..." menu for load url
	get panner to generate 'EnterPanner' events during blink
	annotate frames with user specified name
	prefs 2/3 button mouse

	-HV

	http://tkhtml.tcl.tk/index.html
	history/clear history
	multipart mime-	push no terminating str
	ftp soft links
	textarea with scrollbars
	print

	-IRAF

	problem with 'display dev$pix 1 select_frame-'
	  may have to upgrade iis code
	imexamine problem with frames 10-16

	-Masks

	mask event files
	bit wise
	xpa/commandline (syntax change?)
	bin table: block in/out

	-Printing

	Annotate prints with title/footnotes

	-Regions

	renderXText- clip to widget
	statistics
	regions tests for -format/-system/-sky
	projection region- add bin size option
	new copy/paste regions: copy into tcl var (both physical and wcs)
	regions std dialog
	  send/receive samp votable
	votable- composite
	ds9parser-  parse (hh mm ss [+-]dd mm ss)
	projection
	  delete/composite undelete/desolve no update
	  default coordinate systems for plots
	  specify method
	FITS Regions
	  add HDUCLAS1
	  add MFORM1 support
	  add WCS support
	  gz fits
	  use current properties
	XPA/SAMP control over existing regions
	  change colors/properties
	  change default shape sizes
	  return ids when create
	  select last region created
	  groups- new/delete
	xy,saoimage,ciao-- use current shape,color,properties
	Tests
	  point region # pointsize=
	  composite # composite = 1
	  text # textrotate = yes
	mosaic/analysis regions macro for non-wcs

	-WCS

	add RADESYS: FK4-NO-E/GAPPT/SUPERGALACTIC/HELIOECLIPTIC menus
	solar SOLX/SOLY,HPLN/HPLT,HGLN/HGLT,HRLN/HRLT
	wcs editor-  astrometry.net

	header	     define		AST (TPN=SCAMP)
	-----	     ------		---
	TAN+PV	     old SCAMP		TPN+PV
		     noscamp		TAN+PV?
	TNX+Wat	     IRAF		TPN+PV
	TPV	     new SCAMP		TPN+PV?
	TAN+QV	     autoastrom		TAN+PV?
	TAN+SIP	     SIP		PolyMap

	Problem FITS WCS Files
	  wcssubs ast wcslib
	  ------- --- ------
	  COD/COE/COO/COP (bad, yes, yes)
	  HPX (HEALPix) (no, yes, yes)
	  DSS (SAO) (yes, yes, no)
	  TNX (NOAO TAN + params) (yes , yes, no)
	  ZPX (NOAO ZPN + params) (yes , yes, no)
	  TAN---RA-SIP (SIRTF) (yes, yes, no)
	  SCAMP (SAO TAN + PV) (yes, yes(PV->QV), no)
	  TPV (NOAO TAN + PV) (yes, yes(PV->QV), no)
	  AUTOASTROM (xxx + QV) (no, yes, no)
	  WCSDEP (yes, no, no)

	TNX
	  30s_01.fits
	  cal000277b.fits
	  mscred.fits
	  obj094.fits
	  obj269z.fits
	  westphal_Rs.wcs.fits

	ZPN
	  ABELL0586.0750.fits
	  D4.0705.fits
	  EGS1.1193.fits
	  LSSTtest.2124.fits
	  UKIDDS_K_3219_606_17_67_3.fits
	  rcs2_m3.2540.fits

	ZPX
	  E5.3090.fits
	  E5.3075.fits

	TAN-SIP
	  sst.fits
	  mos8.fits (no reverse)

	SCAMP
	  ngc6819.fit
	  ac42227_00_01ww_tnx.fit

	WCSDEP
	  ngc6819.fit

	HPX
	  wmap_ilc_3yr_v2-HPX.fits

	ZEA
	  South_galactic.fits 'GLON-ZEA'
	  g000p00r2.fits 'GLON-ZEA'
	  North_galactic.fits 'GLON-ZEA'

	  -bad
	  SFD_dust_4096_ngp.fits 'GLON-ZEA' bad align

	CAR
	  CAR_model.fits 'RA---CAR'
	  car_01.fits 'RA---CAR'
	  car_02.fits 'RA---CAR' (bad wcssubs)

	  GLM_00350+0115_mosaic_I4_cutout_14706.fits 'GLON-CAR'
	  GLM_03350+0000_mosaic_I1_cutout_10617.fits 'GLON-CAR'
	  GP_343.5_+0.0_A.fits 'GLON-CAR'
	  fermi_counts_gps_bin_1.00.fits 'GLON-CAR'
	  gc_energybin07_fadapt10_smajor030.fits 'GLON-CAR'
	  gc_energybin07_fadapt10_smajor100.fits 'GLON-CAR'
	  msxmapA-1a.fits 'GLON-CAR'
	  msxmapA-2.fits 'GLON-CAR'
	  eta.fits 'GLON-CAR' (bad wcssubs)
	  rmon_msxmapA.fits 'GLON-CAR' (bad wcssubs)
    	  iras_hires_band3.fits 'GLON-CAR' (bad wcssubs)
	  msx327p5.fits 'GLON-CAR' (bad wcssubs)
	  msxmapA-1.fits 'GLON-CAR' (bad wcssubs)

	  -bad
	  total_hi.fits 'GLON-CAR' 

	xLON/xLAT- bad
	  worldtopo.multi.fits 'TLON-CAR'

	IRAF
	  obj011.fits
	  oct12_096.4.fits

	CROTA1
	  AXJ165420_GAIA.fits

Languages:
	Dansk		Allan Hornstrup		allan@dsri.dk
	Espaol		Manuel Perez Torres	mpereztorres@cfa
	Portuguese	Alberto Krone-Martins	krone@obs.u-bordeaux1.fr
	Japanese	Masahiro Tsujimoto	tsujimot@astro.psu.edu
	Chinese		Junfeng Wang		jwang@head.cfa.harvard.edu
	Chinese		Albert Kong		akong@space.mit.edu
	Franais (a-c)	Jean-Baptiste Marquette	marquett@iap.fr
	Franais (d-h)	Jean-Francois Sygnet	sygnet@iap.fr
	Franais (i-m)	Elaine Fortin 		elaine_fortin@harvard.edu
	Franais (n-p)	Anne Lemiere 		alemiere@head.cfa.harvard.edu
	Franais *(q-t)	Jean-Francois Sygnet	sygnet@iap.fr
	Franais *(u-z)	Ilana Harrus  		imh@milkyway.gsfc.nasa.gov

Notes:
	fonts
	  render/print/ps
	    linux render native, PS base
	    macsox render native, print native, PS base
	    win32 render native, print native, PS base

	  where
	    ds9: TkDefaultFont
	    horz/vert graph: TkDefaultFont
	    scale dialog: TkDefaultFont
	    hv: hv(font)
	    tktable: TkDefaultFont
	    panner: ds9(helvetica)

	    plot: ap(titlefont)/ap(numlabfont)/ap(textlabfont)
	    colorbar: colorbar(font)
	    grid: opts= titlefont/numlabfont/textlabfont
	    marker: str

	loadParam(file,type)
	  FITS
	    ARRAY

        loadParam(file,mode)
	  {}
	  {data cube}
	  {mosaic image iraf}
	  {mosaic image}
	  {mosaic image wcs}
	  {mosaic wcs}
	  {mosaic image wfpc2}
	  {rgb image}
	  {rgb cube}
  
        loadParam(load,type)
	  alloc
	  allocgz
	  channel
	  mmap
	  mmapincr
	  smmap
	  shared
	  sshared
	  socket
	  socketgz
	  var

	Fitsy++ Memory modes
		strm
			(alloc)
			allocgz
			channel
			(socket)
			socketgz

		map
			(mmap)
			share
			var

		smap
			smmap
			sshare

		mapincr
			mmapincr


	funtools
		LAUNCH_ROUTINE: V f|F p|P
		FILTER_PTYPE: c

	IRAF Graphcap

	:DD=node!imtool,fifo\:/dev/imt1i\:/dev/imt1o,512,512:tc=iism70:
	:DD=node!imtool,inet\:5137,512,512:tc=iism70:
	:DD=node!imtool,unix\:/tmp/.IMT%d,512,512:tc=iism70:

	IRAF Colors:
		202 = black
		203 = white
		204 = red
		205 = green
		206 = blue
		207 = yellow
		208 = cyan
		209 = magenta
		210 = coral (255 127 80)
		211 = maroon (176 48 96)
		212 = orange (255 165 0)
		213 = khaki (240 230 140)
		214 = orchid (218 112 214)
		215 = turquoise (64 224 208)
		216 = violet (238 130 238)
		217 = wheat (245 222 179)
		218-254 = reserved for use by other windows
		255 = black (sunview foreground color)

	Word Length

		***i386
		char 1
		short 2
		int 4
		long int 4
		long 4
		long long 8
		void* 4

		***x86_64
		char 1
		short 2
		int 4
		long int 8
		long 8
		long long 8
		void* 8

		***solaris
		char 1
		short 2
		int 4
		long int 4
		long 4
		long long 8
		void* 4

		***solaris64
		char 1
		short 2
		int 4
		long int 8
		long 8
		long long 8
		void* 8

		***ppc
		char 1
		short 2
		int 4
		long int 4
		long 4
		long long 8
		void* 4

		***pcc64
		char 1
		short 2
		int 4
		long int 8
		long 8
		long long 8
		void* 8

	WCS Keywords
		WCSNAME	WCSNAMEa	TWCSn	TWCSna

		CTYPEi	CTYPEia		TCTYPn	TCTYna
		CUNITi	CUNITia		TCUNIn	TCUNna
		CRPIXi	CRPIXia		TCRPXn	TCRPna
		CRVALi	CRVALia		TCRVLn	TCRVna
		CDELTi	CDELTia		TCDLTn	TCDEna
		CROTAi	CROTAia		TCROTn
		PCi_j	PCi_ja		TPn_k	TPn_ka
		CDi_j	CDi_ja		TCn_k	TCn_ka
		PVi_m	PVi_ma		TVn_m	TVn_ma
		PSi_m	PSi_ma		TSn_m	TSn_ma

MACOSX

enum {
  k1MonochromePixelFormat       = 0x00000001, /* 1 bit indexed*/
  k2IndexedPixelFormat          = 0x00000002, /* 2 bit indexed*/
  k4IndexedPixelFormat          = 0x00000004, /* 4 bit indexed*/
  k8IndexedPixelFormat          = 0x00000008, /* 8 bit indexed*/
  k16BE555PixelFormat           = 0x00000010, /* 16 bit BE rgb 555 (Mac)*/
  k24RGBPixelFormat             = 0x00000018, /* 24 bit rgb */
  k32ARGBPixelFormat            = 0x00000020, /* 32 bit argb    (Mac)*/
  k1IndexedGrayPixelFormat      = 0x00000021, /* 1 bit indexed gray*/
  k2IndexedGrayPixelFormat      = 0x00000022, /* 2 bit indexed gray*/
  k4IndexedGrayPixelFormat      = 0x00000024, /* 4 bit indexed gray*/
  k8IndexedGrayPixelFormat      = 0x00000028 /* 8 bit indexed gray*/
};

enum {
  k16LE555PixelFormat           = 'L555', /* 16 bit LE rgb 555 (PC)*/
  k16LE5551PixelFormat          = '5551', /* 16 bit LE rgb 5551*/
  k16BE565PixelFormat           = 'B565', /* 16 bit BE rgb 565*/
  k16LE565PixelFormat           = 'L565', /* 16 bit LE rgb 565*/
  k24BGRPixelFormat             = '24BG', /* 24 bit bgr */
  k32BGRAPixelFormat            = 'BGRA', /* 32 bit bgra    (Matrox)*/
  k32ABGRPixelFormat            = 'ABGR', /* 32 bit abgr    */
  k32RGBAPixelFormat            = 'RGBA', /* 32 bit rgba    */
  kYUVSPixelFormat              = 'yuvs', /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
  kYUVUPixelFormat              = 'yuvu', /* YUV 4:2:2 byte ordering 16-signed*/
  kYVU9PixelFormat              = 'YVU9', /* YVU9 Planar    9*/
  kYUV411PixelFormat            = 'Y411', /* YUV 4:1:1 Interleaved  16*/
  kYVYU422PixelFormat           = 'YVYU', /* YVYU 4:2:2 byte ordering   16*/
  kUYVY422PixelFormat           = 'UYVY', /* UYVY 4:2:2 byte ordering   16*/
  kYUV211PixelFormat            = 'Y211', /* YUV 2:1:1 Packed   8*/
  k2vuyPixelFormat              = '2vuy' /* UYVY 4:2:2 byte ordering   16*/
};

x11
	image
		ps pagesetup
		ps print
	plot
		ps pagesetup
		ps print
	simple text
		ps print

win32/macosx
	image
		ps pagesetup
		ps print
		native pagesetup
		print
	plot
		ps pagesetup
		ps print
		native pagesetup
		print
	simple text
		native pagesetup
		native print

AST		David Berry		GPLv2
	http://starlink.jach.hawaii.edu/starlink/AST
BLT		George A Howlett	OpenSource
	www.sourceforge.net/projects/blt/files
CheckDNS	SAO			GPLv2
	http://hea-www.harvard.edu/RD/ds9/
FunTools	SAO			LGPLv2.1
	https://www.cfa.harvard.edu/~john/funtools/
HCompress	Richard White/STScI	OpenSource/NASA	
	http://www.stsci.edu/software/hcompress.html
HTMLWidget	D. Richard Hipp		GPLv2 
	http://www.hwaci.com/drh/
IIS		NOAO			OpenSource/IRAF
PLIO		NOAO			OpenSource/IRAF
RICE		Richard White/STScI	OpenSource/NASA
SAOtk		SAO			GPLv2	
	http://hea-www.harvard.edu/RD/ds9/
Signal_Ext	Michael Schwartz	OpenSource 
	http://www.nyx.net/~mschwart
Tcl	University of California/Sun Microsystems/Scripts	OpenSource 
	http://sourceforge.net/projects/tcl/files/Tcl/
Tcllib	Ajuba Solutions and other parties	OpenSource
	http://tcllib.sourceforge.net/
tclxml	ANU/CSIRO/Zveno Pty Ltd/Explain	OpenSource
	http://www.explain.com.au/
Tk	University of California/Sun Microsystems/Scripts	OpenSource 
	http://sourceforge.net/projects/tcl/files/Tk/
TkCon		Jeffrey Hobbs		OpenSource 
TKIMG		Various Authors		OpenSource	
	http://sourceforge.net/projects/tkimg/
ezMPEG		Ingo Oppermann		GPLv2 
tkmpeg 		SAO			GPLv2	
	http://hea-www.harvard.edu/RD/ds9/
TkTable		Jeffrey Hobbs		GPLv2	
	http://sourceforge.net/projects/tktable/
WCSTools	SAO			LGPLv2.1	
	http://tdc-www.cfa.harvard.edu/wcstools/
xmlrpc		Eric Yeh		GPLv2
xpa		SAO			LGPLv2.1 
	http://hea-www.harvard.edu/RD/ds9/
zip		Info-ZIP		OpenSource	
	http://www.info-zip.org/
zlib	Jean-loup Gailly and Mark Adler OpenSource 
	http://zlib.net/
zvfs		Richard Hipp		OpenSource	
	http://www.hwaci.com/drh/

  double zz=vp_[2]*2;
  double wtx = 0;
  double wty = 0;
  double dd = zz/2.;
  double ff = 1;
  double bb = zz*2;
  Matrix3d shear(1,0,0, 0,1,0, -wtx/dd,-wty/dd,1, 0,0,0);
  Scale3d scale(1,1,1/dd);
  Matrix3d perspective(1,0,0,0, 0,1,0,0, 0,0,bb/(bb-ff),1, 0,0,-ff*bb/dd/(bb-ff),0);

  userToWidget3d =
<snip>
    Translate3d(0,0,zz) *
    //    shear *
    //    scale *
    //    perspective *
    Translate3d(0,0,-zz) *
<snip>


