acmfiu@serss0.fiu.edu (ACMFIU) (02/13/91)
any program available to do this on an hp 28s? albert
yngvi@rhi.hi.is (Yngvi Sigurjonsson) (02/14/91)
In <2422@kluge.fiu.edu> acmfiu@serss0.fiu.edu (ACMFIU) writes: >any program available to do this on an hp 28s? I can give you this terribly slow program (it needs a faster line program) NORM << DUP DUP DOT SQRT / >> /* SQRT means square root don't type SQRT */ THR << CLLCD LIST-> 1 SWAP START LIST-> DROP VOR * SCALE DUP { 1 1 } GET SWAP { 1 2 } GET R->C SWAP VOR * SCALE DUP { 1 1 } GET SWAP { 1 2 } GET R->C LINE NEXT DGTIZ >> BWT << -> VRP EP UP << EP VRP - DUP 4 IDN SWAP { 3 4 } SWAP 0 SWAP DUP DOT SQRT INV - PUT SWAP NORM 'N' STO UP VRP - 'V' STO V V N DOT N * - NORM 'V' STO V N CROSS 'U' STO U ARRY-> DROP 0 V ARRY-> DROP 0 N ARRY-> DROP 0 0 0 0 1 { 4 4 } ->ARRY TRN SWAP * 'VOR' STO >> >> The rest is for the line program and could be skipped if you have a better (faster) line program. MST << PPAR PPAR 2 GET SWAP 1 GET - C->R 32 / SWAP 137 / SWAP R->C >> /* MST needs to be run each time you change PPAR for my LINE to work */ LINE << -> FROM TO << TO FROM - DUP C->R ST C->R SWAP DROP / SWAP ST C->R DROP / SWAP R->C ABS DUP 3 PICK SWAP / SWAP FROM SWAP 0 SWAP START DUP PIXEL OVER + NEXT >> DROP2 DROP >> Instruction: As I said you must run MST first with no parameters. To set and change eye point to (x,y,z) do: [0 0 0] [x y z] [0 0 1] BWT wich sets up the transformation matrix the last parameter specifies wich point is up the first parameter specifies the point at wich you want to look ( which must be [ 0 0 0 ] in this version). Now we can start drawing. list THR where list is a list of lines specified with two threedimensional points like this: { { [[ 1 1 1 1]] [[ 2 6 9 1 ]] }.........} the fourth number for each point must allways be 1. This example will draw a box. {{ [[ 1 1 1 1]][[1 1 0 1]]}{ [[ 0 0 0 1]][[1 0 0 1]]} { [[ 1 1 0 1]][[0 1 0 1]]}{ [[ 0 0 1 1]][[1 0 1 1]]} { [[ 1 1 1 1]][[0 1 1 1]]}{ [[ 0 0 0 1]][[0 0 1 1]]} { [[ 0 1 0 1]][[0 1 0 1]]}{ [[ 1 0 0 1]][[1 0 1 1]]} { [[ 1 0 0 1]][[1 1 0 1]]}{ [[ 1 0 1 1]][[1 1 1 1]]} { [[ 0 0 1 1]][[0 1 1 1]]}{ [[ 0 1 0 1]][[0 1 1 1]]}} I hope this will be of some use to you. The program is not very fast with my very slow line drawer but if you can get a faster line drawer I think it would get fast enough for a non-Cray pocket calculator. Yngvi Thor Sigurjonsson Computer science student. yngvi@rhi.hi.is -- Yngvi Sigurjonsson.