* * Draw a cuboid given an x,y, and z length in pixels * * Setup x and y origin - bottom left coordinate nXorg=200 nYorg=200 * Default x,y,z values of cuboid for this example. * Probably pass these as your cuboid x,y,z pararemeters nXlen=50 nYlen=50 nZlen=50 * Calculate x,y values by which to displace second rectangle by nZlen nXdis = SQRT( ( nZlen^2 ) / 2 ) nYdis = nXdis && assume 45 degree perspective so x displacement = y displacement * Draw the cuboid WITH THISFORM * First rectangle .Line( nXorg,nYorg,nXorg+nXlen,nYorg ) .Line( nXorg,nYorg,nXorg,nYorg-nYlen ) .Line( nXorg,nYorg-nYlen,nXorg+nXlen,nYorg-nYlen ) .Line( nXorg+nXlen,nYorg,nXorg+nXlen,nYorg-nYlen ) * Second rectangle .Line( nXorg+nXdis,nYorg-nYdis,nXorg+nXdis+nXlen,nYorg-nYdis ) .Line( nXorg+nXdis,nYorg-nYdis,nXorg+nXdis,nYorg-nYdis-nYlen ) .Line( nXorg+nXdis,nYorg-nYdis-nYlen,nXorg+nXdis+nXlen,nYorg-nYdis-nYlen ) .Line( nXorg+nXdis+nXlen,nYorg-nYdis,nXorg+nXdis+nXlen,nYorg-nYdis-nYlen ) * Joining lines between two rectangles - bottom .Line( nXorg,nYorg,nXorg+nXdis,nYorg-nYdis ) .Line( nXorg+nXlen,nYorg,nXorg+nXlen+nXdis,nYorg-nYdis ) * Joining lines between two rectangles - top .Line( nXorg,nYorg-nYlen,nXorg+nXdis,nYorg-nYlen-nYdis ) .Line( nXorg+nXlen,nYorg-nYlen,nXorg+nXlen+nXdis,nYorg-nYlen-nYdis ) ENDWITHPS. I only spent 10 mins on this so it really is a quick and dirty just to show the principle :)