home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-07-16 | 30.1 KB | [TEXT/CWIE] |
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: Plot3DViewer.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Jul 16 18:20:18 1996, modified Tue Jul 16 18:20:18 1996, creator 'CWIE', type ASCII, 30104 bytes "Plot3DViewer.c" , at 0x7618 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 50 6c 6f 74 33 44 | 56 69 65 77 65 72 2e 63 |..Plot3D|Viewer.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 75 98 00 | 00 01 9a ae 11 c6 22 ae |.....u..|......".|
|00000060| 11 c6 22 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..".....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 9d 6f 00 00 |........|.....o..|
|00000080| 23 69 66 6e 64 65 66 20 | 5f 5f 50 4c 4f 54 33 44 |#ifndef |__PLOT3D|
|00000090| 56 49 45 57 45 52 5f 5f | 0d 23 69 6e 63 6c 75 64 |VIEWER__|.#includ|
|000000a0| 65 20 22 50 6c 6f 74 33 | 44 56 69 65 77 65 72 2e |e "Plot3|DViewer.|
|000000b0| 68 22 0d 23 65 6e 64 69 | 66 0d 0d 23 69 6e 63 6c |h".#endi|f..#incl|
|000000c0| 75 64 65 20 3c 51 44 33 | 44 47 72 6f 75 70 2e 68 |ude <QD3|DGroup.h|
|000000d0| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 51 44 33 44 |>.#inclu|de <QD3D|
|000000e0| 52 65 6e 64 65 72 65 72 | 2e 68 3e 0d 23 69 6e 63 |Renderer|.h>.#inc|
|000000f0| 6c 75 64 65 20 3c 51 44 | 33 44 4c 69 67 68 74 2e |lude <QD|3DLight.|
|00000100| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 51 44 33 |h>.#incl|ude <QD3|
|00000110| 44 47 65 6f 6d 65 74 72 | 79 2e 68 3e 0d 23 69 6e |DGeometr|y.h>.#in|
|00000120| 63 6c 75 64 65 20 3c 51 | 44 33 44 4d 61 74 68 2e |clude <Q|D3DMath.|
|00000130| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 51 44 33 |h>.#incl|ude <QD3|
|00000140| 44 53 65 74 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |DSet.h>.|#include|
|00000150| 20 3c 51 44 33 44 41 63 | 63 65 6c 65 72 61 74 69 | <QD3DAc|celerati|
|00000160| 6f 6e 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |on.h>.#i|nclude <|
|00000170| 51 44 33 44 44 72 61 77 | 43 6f 6e 74 65 78 74 2e |QD3DDraw|Context.|
|00000180| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 51 44 33 |h>.#incl|ude <QD3|
|00000190| 44 54 72 61 6e 73 66 6f | 72 6d 2e 68 3e 0d 23 69 |DTransfo|rm.h>.#i|
|000001a0| 6e 63 6c 75 64 65 20 3c | 51 44 33 44 53 74 6f 72 |nclude <|QD3DStor|
|000001b0| 61 67 65 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |age.h>.#|include |
|000001c0| 3c 51 44 33 44 56 69 65 | 77 2e 68 3e 0d 23 69 6e |<QD3DVie|w.h>.#in|
|000001d0| 63 6c 75 64 65 20 3c 51 | 44 33 44 49 4f 2e 68 3e |clude <Q|D3DIO.h>|
|000001e0| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 3c 51 44 4f 66 |..#inclu|de <QDOf|
|000001f0| 66 73 63 72 65 65 6e 2e | 68 3e 0d 0d 23 64 65 66 |fscreen.|h>..#def|
|00000200| 69 6e 65 20 42 55 54 54 | 4f 4e 5f 48 45 49 47 48 |ine BUTT|ON_HEIGH|
|00000210| 54 20 34 30 0d 0d 73 74 | 61 74 69 63 20 42 6f 6f |T 40..st|atic Boo|
|00000220| 6c 65 61 6e 20 69 6e 69 | 74 69 61 6c 69 7a 65 64 |lean ini|tialized|
|00000230| 20 3d 20 66 61 6c 73 65 | 3b 09 09 2f 2f 20 74 72 | = false|;..// tr|
|00000240| 75 65 20 6f 6e 63 65 20 | 74 68 69 73 20 6d 6f 64 |ue once |this mod|
|00000250| 75 6c 65 20 68 61 73 20 | 62 65 65 6e 20 69 6e 69 |ule has |been ini|
|00000260| 74 69 61 6c 69 7a 65 64 | 0d 0d 73 74 61 74 69 63 |tialized|..static|
|00000270| 20 54 51 33 4d 61 74 72 | 69 78 34 78 34 09 72 6f | TQ3Matr|ix4x4.ro|
|00000280| 74 61 74 69 6f 6e 3b 20 | 09 09 09 2f 2f 20 74 68 |tation; |...// th|
|00000290| 65 20 64 65 66 61 75 6c | 74 20 72 6f 74 61 74 69 |e defaul|t rotati|
|000002a0| 6f 6e 0d 0d 73 74 61 74 | 69 63 20 54 51 33 4d 61 |on..stat|ic TQ3Ma|
|000002b0| 74 72 69 78 34 78 34 09 | 73 70 69 6e 3b 20 09 09 |trix4x4.|spin; ..|
|000002c0| 09 09 2f 2f 20 74 68 65 | 20 64 65 66 61 75 6c 74 |..// the| default|
|000002d0| 20 73 70 69 6e 20 6d 61 | 74 72 69 78 0d 0d 2f 2f | spin ma|trix..//|
|000002e0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 73 70 69 | the def|ault spi|
|000002f0| 6e 3a 0d 73 74 61 74 69 | 63 20 54 51 33 56 65 63 |n:.stati|c TQ3Vec|
|00000300| 74 6f 72 33 44 20 72 6f | 74 61 74 69 6f 6e 56 65 |tor3D ro|tationVe|
|00000310| 63 74 6f 72 20 3d 20 7b | 30 2e 30 2c 20 30 2e 30 |ctor = {|0.0, 0.0|
|00000320| 2c 20 31 2e 30 7d 3b 09 | 09 2f 2f 20 72 6f 74 61 |, 1.0};.|.// rota|
|00000330| 74 69 6f 6e 20 76 65 63 | 74 6f 72 0d 73 74 61 74 |tion vec|tor.stat|
|00000340| 69 63 20 54 51 33 50 6f | 69 6e 74 33 44 20 72 6f |ic TQ3Po|int3D ro|
|00000350| 74 61 74 69 6f 6e 4f 72 | 69 67 69 6e 20 3d 20 7b |tationOr|igin = {|
|00000360| 30 2e 30 2c 20 30 2e 30 | 2c 20 30 2e 30 7d 3b 09 |0.0, 0.0|, 0.0};.|
|00000370| 09 09 2f 2f 20 72 6f 74 | 61 74 69 6f 6e 20 6f 72 |..// rot|ation or|
|00000380| 69 67 69 6e 0d 73 74 61 | 74 69 63 20 66 6c 6f 61 |igin.sta|tic floa|
|00000390| 74 20 72 6f 74 61 74 69 | 6f 6e 41 6e 67 6c 65 20 |t rotati|onAngle |
|000003a0| 3d 20 30 2e 30 32 3b 09 | 09 09 09 09 09 09 2f 2f |= 0.02;.|......//|
|000003b0| 20 72 6f 74 61 74 69 6f | 6e 20 61 6e 67 6c 65 0d | rotatio|n angle.|
|000003c0| 0d 73 74 61 74 69 63 20 | 42 6f 6f 6c 65 61 6e 20 |.static |Boolean |
|000003d0| 7a 56 65 72 74 69 63 61 | 6c 20 3d 20 74 72 75 65 |zVertica|l = true|
|000003e0| 3b 09 09 09 09 09 09 09 | 2f 2f 20 64 65 66 61 75 |;.......|// defau|
|000003f0| 6c 74 20 76 61 6c 75 65 | 20 0d 73 74 61 74 69 63 |lt value| .static|
|00000400| 20 42 6f 6f 6c 65 61 6e | 20 64 6f 53 70 69 6e 44 | Boolean| doSpinD|
|00000410| 65 66 61 75 6c 74 20 3d | 20 74 72 75 65 3b 0d 0d |efault =| true;..|
|00000420| 73 74 61 74 69 63 20 42 | 6f 6f 6c 65 61 6e 20 70 |static B|oolean p|
|00000430| 61 72 61 6c 6c 65 6c 44 | 65 66 61 75 6c 74 20 3d |arallelD|efault =|
|00000440| 20 66 61 6c 73 65 3b 09 | 09 09 09 09 09 2f 2f 20 | false;.|.....// |
|00000450| 74 72 75 65 20 69 66 20 | 77 65 20 73 68 6f 75 6c |true if |we shoul|
|00000460| 64 20 75 73 65 20 6f 72 | 68 74 6f 67 72 61 70 68 |d use or|htograph|
|00000470| 69 63 20 63 61 6d 65 72 | 61 73 20 62 79 20 64 65 |ic camer|as by de|
|00000480| 66 61 75 6c 74 0d 0d 23 | 64 65 66 69 6e 65 20 63 |fault..#|define c|
|00000490| 61 6d 58 20 35 2e 30 09 | 09 09 2f 2a 20 63 61 6d |amX 5.0.|../* cam|
|000004a0| 65 72 61 20 70 6f 73 69 | 74 69 6f 6e 20 2a 2f 0d |era posi|tion */.|
|000004b0| 23 64 65 66 69 6e 65 20 | 63 61 6d 59 20 35 2e 30 |#define |camY 5.0|
|000004c0| 0d 23 64 65 66 69 6e 65 | 20 63 61 6d 5a 20 35 2e |.#define| camZ 5.|
|000004d0| 30 0d 0d 23 64 65 66 69 | 6e 65 20 63 61 6d 46 4f |0..#defi|ne camFO|
|000004e0| 56 20 30 2e 33 31 35 09 | 09 2f 2a 20 66 69 65 6c |V 0.315.|./* fiel|
|000004f0| 64 20 6f 66 20 76 69 65 | 77 20 66 6f 72 20 70 6f |d of vie|w for po|
|00000500| 69 6e 74 20 70 72 6f 6a | 65 63 74 69 6f 6e 20 2a |int proj|ection *|
|00000510| 2f 0d 23 64 65 66 69 6e | 65 20 63 61 6d 57 48 20 |/.#defin|e camWH |
|00000520| 31 2e 33 37 35 33 38 09 | 09 2f 2a 20 6c 65 66 74 |1.37538.|./* left|
|00000530| 2f 74 6f 70 2f 72 69 67 | 68 74 2f 62 6f 74 74 6f |/top/rig|ht/botto|
|00000540| 6d 20 66 6f 72 20 70 61 | 72 61 6c 6c 65 6c 20 70 |m for pa|rallel p|
|00000550| 72 6f 6a 65 63 74 69 6f | 6e 20 2a 2f 0d 09 09 09 |rojectio|n */....|
|00000560| 09 09 09 09 2f 2a 20 3d | 20 73 71 72 74 28 63 61 |..../* =| sqrt(ca|
|00000570| 6d 58 5e 32 2b 63 61 6d | 59 5e 32 2b 63 61 6d 5a |mX^2+cam|Y^2+camZ|
|00000580| 5e 32 29 2a 74 61 6e 28 | 63 61 6d 46 4f 56 2f 32 |^2)*tan(|camFOV/2|
|00000590| 29 20 2a 2f 0d 0d 73 74 | 61 74 69 63 20 54 51 33 |) */..st|atic TQ3|
|000005a0| 4c 69 67 68 74 44 61 74 | 61 09 61 6d 62 69 65 6e |LightDat|a.ambien|
|000005b0| 74 4c 69 67 68 74 44 61 | 74 61 20 3d 20 0d 09 7b |tLightDa|ta = ..{|
|000005c0| 0d 09 09 6b 51 33 54 72 | 75 65 2c 09 09 09 09 2f |...kQ3Tr|ue,..../|
|000005d0| 2f 20 69 73 4f 6e 0d 09 | 09 30 2e 32 2c 09 09 09 |/ isOn..|.0.2,...|
|000005e0| 09 09 2f 2f 20 62 72 69 | 67 68 74 6e 65 73 73 0d |..// bri|ghtness.|
|000005f0| 09 09 7b 20 31 2e 30 2c | 20 31 2e 30 2c 20 31 2e |..{ 1.0,| 1.0, 1.|
|00000600| 30 20 7d 09 09 2f 2f 20 | 63 6f 6c 6f 72 20 28 77 |0 }..// |color (w|
|00000610| 68 69 74 65 29 0d 09 7d | 3b 0d 0d 0d 73 74 61 74 |hite)..}|;...stat|
|00000620| 69 63 20 54 51 33 50 6f | 69 6e 74 4c 69 67 68 74 |ic TQ3Po|intLight|
|00000630| 44 61 74 61 20 70 6f 69 | 6e 74 4c 69 67 68 74 44 |Data poi|ntLightD|
|00000640| 61 74 61 5b 34 5d 20 3d | 0d 7b 0d 09 7b 0d 09 09 |ata[4] =|.{..{...|
|00000650| 7b 09 2f 2f 6c 69 67 68 | 74 44 61 74 61 0d 09 09 |{.//ligh|tData...|
|00000660| 09 6b 51 33 54 72 75 65 | 2c 09 09 09 09 2f 2f 20 |.kQ3True|,....// |
|00000670| 69 73 4f 6e 0d 09 09 09 | 30 2e 38 2c 09 09 09 09 |isOn....|0.8,....|
|00000680| 09 2f 2f 20 62 72 69 67 | 68 74 6e 65 73 73 0d 09 |.// brig|htness..|
|00000690| 09 09 7b 20 31 2e 30 2c | 20 31 2e 30 2c 20 31 2e |..{ 1.0,| 1.0, 1.|
|000006a0| 30 20 7d 09 09 2f 2f 20 | 63 6f 6c 6f 72 20 28 77 |0 }..// |color (w|
|000006b0| 68 69 74 65 29 0d 09 09 | 7d 2c 0d 09 09 6b 51 33 |hite)...|},...kQ3|
|000006c0| 54 72 75 65 2c 09 09 09 | 09 09 2f 2f 20 63 61 73 |True,...|..// cas|
|000006d0| 74 73 53 68 61 64 6f 77 | 73 0d 09 09 6b 51 33 41 |tsShadow|s...kQ3A|
|000006e0| 74 74 65 6e 75 61 74 69 | 6f 6e 54 79 70 65 4e 6f |ttenuati|onTypeNo|
|000006f0| 6e 65 2c 09 09 2f 2f 20 | 61 74 74 65 6e 75 61 74 |ne,..// |attenuat|
|00000700| 69 6f 6e 20 74 79 70 65 | 0d 09 09 7b 20 30 2c 20 |ion type|...{ 0, |
|00000710| 31 30 2e 30 2c 20 31 30 | 2e 30 20 7d 09 09 09 2f |10.0, 10|.0 }.../|
|00000720| 2f 20 70 6f 69 6e 74 20 | 6c 6f 63 61 74 69 6f 6e |/ point |location|
|00000730| 0d 09 7d 2c 0d 09 7b 0d | 09 09 7b 09 2f 2f 6c 69 |..},..{.|..{.//li|
|00000740| 67 68 74 44 61 74 61 0d | 09 09 09 6b 51 33 46 61 |ghtData.|...kQ3Fa|
|00000750| 6c 73 65 2c 09 09 09 09 | 2f 2f 20 69 73 4f 6e 0d |lse,....|// isOn.|
|00000760| 09 09 09 30 2e 38 2c 09 | 09 09 09 09 2f 2f 20 62 |...0.8,.|....// b|
|00000770| 72 69 67 68 74 6e 65 73 | 73 0d 09 09 09 7b 20 31 |rightnes|s....{ 1|
|00000780| 2e 30 2c 20 31 2e 30 2c | 20 31 2e 30 20 7d 09 09 |.0, 1.0,| 1.0 }..|
|00000790| 2f 2f 20 63 6f 6c 6f 72 | 20 28 77 68 69 74 65 29 |// color| (white)|
|000007a0| 0d 09 09 7d 2c 0d 09 09 | 6b 51 33 54 72 75 65 2c |...},...|kQ3True,|
|000007b0| 09 09 09 09 09 2f 2f 20 | 63 61 73 74 73 53 68 61 |.....// |castsSha|
|000007c0| 64 6f 77 73 0d 09 09 6b | 51 33 41 74 74 65 6e 75 |dows...k|Q3Attenu|
|000007d0| 61 74 69 6f 6e 54 79 70 | 65 4e 6f 6e 65 2c 09 09 |ationTyp|eNone,..|
|000007e0| 2f 2f 20 61 74 74 65 6e | 75 61 74 69 6f 6e 20 74 |// atten|uation t|
|000007f0| 79 70 65 0d 09 09 7b 20 | 31 30 2e 30 2c 20 30 30 |ype...{ |10.0, 00|
|00000800| 2e 30 2c 20 31 30 2e 30 | 20 7d 09 09 2f 2f 20 70 |.0, 10.0| }..// p|
|00000810| 6f 69 6e 74 20 6c 6f 63 | 61 74 69 6f 6e 0d 09 7d |oint loc|ation..}|
|00000820| 2c 0d 09 7b 0d 09 09 7b | 09 2f 2f 6c 69 67 68 74 |,..{...{|.//light|
|00000830| 44 61 74 61 0d 09 09 09 | 6b 51 33 46 61 6c 73 65 |Data....|kQ3False|
|00000840| 2c 09 09 09 09 2f 2f 20 | 69 73 4f 6e 0d 09 09 09 |,....// |isOn....|
|00000850| 30 2e 38 2c 09 09 09 09 | 09 2f 2f 20 62 72 69 67 |0.8,....|.// brig|
|00000860| 68 74 6e 65 73 73 0d 09 | 09 09 7b 20 31 2e 30 2c |htness..|..{ 1.0,|
|00000870| 20 31 2e 30 2c 20 31 2e | 30 20 7d 09 09 2f 2f 20 | 1.0, 1.|0 }..// |
|00000880| 63 6f 6c 6f 72 20 28 77 | 68 69 74 65 29 0d 09 09 |color (w|hite)...|
|00000890| 7d 2c 0d 09 09 6b 51 33 | 54 72 75 65 2c 09 09 09 |},...kQ3|True,...|
|000008a0| 09 09 2f 2f 20 63 61 73 | 74 73 53 68 61 64 6f 77 |..// cas|tsShadow|
|000008b0| 73 0d 09 09 6b 51 33 41 | 74 74 65 6e 75 61 74 69 |s...kQ3A|ttenuati|
|000008c0| 6f 6e 54 79 70 65 4e 6f | 6e 65 2c 09 09 2f 2f 20 |onTypeNo|ne,..// |
|000008d0| 61 74 74 65 6e 75 61 74 | 69 6f 6e 20 74 79 70 65 |attenuat|ion type|
|000008e0| 0d 09 09 7b 20 30 2c 20 | 2d 31 30 2e 30 2c 20 31 |...{ 0, |-10.0, 1|
|000008f0| 30 2e 30 20 7d 09 09 09 | 2f 2f 20 70 6f 69 6e 74 |0.0 }...|// point|
|00000900| 20 6c 6f 63 61 74 69 6f | 6e 0d 09 7d 2c 0d 09 7b | locatio|n..},..{|
|00000910| 0d 09 09 7b 09 2f 2f 6c | 69 67 68 74 44 61 74 61 |...{.//l|ightData|
|00000920| 0d 09 09 09 6b 51 33 46 | 61 6c 73 65 2c 09 09 09 |....kQ3F|alse,...|
|00000930| 09 2f 2f 20 69 73 4f 6e | 0d 09 09 09 30 2e 38 2c |.// isOn|....0.8,|
|00000940| 09 09 09 09 09 2f 2f 20 | 62 72 69 67 68 74 6e 65 |.....// |brightne|
|00000950| 73 73 0d 09 09 09 7b 20 | 31 2e 30 2c 20 31 2e 30 |ss....{ |1.0, 1.0|
|00000960| 2c 20 31 2e 30 20 7d 09 | 09 2f 2f 20 63 6f 6c 6f |, 1.0 }.|.// colo|
|00000970| 72 20 28 77 68 69 74 65 | 29 0d 09 09 7d 2c 0d 09 |r (white|)...},..|
|00000980| 09 6b 51 33 54 72 75 65 | 2c 09 09 09 09 09 2f 2f |.kQ3True|,.....//|
|00000990| 20 63 61 73 74 73 53 68 | 61 64 6f 77 73 0d 09 09 | castsSh|adows...|
|000009a0| 6b 51 33 41 74 74 65 6e | 75 61 74 69 6f 6e 54 79 |kQ3Atten|uationTy|
|000009b0| 70 65 4e 6f 6e 65 2c 09 | 09 2f 2f 20 61 74 74 65 |peNone,.|.// atte|
|000009c0| 6e 75 61 74 69 6f 6e 20 | 74 79 70 65 0d 09 09 7b |nuation |type...{|
|000009d0| 20 2d 31 30 2e 30 2c 20 | 30 30 2e 30 2c 20 31 30 | -10.0, |00.0, 10|
|000009e0| 2e 30 20 7d 09 09 2f 2f | 20 70 6f 69 6e 74 20 6c |.0 }..//| point l|
|000009f0| 6f 63 61 74 69 6f 6e 0d | 09 7d 0d 7d 3b 0d 0d 0d |ocation.|.}.};...|
|00000a00| 73 74 61 74 69 63 20 54 | 51 33 56 69 65 77 41 6e |static T|Q3ViewAn|
|00000a10| 67 6c 65 41 73 70 65 63 | 74 43 61 6d 65 72 61 44 |gleAspec|tCameraD|
|00000a20| 61 74 61 09 70 6f 69 6e | 74 43 61 6d 44 61 74 61 |ata.poin|tCamData|
|00000a30| 20 3d 0d 09 7b 09 09 0d | 09 09 7b 09 2f 2f 20 63 | =..{...|..{.// c|
|00000a40| 61 6d 65 72 61 44 61 74 | 61 09 0d 09 09 09 7b 09 |ameraDat|a.....{.|
|00000a50| 2f 2f 20 70 6c 61 63 65 | 6d 65 6e 74 0d 09 09 09 |// place|ment....|
|00000a60| 09 7b 63 61 6d 58 2c 20 | 63 61 6d 59 2c 20 63 61 |.{camX, |camY, ca|
|00000a70| 6d 5a 7d 2c 09 09 09 09 | 09 09 09 2f 2f 20 63 61 |mZ},....|...// ca|
|00000a80| 6d 65 72 61 20 6c 6f 63 | 61 74 69 6f 6e 0d 09 09 |mera loc|ation...|
|00000a90| 09 09 7b 20 30 2c 20 30 | 2c 20 30 20 7d 2c 09 09 |..{ 0, 0|, 0 },..|
|00000aa0| 09 09 09 09 09 09 2f 2f | 20 70 6f 69 6e 74 20 6f |......//| point o|
|00000ab0| 66 20 69 6e 74 65 72 65 | 73 74 0d 09 09 09 09 7b |f intere|st.....{|
|00000ac0| 2d 30 2e 35 37 37 33 35 | 30 32 36 39 2c 20 2d 30 |-0.57735|0269, -0|
|00000ad0| 2e 35 37 37 33 35 30 32 | 36 39 2c 20 30 2e 35 37 |.5773502|69, 0.57|
|00000ae0| 37 33 35 30 32 36 39 7d | 09 2f 2f 20 75 70 56 65 |7350269}|.// upVe|
|00000af0| 63 74 6f 72 0d 09 09 09 | 7d 2c 0d 09 09 09 7b 09 |ctor....|},....{.|
|00000b00| 2f 2f 72 61 6e 67 65 0d | 09 09 09 09 30 2e 30 30 |//range.|....0.00|
|00000b10| 31 2c 20 31 30 30 30 2e | 30 09 09 09 09 09 09 09 |1, 1000.|0.......|
|00000b20| 09 2f 2f 20 68 69 74 68 | 65 72 2c 20 79 6f 6e 0d |.// hith|er, yon.|
|00000b30| 09 09 09 7d 2c 0d 09 09 | 09 7b 09 2f 2f 76 69 65 |...},...|.{.//vie|
|00000b40| 77 50 6f 72 74 0d 09 09 | 09 09 7b 20 2d 31 2e 30 |wPort...|..{ -1.0|
|00000b50| 2c 20 31 2e 30 7d 2c 09 | 09 09 09 09 09 09 09 2f |, 1.0},.|......./|
|00000b60| 2f 20 6f 72 69 67 69 6e | 0d 09 09 09 09 32 2e 30 |/ origin|.....2.0|
|00000b70| 2c 20 32 2e 30 09 09 09 | 09 09 09 09 09 09 2f 2f |, 2.0...|......//|
|00000b80| 20 77 69 64 74 68 2c 20 | 68 65 69 67 68 74 0d 09 | width, |height..|
|00000b90| 09 09 7d 0d 09 09 7d 2c | 0d 09 09 63 61 6d 46 4f |..}...},|...camFO|
|00000ba0| 56 2c 09 09 09 09 09 09 | 09 09 09 09 09 09 2f 2f |V,......|......//|
|00000bb0| 20 66 6f 76 20 28 66 69 | 65 6c 64 20 6f 66 20 76 | fov (fi|eld of v|
|00000bc0| 69 65 77 29 0d 09 09 31 | 2e 30 09 09 09 09 09 09 |iew)...1|.0......|
|00000bd0| 09 09 09 09 09 09 09 2f | 2f 20 61 73 70 65 63 74 |......./|/ aspect|
|00000be0| 52 61 74 69 6f 58 54 6f | 59 0d 09 7d 3b 0d 0d 73 |RatioXTo|Y..};..s|
|00000bf0| 74 61 74 69 63 20 54 51 | 33 4f 72 74 68 6f 67 72 |tatic TQ|3Orthogr|
|00000c00| 61 70 68 69 63 43 61 6d | 65 72 61 44 61 74 61 20 |aphicCam|eraData |
|00000c10| 6f 72 74 68 6f 43 61 6d | 44 61 74 61 20 3d 0d 09 |orthoCam|Data =..|
|00000c20| 7b 0d 09 09 7b 09 2f 2f | 20 63 61 6d 65 72 61 44 |{...{.//| cameraD|
|00000c30| 61 74 61 09 0d 09 09 09 | 7b 09 2f 2f 20 70 6c 61 |ata.....|{.// pla|
|00000c40| 63 65 6d 65 6e 74 0d 09 | 09 09 09 7b 63 61 6d 58 |cement..|...{camX|
|00000c50| 2c 20 63 61 6d 59 2c 20 | 63 61 6d 5a 7d 2c 09 09 |, camY, |camZ},..|
|00000c60| 09 09 09 09 09 2f 2f 20 | 63 61 6d 65 72 61 20 6c |.....// |camera l|
|00000c70| 6f 63 61 74 69 6f 6e 0d | 09 09 09 09 7b 20 30 2c |ocation.|....{ 0,|
|00000c80| 20 30 2c 20 30 20 7d 2c | 09 09 09 09 09 09 09 09 | 0, 0 },|........|
|00000c90| 2f 2f 20 70 6f 69 6e 74 | 20 6f 66 20 69 6e 74 65 |// point| of inte|
|00000ca0| 72 65 73 74 0d 09 09 09 | 09 7b 2d 30 2e 35 37 37 |rest....|.{-0.577|
|00000cb0| 33 35 30 32 36 39 2c 20 | 2d 30 2e 35 37 37 33 35 |350269, |-0.57735|
|00000cc0| 30 32 36 39 2c 20 30 2e | 35 37 37 33 35 30 32 36 |0269, 0.|57735026|
|00000cd0| 39 7d 09 2f 2f 20 75 70 | 56 65 63 74 6f 72 0d 09 |9}.// up|Vector..|
|00000ce0| 09 09 7d 2c 0d 09 09 09 | 7b 09 2f 2f 72 61 6e 67 |..},....|{.//rang|
|00000cf0| 65 0d 09 09 09 09 30 2e | 30 30 31 2c 20 31 30 30 |e.....0.|001, 100|
|00000d00| 30 2e 30 09 09 09 09 09 | 09 09 09 2f 2f 20 68 69 |0.0.....|...// hi|
|00000d10| 74 68 65 72 2c 20 79 6f | 6e 0d 09 09 09 7d 2c 0d |ther, yo|n....},.|
|00000d20| 09 09 09 7b 09 2f 2f 76 | 69 65 77 50 6f 72 74 0d |...{.//v|iewPort.|
|00000d30| 09 09 09 09 7b 20 2d 31 | 2e 30 2c 20 31 2e 30 7d |....{ -1|.0, 1.0}|
|00000d40| 2c 09 09 09 09 09 09 09 | 09 2f 2f 20 6f 72 69 67 |,.......|.// orig|
|00000d50| 69 6e 0d 09 09 09 09 32 | 2e 30 2c 20 32 2e 30 09 |in.....2|.0, 2.0.|
|00000d60| 09 09 09 09 09 09 09 09 | 2f 2f 20 77 69 64 74 68 |........|// width|
|00000d70| 2c 20 68 65 69 67 68 74 | 0d 09 09 09 7d 0d 09 09 |, height|....}...|
|00000d80| 7d 2c 0d 09 09 2d 63 61 | 6d 57 48 2c 20 63 61 6d |},...-ca|mWH, cam|
|00000d90| 57 48 2c 20 63 61 6d 57 | 48 2c 20 2d 63 61 6d 57 |WH, camW|H, -camW|
|00000da0| 48 09 09 09 09 09 09 2f | 2f 20 6c 65 66 74 2c 74 |H....../|/ left,t|
|00000db0| 6f 70 2c 72 69 67 68 74 | 2c 62 6f 74 74 6f 6d 0d |op,right|,bottom.|
|00000dc0| 09 7d 3b 0d 0d 0d 73 74 | 61 74 69 63 20 42 6f 6f |.};...st|atic Boo|
|00000dd0| 6c 65 61 6e 20 53 68 69 | 66 74 50 72 65 73 73 65 |lean Shi|ftPresse|
|00000de0| 64 28 29 0d 7b 0d 09 4b | 65 79 4d 61 70 20 6d 79 |d().{..K|eyMap my|
|00000df0| 4b 65 79 3b 0d 09 47 65 | 74 4b 65 79 73 28 6d 79 |Key;..Ge|tKeys(my|
|00000e00| 4b 65 79 29 3b 0d 09 72 | 65 74 75 72 6e 20 28 6d |Key);..r|eturn (m|
|00000e10| 79 4b 65 79 5b 31 5d 26 | 30 78 30 30 30 31 29 20 |yKey[1]&|0x0001) |
|00000e20| 21 3d 20 30 3b 09 0d 7d | 2f 2f 20 53 68 69 66 74 |!= 0;..}|// Shift|
|00000e30| 50 72 65 73 73 65 64 0d | 0d 73 74 61 74 69 63 20 |Pressed.|.static |
|00000e40| 42 6f 6f 6c 65 61 6e 20 | 4f 70 74 69 6f 6e 50 72 |Boolean |OptionPr|
|00000e50| 65 73 73 65 64 28 29 0d | 7b 0d 09 4b 65 79 4d 61 |essed().|{..KeyMa|
|00000e60| 70 20 6d 79 4b 65 79 3b | 0d 09 47 65 74 4b 65 79 |p myKey;|..GetKey|
|00000e70| 73 28 6d 79 4b 65 79 29 | 3b 0d 09 72 65 74 75 72 |s(myKey)|;..retur|
|00000e80| 6e 20 28 6d 79 4b 65 79 | 5b 31 5d 26 30 78 30 30 |n (myKey|[1]&0x00|
|00000e90| 30 34 29 20 21 3d 20 30 | 3b 09 0d 7d 2f 2f 20 4f |04) != 0|;..}// O|
|00000ea0| 70 74 69 6f 6e 50 72 65 | 73 73 65 64 0d 0d 73 74 |ptionPre|ssed..st|
|00000eb0| 61 74 69 63 20 42 6f 6f | 6c 65 61 6e 20 43 6f 6d |atic Boo|lean Com|
|00000ec0| 6d 61 6e 64 50 72 65 73 | 73 65 64 28 29 0d 7b 0d |mandPres|sed().{.|
|00000ed0| 09 4b 65 79 4d 61 70 20 | 6d 79 4b 65 79 3b 0d 09 |.KeyMap |myKey;..|
|00000ee0| 47 65 74 4b 65 79 73 28 | 6d 79 4b 65 79 29 3b 0d |GetKeys(|myKey);.|
|00000ef0| 09 72 65 74 75 72 6e 20 | 28 6d 79 4b 65 79 5b 31 |.return |(myKey[1|
|00000f00| 5d 26 30 78 30 38 30 30 | 30 29 20 21 3d 20 30 3b |]&0x0800|0) != 0;|
|00000f10| 09 0d 7d 2f 2f 20 43 6f | 6d 6d 61 6e 64 50 72 65 |..}// Co|mmandPre|
|00000f20| 73 73 65 64 0d 0d 23 70 | 72 61 67 6d 61 20 6d 61 |ssed..#p|ragma ma|
|00000f30| 72 6b 20 2d 0d 0d 73 74 | 61 74 69 63 20 76 6f 69 |rk -..st|atic voi|
|00000f40| 64 20 53 65 74 75 70 43 | 61 6d 65 72 61 73 28 50 |d SetupC|ameras(P|
|00000f50| 33 56 69 65 77 65 72 44 | 61 74 61 2a 20 63 6f 6e |3ViewerD|ata* con|
|00000f60| 73 74 20 76 69 65 77 65 | 72 29 0d 09 2f 2f 20 75 |st viewe|r)..// u|
|00000f70| 73 65 73 20 74 68 65 20 | 64 61 74 61 20 69 6e 20 |ses the |data in |
|00000f80| 70 6f 69 6e 74 43 61 6d | 44 61 74 61 20 66 6f 72 |pointCam|Data for|
|00000f90| 20 63 61 6c 63 75 6c 61 | 74 69 6e 67 20 63 6f 72 | calcula|ting cor|
|00000fa0| 72 65 73 70 6f 6e 64 69 | 6e 67 20 76 61 6c 75 65 |respondi|ng value|
|00000fb0| 73 0d 09 2f 2f 20 69 6e | 20 6f 72 74 68 6f 43 61 |s..// in| orthoCa|
|00000fc0| 6d 44 61 74 61 2e 20 54 | 68 65 6e 20 73 65 74 73 |mData. T|hen sets|
|00000fd0| 20 62 6f 74 68 20 63 61 | 6d 65 72 61 73 20 61 63 | both ca|meras ac|
|00000fe0| 63 6f 72 64 69 6e 67 6c | 79 0d 7b 0d 09 54 51 33 |cordingl|y.{..TQ3|
|00000ff0| 56 65 63 74 6f 72 33 44 | 09 63 61 6d 65 72 61 56 |Vector3D|.cameraV|
|00001000| 65 63 74 6f 72 3b 0d 09 | 66 6c 6f 61 74 09 68 76 |ector;..|float.hv|
|00001010| 3b 0d 0d 09 51 33 50 6f | 69 6e 74 33 44 5f 53 75 |;...Q3Po|int3D_Su|
|00001020| 62 74 72 61 63 74 28 26 | 70 6f 69 6e 74 43 61 6d |btract(&|pointCam|
|00001030| 44 61 74 61 2e 63 61 6d | 65 72 61 44 61 74 61 2e |Data.cam|eraData.|
|00001040| 70 6c 61 63 65 6d 65 6e | 74 2e 63 61 6d 65 72 61 |placemen|t.camera|
|00001050| 4c 6f 63 61 74 69 6f 6e | 2c 0d 09 09 09 09 09 20 |Location|,...... |
|00001060| 20 20 26 70 6f 69 6e 74 | 43 61 6d 44 61 74 61 2e | &point|CamData.|
|00001070| 63 61 6d 65 72 61 44 61 | 74 61 2e 70 6c 61 63 65 |cameraDa|ta.place|
|00001080| 6d 65 6e 74 2e 70 6f 69 | 6e 74 4f 66 49 6e 74 65 |ment.poi|ntOfInte|
|00001090| 72 65 73 74 2c 0d 09 09 | 09 09 09 20 20 20 26 63 |rest,...|... &c|
|000010a0| 61 6d 65 72 61 56 65 63 | 74 6f 72 29 3b 0d 09 68 |ameraVec|tor);..h|
|000010b0| 76 20 3d 20 51 33 56 65 | 63 74 6f 72 33 44 5f 4c |v = Q3Ve|ctor3D_L|
|000010c0| 65 6e 67 74 68 28 26 63 | 61 6d 65 72 61 56 65 63 |ength(&c|ameraVec|
|000010d0| 74 6f 72 29 20 2a 20 74 | 61 6e 28 70 6f 69 6e 74 |tor) * t|an(point|
|000010e0| 43 61 6d 44 61 74 61 2e | 66 6f 76 2f 32 29 3b 0d |CamData.|fov/2);.|
|000010f0| 09 6f 72 74 68 6f 43 61 | 6d 44 61 74 61 2e 6c 65 |.orthoCa|mData.le|
|00001100| 66 74 20 3d 20 2d 68 76 | 3b 0d 09 6f 72 74 68 6f |ft = -hv|;..ortho|
|00001110| 43 61 6d 44 61 74 61 2e | 74 6f 70 20 3d 20 68 76 |CamData.|top = hv|
|00001120| 3b 0d 09 6f 72 74 68 6f | 43 61 6d 44 61 74 61 2e |;..ortho|CamData.|
|00001130| 72 69 67 68 74 20 3d 20 | 68 76 3b 0d 09 6f 72 74 |right = |hv;..ort|
|00001140| 68 6f 43 61 6d 44 61 74 | 61 2e 62 6f 74 74 6f 6d |hoCamDat|a.bottom|
|00001150| 20 3d 20 2d 68 76 3b 0d | 09 6f 72 74 68 6f 43 61 | = -hv;.|.orthoCa|
|00001160| 6d 44 61 74 61 2e 63 61 | 6d 65 72 61 44 61 74 61 |mData.ca|meraData|
|00001170| 20 3d 20 70 6f 69 6e 74 | 43 61 6d 44 61 74 61 2e | = point|CamData.|
|00001180| 63 61 6d 65 72 61 44 61 | 74 61 3b 0d 0d 09 51 33 |cameraDa|ta;...Q3|
|00001190| 56 69 65 77 41 6e 67 6c | 65 41 73 70 65 63 74 43 |ViewAngl|eAspectC|
|000011a0| 61 6d 65 72 61 5f 53 65 | 74 44 61 74 61 28 76 69 |amera_Se|tData(vi|
|000011b0| 65 77 65 72 2d 3e 70 6f | 69 6e 74 43 61 6d 2c 20 |ewer->po|intCam, |
|000011c0| 26 70 6f 69 6e 74 43 61 | 6d 44 61 74 61 29 3b 0d |&pointCa|mData);.|
|000011d0| 09 51 33 4f 72 74 68 6f | 67 72 61 70 68 69 63 43 |.Q3Ortho|graphicC|
|000011e0| 61 6d 65 72 61 5f 53 65 | 74 44 61 74 61 28 76 69 |amera_Se|tData(vi|
|000011f0| 65 77 65 72 2d 3e 6f 72 | 74 68 6f 43 61 6d 2c 20 |ewer->or|thoCam, |
|00001200| 26 6f 72 74 68 6f 43 61 | 6d 44 61 74 61 29 3b 0d |&orthoCa|mData);.|
|00001210| 0d 09 69 66 20 28 76 69 | 65 77 65 72 2d 3e 70 61 |..if (vi|ewer->pa|
|00001220| 72 61 6c 6c 65 6c 29 0d | 09 09 51 33 56 69 65 77 |rallel).|..Q3View|
|00001230| 5f 53 65 74 43 61 6d 65 | 72 61 28 76 69 65 77 65 |_SetCame|ra(viewe|
|00001240| 72 2d 3e 76 69 65 77 2c | 20 76 69 65 77 65 72 2d |r->view,| viewer-|
|00001250| 3e 6f 72 74 68 6f 43 61 | 6d 29 3b 0d 09 65 6c 73 |>orthoCa|m);..els|
|00001260| 65 0d 09 09 51 33 56 69 | 65 77 5f 53 65 74 43 61 |e...Q3Vi|ew_SetCa|
|00001270| 6d 65 72 61 28 76 69 65 | 77 65 72 2d 3e 76 69 65 |mera(vie|wer->vie|
|00001280| 77 2c 20 76 69 65 77 65 | 72 2d 3e 70 6f 69 6e 74 |w, viewe|r->point|
|00001290| 43 61 6d 29 3b 0d 7d 0d | 0d 73 74 61 74 69 63 20 |Cam);.}.|.static |
|000012a0| 76 6f 69 64 20 51 33 4f | 62 6a 65 63 74 5f 44 69 |void Q3O|bject_Di|
|000012b0| 73 70 6f 73 65 49 66 4e | 6f 74 4e 69 6c 28 54 51 |sposeIfN|otNil(TQ|
|000012c0| 33 4f 62 6a 65 63 74 20 | 6f 62 6a 29 0d 09 2f 2f |3Object |obj)..//|
|000012d0| 20 64 69 73 70 6f 73 65 | 73 20 6f 62 6a 20 69 66 | dispose|s obj if|
|000012e0| 20 69 74 20 69 73 20 6e | 6f 74 20 4e 55 4c 4c 0d | it is n|ot NULL.|
|000012f0| 7b 0d 09 69 66 20 28 6f | 62 6a 20 21 3d 20 4e 55 |{..if (o|bj != NU|
|00001300| 4c 4c 29 20 51 33 4f 62 | 6a 65 63 74 5f 44 69 73 |LL) Q3Ob|ject_Dis|
|00001310| 70 6f 73 65 28 6f 62 6a | 29 3b 0d 7d 0d 0d 73 74 |pose(obj|);.}..st|
|00001320| 61 74 69 63 20 42 6f 6f | 6c 65 61 6e 20 51 33 4d |atic Boo|lean Q3M|
|00001330| 61 74 72 69 78 34 78 34 | 5f 43 6f 6d 70 61 72 65 |atrix4x4|_Compare|
|00001340| 28 54 51 33 4d 61 74 72 | 69 78 34 78 34 2a 20 6d |(TQ3Matr|ix4x4* m|
|00001350| 31 2c 20 54 51 33 4d 61 | 74 72 69 78 34 78 34 2a |1, TQ3Ma|trix4x4*|
|00001360| 20 6d 32 29 0d 09 2f 2f | 20 72 65 74 75 72 6e 73 | m2)..//| returns|
|00001370| 20 74 72 75 65 20 69 66 | 20 6d 31 3d 6d 32 0d 7b | true if| m1=m2.{|
|00001380| 0d 09 69 6e 74 09 69 2c | 6a 3b 0d 09 66 6f 72 20 |..int.i,|j;..for |
|00001390| 28 69 3d 30 3b 20 69 3c | 34 3b 20 69 2b 2b 29 0d |(i=0; i<|4; i++).|
|000013a0| 09 09 66 6f 72 20 28 6a | 3d 30 3b 20 6a 3c 34 3b |..for (j|=0; j<4;|
|000013b0| 20 6a 2b 2b 29 0d 09 09 | 09 69 66 20 28 6d 31 2d | j++)...|.if (m1-|
|000013c0| 3e 76 61 6c 75 65 5b 69 | 5d 5b 6a 5d 20 21 3d 20 |>value[i|][j] != |
|000013d0| 6d 32 2d 3e 76 61 6c 75 | 65 5b 69 5d 5b 6a 5d 29 |m2->valu|e[i][j])|
|000013e0| 0d 09 09 09 09 72 65 74 | 75 72 6e 20 66 61 6c 73 |.....ret|urn fals|
|000013f0| 65 3b 0d 09 72 65 74 75 | 72 6e 20 74 72 75 65 3b |e;..retu|rn true;|
|00001400| 0d 7d 0d 0d 0d 0d 0d 23 | 70 72 61 67 6d 61 20 6d |.}.....#|pragma m|
|00001410| 61 72 6b 20 2d 0d 0d 73 | 74 61 74 69 63 20 76 6f |ark -..s|tatic vo|
|00001420| 69 64 20 50 33 56 69 65 | 77 65 72 43 68 65 63 6b |id P3Vie|werCheck|
|00001430| 52 6f 74 61 74 69 6f 6e | 28 50 33 56 69 65 77 65 |Rotation|(P3Viewe|
|00001440| 72 44 61 74 61 2a 20 63 | 6f 6e 73 74 20 76 69 65 |rData* c|onst vie|
|00001450| 77 65 72 29 0d 2f 2f 09 | 69 66 20 76 69 65 77 65 |wer).//.|if viewe|
|00001460| 72 2d 3e 7a 56 65 72 74 | 69 63 61 6c 3a 20 6d 61 |r->zVert|ical: ma|
|00001470| 6b 65 73 20 73 75 72 65 | 20 74 68 61 74 20 74 68 |kes sure| that th|
|00001480| 65 20 6d 61 74 72 69 78 | 20 72 6f 74 61 74 69 6f |e matrix| rotatio|
|00001490| 6e 20 72 6f 74 61 74 65 | 73 20 69 6e 20 73 75 63 |n rotate|s in suc|
|000014a0| 68 20 61 20 77 61 79 20 | 74 68 61 74 20 7a 20 72 |h a way |that z r|
|000014b0| 65 6d 61 69 6e 73 20 76 | 65 72 74 69 63 61 6c 0d |emains v|ertical.|
|000014c0| 7b 0d 09 69 66 20 28 47 | 65 74 43 6f 6e 74 72 6f |{..if (G|etContro|
|000014d0| 6c 56 61 6c 75 65 28 76 | 69 65 77 65 72 2d 3e 7a |lValue(v|iewer->z|
|000014e0| 56 65 72 74 69 63 61 6c | 43 74 6c 29 29 0d 09 7b |Vertical|Ctl))..{|
|000014f0| 0d 09 09 73 74 61 74 69 | 63 20 63 6f 6e 73 74 20 |...stati|c const |
|00001500| 54 51 33 56 65 63 74 6f | 72 33 44 20 7a 56 65 63 |TQ3Vecto|r3D zVec|
|00001510| 74 6f 72 20 3d 20 7b 30 | 2c 30 2c 31 7d 3b 0d 09 |tor = {0|,0,1};..|
|00001520| 09 54 51 33 56 65 63 74 | 6f 72 33 44 09 7a 3b 0d |.TQ3Vect|or3D.z;.|
|00001530| 09 09 54 51 33 56 65 63 | 74 6f 72 33 44 09 6e 3b |..TQ3Vec|tor3D.n;|
|00001540| 0d 09 09 66 6c 6f 61 74 | 09 09 6c 65 6e 3b 0d 0d |...float|..len;..|
|00001550| 09 09 51 33 56 65 63 74 | 6f 72 33 44 5f 54 72 61 |..Q3Vect|or3D_Tra|
|00001560| 6e 73 66 6f 72 6d 28 26 | 7a 56 65 63 74 6f 72 2c |nsform(&|zVector,|
|00001570| 20 26 72 6f 74 61 74 69 | 6f 6e 2c 20 26 7a 29 3b | &rotati|on, &z);|
|00001580| 0d 0d 09 09 51 33 50 6f | 69 6e 74 33 44 5f 53 75 |....Q3Po|int3D_Su|
|00001590| 62 74 72 61 63 74 28 09 | 26 70 6f 69 6e 74 43 61 |btract(.|&pointCa|
|000015a0| 6d 44 61 74 61 2e 63 61 | 6d 65 72 61 44 61 74 61 |mData.ca|meraData|
|000015b0| 2e 70 6c 61 63 65 6d 65 | 6e 74 2e 70 6f 69 6e 74 |.placeme|nt.point|
|000015c0| 4f 66 49 6e 74 65 72 65 | 73 74 2c 0d 09 09 09 09 |OfIntere|st,.....|
|000015d0| 09 09 09 26 70 6f 69 6e | 74 43 61 6d 44 61 74 61 |...&poin|tCamData|
|000015e0| 2e 63 61 6d 65 72 61 44 | 61 74 61 2e 70 6c 61 63 |.cameraD|ata.plac|
|000015f0| 65 6d 65 6e 74 2e 63 61 | 6d 65 72 61 4c 6f 63 61 |ement.ca|meraLoca|
|00001600| 74 69 6f 6e 2c 20 26 6e | 29 3b 0d 09 09 51 33 56 |tion, &n|);...Q3V|
|00001610| 65 63 74 6f 72 33 44 5f | 43 72 6f 73 73 28 26 70 |ector3D_|Cross(&p|
|00001620| 6f 69 6e 74 43 61 6d 44 | 61 74 61 2e 63 61 6d 65 |ointCamD|ata.came|
|00001630| 72 61 44 61 74 61 2e 70 | 6c 61 63 65 6d 65 6e 74 |raData.p|lacement|
|00001640| 2e 75 70 56 65 63 74 6f | 72 2c 20 26 6e 2c 20 26 |.upVecto|r, &n, &|
|00001650| 6e 29 3b 0d 09 09 51 33 | 56 65 63 74 6f 72 33 44 |n);...Q3|Vector3D|
|00001660| 5f 4e 6f 72 6d 61 6c 69 | 7a 65 28 26 6e 2c 20 26 |_Normali|ze(&n, &|
|00001670| 6e 29 3b 0d 09 09 51 33 | 56 65 63 74 6f 72 33 44 |n);...Q3|Vector3D|
|00001680| 5f 53 63 61 6c 65 28 26 | 6e 2c 20 2d 51 33 56 65 |_Scale(&|n, -Q3Ve|
|00001690| 63 74 6f 72 33 44 5f 44 | 6f 74 28 26 7a 2c 20 26 |ctor3D_D|ot(&z, &|
|000016a0| 6e 29 2c 20 26 6e 29 3b | 0d 09 09 51 33 56 65 63 |n), &n);|...Q3Vec|
|000016b0| 74 6f 72 33 44 5f 41 64 | 64 28 26 6e 2c 20 26 7a |tor3D_Ad|d(&n, &z|
|000016c0| 2c 20 26 6e 29 3b 0d 09 | 09 6c 65 6e 20 3d 20 51 |, &n);..|.len = Q|
|000016d0| 33 56 65 63 74 6f 72 33 | 44 5f 4c 65 6e 67 74 68 |3Vector3|D_Length|
|000016e0| 28 26 6e 29 3b 0d 09 09 | 69 66 20 28 6c 65 6e 20 |(&n);...|if (len |
|000016f0| 3e 20 31 65 2d 34 29 09 | 09 09 09 09 09 0d 09 09 |> 1e-4).|........|
|00001700| 7b 0d 09 09 09 54 51 33 | 4d 61 74 72 69 78 34 78 |{....TQ3|Matrix4x|
|00001710| 34 09 6d 3b 0d 09 09 09 | 51 33 56 65 63 74 6f 72 |4.m;....|Q3Vector|
|00001720| 33 44 5f 53 63 61 6c 65 | 28 26 6e 2c 20 31 2f 6c |3D_Scale|(&n, 1/l|
|00001730| 65 6e 2c 20 26 6e 29 3b | 09 09 2f 2f 20 6e 6f 72 |en, &n);|..// nor|
|00001740| 6d 61 6c 69 7a 65 0d 09 | 09 09 51 33 56 65 63 74 |malize..|..Q3Vect|
|00001750| 6f 72 33 44 5f 4e 6f 72 | 6d 61 6c 69 7a 65 28 26 |or3D_Nor|malize(&|
|00001760| 7a 2c 20 26 7a 29 3b 09 | 09 09 2f 2f 20 6e 6f 72 |z, &z);.|..// nor|
|00001770| 6d 61 6c 69 7a 65 20 28 | 72 6f 75 6e 64 69 6e 67 |malize (|rounding|
|00001780| 20 65 72 72 6f 72 73 29 | 0d 09 09 09 51 33 4d 61 | errors)|....Q3Ma|
|00001790| 74 72 69 78 34 78 34 5f | 53 65 74 52 6f 74 61 74 |trix4x4_|SetRotat|
|000017a0| 65 56 65 63 74 6f 72 54 | 6f 56 65 63 74 6f 72 28 |eVectorT|oVector(|
|000017b0| 26 6d 2c 20 26 7a 2c 20 | 26 6e 29 3b 0d 09 09 09 |&m, &z, |&n);....|
|000017c0| 51 33 4d 61 74 72 69 78 | 34 78 34 5f 4d 75 6c 74 |Q3Matrix|4x4_Mult|
|000017d0| 69 70 6c 79 28 26 72 6f | 74 61 74 69 6f 6e 2c 20 |iply(&ro|tation, |
|000017e0| 26 6d 2c 20 26 72 6f 74 | 61 74 69 6f 6e 29 3b 0d |&m, &rot|ation);.|
|000017f0| 09 09 7d 0d 09 7d 0d 7d | 0d 09 0d 76 6f 69 64 20 |..}..}.}|...void |
|00001800| 50 33 56 69 65 77 65 72 | 55 73 65 47 72 6f 75 70 |P3Viewer|UseGroup|
|00001810| 28 50 33 56 69 65 77 65 | 72 44 61 74 61 2a 20 63 |(P3Viewe|rData* c|
|00001820| 6f 6e 73 74 20 76 69 65 | 77 65 72 2c 20 54 51 33 |onst vie|wer, TQ3|
|00001830| 47 72 6f 75 70 4f 62 6a | 65 63 74 09 67 72 6f 75 |GroupObj|ect.grou|
|00001840| 70 29 0d 09 2f 2f 20 73 | 68 6f 77 20 74 68 65 20 |p)..// s|how the |
|00001850| 67 69 76 65 6e 20 67 72 | 6f 75 70 20 28 44 69 73 |given gr|oup (Dis|
|00001860| 70 6f 73 65 73 20 61 6e | 79 20 65 78 69 73 74 69 |poses an|y existi|
|00001870| 6e 67 20 67 72 6f 75 70 | 29 0d 7b 0d 2f 2f 09 51 |ng group|).{.//.Q|
|00001880| 33 4f 62 6a 65 63 74 5f | 44 69 73 70 6f 73 65 49 |3Object_|DisposeI|
|00001890| 66 4e 6f 74 4e 69 6c 28 | 76 69 65 77 65 72 2d 3e |fNotNil(|viewer->|
|000018a0| 67 72 6f 75 70 29 3b 0d | 09 76 69 65 77 65 72 2d |group);.|.viewer-|
|000018b0| 3e 67 72 6f 75 70 20 3d | 20 67 72 6f 75 70 3b 0d |>group =| group;.|
|000018c0| 09 50 33 56 69 65 77 65 | 72 49 6e 76 61 6c 69 64 |.P3Viewe|rInvalid|
|000018d0| 61 74 65 28 76 69 65 77 | 65 72 29 3b 0d 7d 0d 0d |ate(view|er);.}..|
|000018e0| 76 6f 69 64 20 50 33 56 | 69 65 77 65 72 49 6e 76 |void P3V|iewerInv|
|000018f0| 61 6c 69 64 61 74 65 28 | 50 33 56 69 65 77 65 72 |alidate(|P3Viewer|
|00001900| 44 61 74 61 2a 20 63 6f | 6e 73 74 20 76 69 65 77 |Data* co|nst view|
|00001910| 65 72 29 0d 09 2f 2f 20 | 69 6e 76 61 6c 69 64 61 |er)..// |invalida|
|00001920| 74 65 73 20 74 68 65 20 | 76 69 65 77 65 72 20 63 |tes the |viewer c|
|00001930| 6f 6e 74 65 6e 74 73 0d | 7b 0d 09 47 72 61 66 50 |ontents.|{..GrafP|
|00001940| 74 72 09 6f 6c 64 50 6f | 72 74 3b 0d 09 47 65 74 |tr.oldPo|rt;..Get|
|00001950| 50 6f 72 74 28 26 6f 6c | 64 50 6f 72 74 29 3b 0d |Port(&ol|dPort);.|
|00001960| 09 53 65 74 50 6f 72 74 | 28 28 47 72 61 66 50 74 |.SetPort|((GrafPt|
|00001970| 72 29 47 65 74 57 69 6e | 64 6f 77 50 6f 72 74 28 |r)GetWin|dowPort(|
|00001980| 76 69 65 77 65 72 2d 3e | 77 69 6e 64 6f 77 29 29 |viewer->|window))|
|00001990| 3b 0d 09 49 6e 76 61 6c | 52 65 63 74 28 26 76 69 |;..Inval|Rect(&vi|
|000019a0| 65 77 65 72 2d 3e 76 69 | 65 77 52 65 63 74 29 3b |ewer->vi|ewRect);|
|000019b0| 0d 09 53 65 74 50 6f 72 | 74 28 6f 6c 64 50 6f 72 |..SetPor|t(oldPor|
|000019c0| 74 29 3b 0d 7d 0d 0d 0d | 73 74 61 74 69 63 20 54 |t);.}...|static T|
|000019d0| 51 33 53 74 61 74 75 73 | 20 50 33 56 69 65 77 65 |Q3Status| P3Viewe|
|000019e0| 72 53 75 62 6d 69 74 28 | 50 33 56 69 65 77 65 72 |rSubmit(|P3Viewer|
|000019f0| 44 61 74 61 2a 20 63 6f | 6e 73 74 20 76 69 65 77 |Data* co|nst view|
|00001a00| 65 72 29 0d 09 2f 2f 20 | 77 68 61 74 20 69 73 20 |er)..// |what is |
|00001a10| 69 6e 20 6f 75 72 20 73 | 75 62 6d 69 74 20 6c 6f |in our s|ubmit lo|
|00001a20| 6f 70 0d 7b 0d 2f 2f 09 | 09 51 33 53 74 79 6c 65 |op.{.//.|.Q3Style|
|00001a30| 5f 53 75 62 6d 69 74 28 | 20 74 68 65 44 6f 63 75 |_Submit(| theDocu|
|00001a40| 6d 65 6e 74 2d 3e 66 49 | 6e 74 65 72 70 6f 6c 61 |ment->fI|nterpola|
|00001a50| 74 69 6f 6e 2c 20 74 68 | 65 44 6f 63 75 6d 65 6e |tion, th|eDocumen|
|00001a60| 74 2d 3e 66 56 69 65 77 | 20 29 3b 0d 2f 2f 09 09 |t->fView| );.//..|
|00001a70| 51 33 53 74 79 6c 65 5f | 53 75 62 6d 69 74 28 20 |Q3Style_|Submit( |
|00001a80| 74 68 65 44 6f 63 75 6d | 65 6e 74 2d 3e 66 42 61 |theDocum|ent->fBa|
|00001a90| 63 6b 46 61 63 69 6e 67 | 2c 20 74 68 65 44 6f 63 |ckFacing|, theDoc|
|00001aa0| 75 6d 65 6e 74 2d 3e 66 | 56 69 65 77 20 29 3b 0d |ument->f|View );.|
|00001ab0| 2f 2f 09 09 51 33 53 74 | 79 6c 65 5f 53 75 62 6d |//..Q3St|yle_Subm|
|00001ac0| 69 74 28 20 74 68 65 44 | 6f 63 75 6d 65 6e 74 2d |it( theD|ocument-|
|00001ad0| 3e 66 46 69 6c 6c 53 74 | 79 6c 65 2c 20 74 68 65 |>fFillSt|yle, the|
|00001ae0| 44 6f 63 75 6d 65 6e 74 | 2d 3e 66 56 69 65 77 20 |Document|->fView |
|00001af0| 29 3b 0d 09 69 66 20 28 | 51 33 4d 61 74 72 69 78 |);..if (|Q3Matrix|
|00001b00| 54 72 61 6e 73 66 6f 72 | 6d 5f 53 75 62 6d 69 74 |Transfor|m_Submit|
|00001b10| 28 26 72 6f 74 61 74 69 | 6f 6e 2c 20 76 69 65 77 |(&rotati|on, view|
|00001b20| 65 72 2d 3e 76 69 65 77 | 29 20 3d 3d 20 6b 51 33 |er->view|) == kQ3|
|00001b30| 46 61 69 6c 75 72 65 29 | 0d 09 09 72 65 74 75 72 |Failure)|...retur|
|00001b40| 6e 20 6b 51 33 46 61 69 | 6c 75 72 65 3b 0d 09 69 |n kQ3Fai|lure;..i|
|00001b50| 66 20 28 51 33 44 69 73 | 70 6c 61 79 47 72 6f 75 |f (Q3Dis|playGrou|
|00001b60| 70 5f 53 75 62 6d 69 74 | 28 76 69 65 77 65 72 2d |p_Submit|(viewer-|
|00001b70| 3e 67 72 6f 75 70 2c 20 | 76 69 65 77 65 72 2d 3e |>group, |viewer->|
|00001b80| 76 69 65 77 29 20 3d 3d | 20 6b 51 33 46 61 69 6c |view) ==| kQ3Fail|
|00001b90| 75 72 65 29 0d 09 09 72 | 65 74 75 72 6e 20 6b 51 |ure)...r|eturn kQ|
|00001ba0| 33 46 61 69 6c 75 72 65 | 3b 0d 09 72 65 74 75 72 |3Failure|;..retur|
|00001bb0| 6e 20 6b 51 33 53 75 63 | 63 65 73 73 3b 0d 7d 0d |n kQ3Suc|cess;.}.|
|00001bc0| 0d 73 74 61 74 69 63 20 | 54 51 33 53 74 61 74 75 |.static |TQ3Statu|
|00001bd0| 73 20 50 33 56 69 65 77 | 65 72 52 65 6e 64 65 72 |s P3View|erRender|
|00001be0| 28 50 33 56 69 65 77 65 | 72 44 61 74 61 2a 20 63 |(P3Viewe|rData* c|
|00001bf0| 6f 6e 73 74 20 76 69 65 | 77 65 72 29 0d 7b 0d 09 |onst vie|wer).{..|
|00001c00| 51 33 56 69 65 77 5f 53 | 74 61 72 74 52 65 6e 64 |Q3View_S|tartRend|
|00001c10| 65 72 69 6e 67 28 76 69 | 65 77 65 72 2d 3e 76 69 |ering(vi|ewer->vi|
|00001c20| 65 77 29 3b 0d 09 64 6f | 0d 09 7b 09 69 66 20 28 |ew);..do|..{.if (|
|00001c30| 50 33 56 69 65 77 65 72 | 53 75 62 6d 69 74 28 76 |P3Viewer|Submit(v|
|00001c40| 69 65 77 65 72 29 20 3d | 3d 20 6b 51 33 46 61 69 |iewer) =|= kQ3Fai|
|00001c50| 6c 75 72 65 29 20 72 65 | 74 75 72 6e 20 6b 51 33 |lure) re|turn kQ3|
|00001c60| 46 61 69 6c 75 72 65 3b | 0d 09 7d 20 77 68 69 6c |Failure;|..} whil|
|00001c70| 65 20 28 51 33 56 69 65 | 77 5f 45 6e 64 52 65 6e |e (Q3Vie|w_EndRen|
|00001c80| 64 65 72 69 6e 67 28 76 | 69 65 77 65 72 2d 3e 76 |dering(v|iewer->v|
|00001c90| 69 65 77 29 20 3d 3d 20 | 6b 51 33 56 69 65 77 53 |iew) == |kQ3ViewS|
|00001ca0| 74 61 74 75 73 52 65 74 | 72 61 76 65 72 73 65 29 |tatusRet|raverse)|
|00001cb0| 3b 0d 09 72 65 74 75 72 | 6e 20 6b 51 33 53 75 63 |;..retur|n kQ3Suc|
|00001cc0| 63 65 73 73 3b 0d 7d 0d | 0d 0d 73 74 61 74 69 63 |cess;.}.|..static|
|00001cd0| 20 76 6f 69 64 20 50 33 | 56 69 65 77 65 72 44 72 | void P3|ViewerDr|
|00001ce0| 61 77 44 65 65 70 28 50 | 33 56 69 65 77 65 72 44 |awDeep(P|3ViewerD|
|00001cf0| 61 74 61 2a 20 63 6f 6e | 73 74 20 76 69 65 77 65 |ata* con|st viewe|
|00001d00| 72 2c 20 42 6f 6f 6c 65 | 61 6e 20 77 69 74 68 43 |r, Boole|an withC|
|00001d10| 6f 6e 74 72 6f 6c 73 29 | 0d 09 2f 2f 20 73 61 6d |ontrols)|..// sam|
|00001d20| 65 20 61 73 20 50 33 56 | 69 65 77 65 72 44 72 61 |e as P3V|iewerDra|
|00001d30| 77 20 62 75 74 20 61 6c | 6c 6f 77 73 20 73 65 6c |w but al|lows sel|
|00001d40| 65 63 74 69 6e 67 20 69 | 66 20 79 6f 75 20 77 61 |ecting i|f you wa|
|00001d50| 6e 74 20 74 6f 20 64 72 | 61 77 20 74 68 65 20 63 |nt to dr|aw the c|
|00001d60| 6f 6e 74 72 6f 6c 73 0d | 7b 0d 09 47 72 61 66 50 |ontrols.|{..GrafP|
|00001d70| 74 72 09 6f 6c 64 50 6f | 72 74 3b 0d 09 52 65 63 |tr.oldPo|rt;..Rec|
|00001d80| 74 09 72 20 3d 20 76 69 | 65 77 65 72 2d 3e 76 69 |t.r = vi|ewer->vi|
|00001d90| 65 77 52 65 63 74 3b 0d | 09 47 65 74 50 6f 72 74 |ewRect;.|.GetPort|
|00001da0| 28 26 6f 6c 64 50 6f 72 | 74 29 3b 0d 09 53 65 74 |(&oldPor|t);..Set|
|00001db0| 50 6f 72 74 28 28 47 72 | 61 66 50 74 72 29 47 65 |Port((Gr|afPtr)Ge|
|00001dc0| 74 57 69 6e 64 6f 77 50 | 6f 72 74 28 76 69 65 77 |tWindowP|ort(view|
|00001dd0| 65 72 2d 3e 77 69 6e 64 | 6f 77 29 29 3b 0d 09 69 |er->wind|ow));..i|
|00001de0| 66 20 28 28 76 69 65 77 | 65 72 2d 3e 66 6c 61 67 |f ((view|er->flag|
|00001df0| 73 20 26 20 6b 33 46 6c | 61 67 57 69 74 68 50 6f |s & k3Fl|agWithPo|
|00001e00| 70 75 70 73 29 20 26 26 | 20 77 69 74 68 43 6f 6e |pups) &&| withCon|
|00001e10| 74 72 6f 6c 73 29 0d 09 | 7b 09 73 74 61 74 69 63 |trols)..|{.static|
|00001e20| 20 63 6f 6e 73 74 20 75 | 6e 73 69 67 6e 65 64 20 | const u|nsigned |
|00001e30| 63 68 61 72 2a 20 6d 73 | 67 20 3d 20 22 5c 70 6d |char* ms|g = "\pm|
|00001e40| 6f 76 65 3a 20 73 68 69 | 66 74 20 6b 65 79 20 20 |ove: shi|ft key |
|00001e50| 20 20 20 20 7a 6f 6f 6d | 3a 20 6f 70 74 69 6f 6e | zoom|: option|
|00001e60| 20 6b 65 79 22 3b 0d 09 | 09 44 72 61 77 31 43 6f | key";..|.Draw1Co|
|00001e70| 6e 74 72 6f 6c 28 76 69 | 65 77 65 72 2d 3e 7a 56 |ntrol(vi|ewer->zV|
|00001e80| 65 72 74 69 63 61 6c 43 | 74 6c 29 3b 0d 09 09 44 |erticalC|tl);...D|
|00001e90| 72 61 77 31 43 6f 6e 74 | 72 6f 6c 28 76 69 65 77 |raw1Cont|rol(view|
|00001ea0| 65 72 2d 3e 73 70 69 6e | 43 74 6c 29 3b 0d 09 09 |er->spin|Ctl);...|
|00001eb0| 54 65 78 74 53 69 7a 65 | 28 39 29 3b 20 54 65 78 |TextSize|(9); Tex|
|00001ec0| 74 46 6f 6e 74 28 31 29 | 3b 0d 09 09 4d 6f 76 65 |tFont(1)|;...Move|
|00001ed0| 54 6f 28 76 69 65 77 65 | 72 2d 3e 62 75 74 74 6f |To(viewe|r->butto|
|00001ee0| 6e 52 65 63 74 2e 72 69 | 67 68 74 2d 53 74 72 69 |nRect.ri|ght-Stri|
|00001ef0| 6e 67 57 69 64 74 68 28 | 6d 73 67 29 2c 20 76 69 |ngWidth(|msg), vi|
|00001f00| 65 77 65 72 2d 3e 62 75 | 74 74 6f 6e 52 65 63 74 |ewer->bu|ttonRect|
|00001f10| 2e 74 6f 70 2b 31 32 29 | 3b 0d 09 09 44 72 61 77 |.top+12)|;...Draw|
|00001f20| 53 74 72 69 6e 67 28 6d | 73 67 29 3b 0d 09 09 54 |String(m|sg);...T|
|00001f30| 65 78 74 53 69 7a 65 28 | 31 32 29 3b 20 54 65 78 |extSize(|12); Tex|
|00001f40| 74 46 6f 6e 74 28 30 29 | 3b 0d 09 7d 0d 0d 09 50 |tFont(0)|;..}...P|
|00001f50| 33 56 69 65 77 65 72 52 | 65 6e 64 65 72 28 76 69 |3ViewerR|ender(vi|
|00001f60| 65 77 65 72 29 3b 0d 0d | 09 50 65 6e 4e 6f 72 6d |ewer);..|.PenNorm|
|00001f70| 61 6c 28 29 3b 0d 09 49 | 6e 73 65 74 52 65 63 74 |al();..I|nsetRect|
|00001f80| 28 26 72 2c 20 2d 31 2c | 20 2d 31 29 3b 0d 09 46 |(&r, -1,| -1);..F|
|00001f90| 72 61 6d 65 52 65 63 74 | 28 26 72 29 3b 0d 0d 09 |rameRect|(&r);...|
|00001fa0| 53 65 74 50 6f 72 74 28 | 6f 6c 64 50 6f 72 74 29 |SetPort(|oldPort)|
|00001fb0| 3b 0d 7d 09 0d 0d 0d 76 | 6f 69 64 20 50 33 56 69 |;.}....v|oid P3Vi|
|00001fc0| 65 77 65 72 44 72 61 77 | 28 50 33 56 69 65 77 65 |ewerDraw|(P3Viewe|
|00001fd0| 72 44 61 74 61 2a 20 63 | 6f 6e 73 74 20 76 69 65 |rData* c|onst vie|
|00001fe0| 77 65 72 29 0d 7b 0d 09 | 50 33 56 69 65 77 65 72 |wer).{..|P3Viewer|
|00001ff0| 44 72 61 77 44 65 65 70 | 28 76 69 65 77 65 72 2c |DrawDeep|(viewer,|
|00002000| 20 74 72 75 65 29 3b 0d | 7d 0d 0d 0d 0d 50 33 56 | true);.|}....P3V|
|00002010| 69 65 77 65 72 44 61 74 | 61 2a 20 50 33 56 69 65 |iewerDat|a* P3Vie|
|00002020| 77 65 72 4e 65 77 28 57 | 69 6e 64 6f 77 52 65 66 |werNew(W|indowRef|
|00002030| 20 77 69 6e 64 6f 77 2c | 20 52 65 63 74 2a 20 63 | window,| Rect* c|
|00002040| 6f 6e 73 74 20 62 6f 75 | 6e 64 73 2c 20 73 68 6f |onst bou|nds, sho|
|00002050| 72 74 20 66 6c 61 67 73 | 29 0d 09 2f 2f 20 63 61 |rt flags|)..// ca|
|00002060| 6c 6c 20 66 6f 72 20 61 | 6c 6c 6f 63 61 74 69 6e |ll for a|llocatin|
|00002070| 67 20 74 68 65 20 76 69 | 65 77 65 72 0d 09 2f 2f |g the vi|ewer..//|
|00002080| 20 72 65 74 75 72 6e 73 | 20 6e 69 6c 20 6f 6e 20 | returns| nil on |
|00002090| 66 61 69 6c 75 72 65 0d | 7b 0d 09 50 33 56 69 65 |failure.|{..P3Vie|
|000020a0| 77 65 72 44 61 74 61 2a | 20 09 09 09 76 69 65 77 |werData*| ...view|
|000020b0| 65 72 3b 0d 09 54 51 33 | 52 65 6e 64 65 72 65 72 |er;..TQ3|Renderer|
|000020c0| 4f 62 6a 65 63 74 09 09 | 72 65 6e 64 65 72 65 72 |Object..|renderer|
|000020d0| 3d 6e 69 6c 3b 09 09 2f | 2f 20 6f 75 72 20 72 65 |=nil;../|/ our re|
|000020e0| 6e 64 65 72 65 72 0d 09 | 54 51 33 44 72 61 77 43 |nderer..|TQ3DrawC|
|000020f0| 6f 6e 74 65 78 74 4f 62 | 6a 65 63 74 09 63 6f 6e |ontextOb|ject.con|
|00002100| 74 65 78 74 3d 6e 69 6c | 3b 09 09 2f 2f 20 6f 75 |text=nil|;..// ou|
|00002110| 72 20 64 72 61 77 69 6e | 67 20 63 6f 6e 74 65 78 |r drawin|g contex|
|00002120| 74 0d 09 54 51 33 4c 69 | 67 68 74 4f 62 6a 65 63 |t..TQ3Li|ghtObjec|
|00002130| 74 09 09 09 6c 69 67 68 | 74 3b 09 09 09 09 2f 2f |t...ligh|t;....//|
|00002140| 20 6f 75 72 20 6c 69 67 | 68 74 73 0d 09 54 51 33 | our lig|hts..TQ3|
|00002150| 47 72 6f 75 70 4f 62 6a | 65 63 74 09 09 09 6c 69 |GroupObj|ect...li|
|00002160| 67 68 74 47 72 6f 75 70 | 3d 6e 69 6c 3b 09 09 2f |ghtGroup|=nil;../|
|00002170| 2f 20 61 20 67 72 6f 75 | 70 20 6f 66 20 6f 75 72 |/ a grou|p of our|
|00002180| 20 6c 69 67 68 74 73 0d | 09 69 6e 74 09 09 09 09 | lights.|.int....|
|00002190| 09 09 69 3b 0d 0d 09 69 | 66 20 28 21 69 6e 69 74 |..i;...i|f (!init|
|000021a0| 69 61 6c 69 7a 65 64 29 | 09 09 09 2f 2f 20 69 66 |ialized)|...// if|
|000021b0| 20 74 68 69 73 20 6d 6f | 64 75 6c 65 20 68 61 73 | this mo|dule has|
|000021c0| 20 6e 6f 74 20 79 65 74 | 20 62 65 65 6e 20 69 6e | not yet| been in|
|000021d0| 69 74 69 61 6c 69 7a 65 | 64 0d 09 7b 0d 09 09 51 |itialize|d..{...Q|
|000021e0| 33 4d 61 74 72 69 78 34 | 78 34 5f 53 65 74 49 64 |3Matrix4|x4_SetId|
|000021f0| 65 6e 74 69 74 79 28 26 | 72 6f 74 61 74 69 6f 6e |entity(&|rotation|
|00002200| 29 3b 0d 09 09 51 33 4d | 61 74 72 69 78 34 78 34 |);...Q3M|atrix4x4|
|00002210| 5f 53 65 74 52 6f 74 61 | 74 65 41 62 6f 75 74 41 |_SetRota|teAboutA|
|00002220| 78 69 73 28 26 73 70 69 | 6e 2c 20 26 72 6f 74 61 |xis(&spi|n, &rota|
|00002230| 74 69 6f 6e 4f 72 69 67 | 69 6e 2c 20 26 72 6f 74 |tionOrig|in, &rot|
|00002240| 61 74 69 6f 6e 56 65 63 | 74 6f 72 2c 20 72 6f 74 |ationVec|tor, rot|
|00002250| 61 74 69 6f 6e 41 6e 67 | 6c 65 29 3b 0d 09 09 69 |ationAng|le);...i|
|00002260| 6e 69 74 69 61 6c 69 7a | 65 64 20 3d 20 74 72 75 |nitializ|ed = tru|
|00002270| 65 3b 0d 09 7d 0d 0d 0d | 09 76 69 65 77 65 72 20 |e;..}...|.viewer |
|00002280| 3d 20 28 50 33 56 69 65 | 77 65 72 44 61 74 61 2a |= (P3Vie|werData*|
|00002290| 29 4e 65 77 50 74 72 43 | 6c 65 61 72 28 73 69 7a |)NewPtrC|lear(siz|
|000022a0| 65 6f 66 28 50 33 56 69 | 65 77 65 72 44 61 74 61 |eof(P3Vi|ewerData|
|000022b0| 29 29 3b 0d 09 69 66 20 | 28 76 69 65 77 65 72 29 |));..if |(viewer)|
|000022c0| 0d 09 7b 0d 09 09 54 51 | 33 4d 61 63 44 72 61 77 |..{...TQ|3MacDraw|
|000022d0| 43 6f 6e 74 65 78 74 44 | 61 74 61 09 09 6d 79 4d |ContextD|ata..myM|
|000022e0| 61 63 44 72 61 77 43 6f | 6e 74 65 78 74 44 61 74 |acDrawCo|ntextDat|
|000022f0| 61 3b 0d 09 09 73 74 61 | 74 69 63 20 63 6f 6e 73 |a;...sta|tic cons|
|00002300| 74 20 54 51 33 43 6f 6c | 6f 72 41 52 47 42 09 63 |t TQ3Col|orARGB.c|
|00002310| 6c 65 61 72 43 6f 6c 6f | 72 20 3d 20 7b 31 2e 30 |learColo|r = {1.0|
|00002320| 2c 20 31 2e 30 2c 20 31 | 2e 30 2c 20 31 2e 30 7d |, 1.0, 1|.0, 1.0}|
|00002330| 3b 0d 09 09 52 65 63 74 | 09 72 3b 0d 0d 09 09 76 |;...Rect|.r;....v|
|00002340| 69 65 77 65 72 2d 3e 66 | 6c 61 67 73 20 3d 20 66 |iewer->f|lags = f|
|00002350| 6c 61 67 73 3b 0d 0d 09 | 09 6d 79 4d 61 63 44 72 |lags;...|.myMacDr|
|00002360| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 2e 64 72 |awContex|tData.dr|
|00002370| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 2e 63 6c |awContex|tData.cl|
|00002380| 65 61 72 49 6d 61 67 65 | 4d 65 74 68 6f 64 20 3d |earImage|Method =|
|00002390| 20 6b 51 33 43 6c 65 61 | 72 4d 65 74 68 6f 64 57 | kQ3Clea|rMethodW|
|000023a0| 69 74 68 43 6f 6c 6f 72 | 3b 0d 09 09 6d 79 4d 61 |ithColor|;...myMa|
|000023b0| 63 44 72 61 77 43 6f 6e | 74 65 78 74 44 61 74 61 |cDrawCon|textData|
|000023c0| 2e 64 72 61 77 43 6f 6e | 74 65 78 74 44 61 74 61 |.drawCon|textData|
|000023d0| 2e 63 6c 65 61 72 49 6d | 61 67 65 43 6f 6c 6f 72 |.clearIm|ageColor|
|000023e0| 20 3d 20 63 6c 65 61 72 | 43 6f 6c 6f 72 3b 0d 09 | = clear|Color;..|
|000023f0| 09 6d 79 4d 61 63 44 72 | 61 77 43 6f 6e 74 65 78 |.myMacDr|awContex|
|00002400| 74 44 61 74 61 2e 64 72 | 61 77 43 6f 6e 74 65 78 |tData.dr|awContex|
|00002410| 74 44 61 74 61 2e 70 61 | 6e 65 53 74 61 74 65 20 |tData.pa|neState |
|00002420| 3d 20 6b 51 33 54 72 75 | 65 3b 0d 09 09 6d 79 4d |= kQ3Tru|e;...myM|
|00002430| 61 63 44 72 61 77 43 6f | 6e 74 65 78 74 44 61 74 |acDrawCo|ntextDat|
|00002440| 61 2e 64 72 61 77 43 6f | 6e 74 65 78 74 44 61 74 |a.drawCo|ntextDat|
|00002450| 61 2e 6d 61 73 6b 53 74 | 61 74 65 20 3d 20 6b 51 |a.maskSt|ate = kQ|
|00002460| 33 46 61 6c 73 65 3b 0d | 09 09 6d 79 4d 61 63 44 |3False;.|..myMacD|
|00002470| 72 61 77 43 6f 6e 74 65 | 78 74 44 61 74 61 2e 64 |rawConte|xtData.d|
|00002480| 72 61 77 43 6f 6e 74 65 | 78 74 44 61 74 61 2e 64 |rawConte|xtData.d|
|00002490| 6f 75 62 6c 65 42 75 66 | 66 65 72 53 74 61 74 65 |oubleBuf|ferState|
|000024a0| 20 3d 20 6b 51 33 54 72 | 75 65 3b 0d 09 09 6d 79 | = kQ3Tr|ue;...my|
|000024b0| 4d 61 63 44 72 61 77 43 | 6f 6e 74 65 78 74 44 61 |MacDrawC|ontextDa|
|000024c0| 74 61 2e 64 72 61 77 43 | 6f 6e 74 65 78 74 44 61 |ta.drawC|ontextDa|
|000024d0| 74 61 2e 70 61 6e 65 2e | 6d 69 6e 2e 78 20 3d 20 |ta.pane.|min.x = |
|000024e0| 28 66 6c 6f 61 74 29 62 | 6f 75 6e 64 73 2d 3e 6c |(float)b|ounds->l|
|000024f0| 65 66 74 3b 0d 09 09 6d | 79 4d 61 63 44 72 61 77 |eft;...m|yMacDraw|
|00002500| 43 6f 6e 74 65 78 74 44 | 61 74 61 2e 64 72 61 77 |ContextD|ata.draw|
|00002510| 43 6f 6e 74 65 78 74 44 | 61 74 61 2e 70 61 6e 65 |ContextD|ata.pane|
|00002520| 2e 6d 61 78 2e 78 20 3d | 20 28 66 6c 6f 61 74 29 |.max.x =| (float)|
|00002530| 62 6f 75 6e 64 73 2d 3e | 72 69 67 68 74 3b 0d 09 |bounds->|right;..|
|00002540| 09 6d 79 4d 61 63 44 72 | 61 77 43 6f 6e 74 65 78 |.myMacDr|awContex|
|00002550| 74 44 61 74 61 2e 64 72 | 61 77 43 6f 6e 74 65 78 |tData.dr|awContex|
|00002560| 74 44 61 74 61 2e 70 61 | 6e 65 2e 6d 69 6e 2e 79 |tData.pa|ne.min.y|
|00002570| 20 3d 20 28 66 6c 6f 61 | 74 29 62 6f 75 6e 64 73 | = (floa|t)bounds|
|00002580| 2d 3e 74 6f 70 3b 0d 09 | 09 6d 79 4d 61 63 44 72 |->top;..|.myMacDr|
|00002590| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 2e 64 72 |awContex|tData.dr|
|000025a0| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 2e 70 61 |awContex|tData.pa|
|000025b0| 6e 65 2e 6d 61 78 2e 79 | 20 3d 20 28 66 6c 6f 61 |ne.max.y| = (floa|
|000025c0| 74 29 62 6f 75 6e 64 73 | 2d 3e 62 6f 74 74 6f 6d |t)bounds|->bottom|
|000025d0| 3b 0d 0d 09 09 6d 79 4d | 61 63 44 72 61 77 43 6f |;....myM|acDrawCo|
|000025e0| 6e 74 65 78 74 44 61 74 | 61 2e 77 69 6e 64 6f 77 |ntextDat|a.window|
|000025f0| 20 3d 20 47 65 74 57 69 | 6e 64 6f 77 50 6f 72 74 | = GetWi|ndowPort|
|00002600| 28 77 69 6e 64 6f 77 29 | 3b 09 09 09 09 2f 2f 20 |(window)|;....// |
|00002610| 74 68 69 73 20 69 73 20 | 74 68 65 20 77 69 6e 64 |this is |the wind|
|00002620| 6f 77 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |ow assoc|iated wi|
|00002630| 74 68 20 74 68 65 20 76 | 69 65 77 0d 09 09 6d 79 |th the v|iew...my|
|00002640| 4d 61 63 44 72 61 77 43 | 6f 6e 74 65 78 74 44 61 |MacDrawC|ontextDa|
|00002650| 74 61 2e 6c 69 62 72 61 | 72 79 20 3d 20 6b 51 33 |ta.libra|ry = kQ3|
|00002660| 4d 61 63 32 44 4c 69 62 | 72 61 72 79 4e 6f 6e 65 |Mac2DLib|raryNone|
|00002670| 3b 0d 09 09 6d 79 4d 61 | 63 44 72 61 77 43 6f 6e |;...myMa|cDrawCon|
|00002680| 74 65 78 74 44 61 74 61 | 2e 76 69 65 77 50 6f 72 |textData|.viewPor|
|00002690| 74 20 3d 20 6e 69 6c 3b | 0d 09 09 6d 79 4d 61 63 |t = nil;|...myMac|
|000026a0| 44 72 61 77 43 6f 6e 74 | 65 78 74 44 61 74 61 2e |DrawCont|extData.|
|000026b0| 67 72 61 66 50 6f 72 74 | 20 3d 20 6e 69 6c 3b 0d |grafPort| = nil;.|
|000026c0| 0d 09 09 63 6f 6e 74 65 | 78 74 20 3d 20 51 33 4d |...conte|xt = Q3M|
|000026d0| 61 63 44 72 61 77 43 6f | 6e 74 65 78 74 5f 4e 65 |acDrawCo|ntext_Ne|
|000026e0| 77 28 26 6d 79 4d 61 63 | 44 72 61 77 43 6f 6e 74 |w(&myMac|DrawCont|
|000026f0| 65 78 74 44 61 74 61 29 | 3b 0d 09 09 69 66 20 28 |extData)|;...if (|
|00002700| 63 6f 6e 74 65 78 74 20 | 3d 3d 20 6e 69 6c 29 20 |context |== nil) |
|00002710| 67 6f 74 6f 20 66 61 69 | 6c 3b 0d 0d 09 09 72 65 |goto fai|l;....re|
|00002720| 6e 64 65 72 65 72 20 3d | 20 51 33 52 65 6e 64 65 |nderer =| Q3Rende|
|00002730| 72 65 72 5f 4e 65 77 46 | 72 6f 6d 54 79 70 65 28 |rer_NewF|romType(|
|00002740| 6b 51 33 52 65 6e 64 65 | 72 65 72 54 79 70 65 49 |kQ3Rende|rerTypeI|
|00002750| 6e 74 65 72 61 63 74 69 | 76 65 29 3b 0d 09 09 69 |nteracti|ve);...i|
|00002760| 66 20 28 72 65 6e 64 65 | 72 65 72 20 3d 3d 20 6e |f (rende|rer == n|
|00002770| 69 6c 29 20 67 6f 74 6f | 20 66 61 69 6c 3b 0d 09 |il) goto| fail;..|
|00002780| 09 2f 2f 20 74 68 65 73 | 65 20 74 77 6f 20 6c 69 |.// thes|e two li|
|00002790| 6e 65 73 20 73 65 74 20 | 75 73 20 75 70 20 74 6f |nes set |us up to|
|000027a0| 20 75 73 65 20 74 68 65 | 20 62 65 73 74 20 70 6f | use the| best po|
|000027b0| 73 73 69 62 6c 65 20 72 | 65 6e 64 65 72 65 72 2c |ssible r|enderer,|
|000027c0| 0d 09 09 2f 2f 20 69 6e | 63 6c 75 64 69 6e 67 20 |...// in|cluding |
|000027d0| 20 68 61 72 64 77 61 72 | 65 20 69 66 20 69 74 20 | hardwar|e if it |
|000027e0| 69 73 20 69 6e 73 74 61 | 6c 6c 65 64 2e 0d 09 09 |is insta|lled....|
|000027f0| 51 33 49 6e 74 65 72 61 | 63 74 69 76 65 52 65 6e |Q3Intera|ctiveRen|
|00002800| 64 65 72 65 72 5f 53 65 | 74 44 6f 75 62 6c 65 42 |derer_Se|tDoubleB|
|00002810| 75 66 66 65 72 42 79 70 | 61 73 73 20 28 72 65 6e |ufferByp|ass (ren|
|00002820| 64 65 72 65 72 2c 20 6b | 51 33 54 72 75 65 29 3b |derer, k|Q3True);|
|00002830| 09 09 09 09 09 09 0d 09 | 09 51 33 49 6e 74 65 72 |........|.Q3Inter|
|00002840| 61 63 74 69 76 65 52 65 | 6e 64 65 72 65 72 5f 53 |activeRe|nderer_S|
|00002850| 65 74 50 72 65 66 65 72 | 65 6e 63 65 73 28 72 65 |etPrefer|ences(re|
|00002860| 6e 64 65 72 65 72 2c 20 | 6b 51 41 56 65 6e 64 6f |nderer, |kQAVendo|
|00002870| 72 5f 42 65 73 74 43 68 | 6f 69 63 65 2c 20 30 29 |r_BestCh|oice, 0)|
|00002880| 3b 0d 0d 09 09 70 6f 69 | 6e 74 43 61 6d 44 61 74 |;....poi|ntCamDat|
|00002890| 61 2e 61 73 70 65 63 74 | 52 61 74 69 6f 58 54 6f |a.aspect|RatioXTo|
|000028a0| 59 20 3d 20 28 66 6c 6f | 61 74 29 28 62 6f 75 6e |Y = (flo|at)(boun|
|000028b0| 64 73 2d 3e 72 69 67 68 | 74 2d 62 6f 75 6e 64 73 |ds->righ|t-bounds|
|000028c0| 2d 3e 6c 65 66 74 29 2f | 0d 09 09 09 09 09 09 09 |->left)/|........|
|000028d0| 09 09 09 28 66 6c 6f 61 | 74 29 28 62 6f 75 6e 64 |...(floa|t)(bound|
|000028e0| 73 2d 3e 62 6f 74 74 6f | 6d 20 2d 20 62 6f 75 6e |s->botto|m - boun|
|000028f0| 64 73 2d 3e 74 6f 70 29 | 3b 0d 09 09 76 69 65 77 |ds->top)|;...view|
|00002900| 65 72 2d 3e 70 6f 69 6e | 74 43 61 6d 20 3d 20 51 |er->poin|tCam = Q|
|00002910| 33 56 69 65 77 41 6e 67 | 6c 65 41 73 70 65 63 74 |3ViewAng|leAspect|
|00002920| 43 61 6d 65 72 61 5f 4e | 65 77 28 26 70 6f 69 6e |Camera_N|ew(&poin|
|00002930| 74 43 61 6d 44 61 74 61 | 29 3b 0d 09 09 76 69 65 |tCamData|);...vie|
|00002940| 77 65 72 2d 3e 6f 72 74 | 68 6f 43 61 6d 20 3d 20 |wer->ort|hoCam = |
|00002950| 51 33 4f 72 74 68 6f 67 | 72 61 70 68 69 63 43 61 |Q3Orthog|raphicCa|
|00002960| 6d 65 72 61 5f 4e 65 77 | 28 26 6f 72 74 68 6f 43 |mera_New|(&orthoC|
|00002970| 61 6d 44 61 74 61 29 3b | 0d 09 09 69 66 20 28 76 |amData);|...if (v|
|00002980| 69 65 77 65 72 2d 3e 70 | 6f 69 6e 74 43 61 6d 20 |iewer->p|ointCam |
|00002990| 3d 3d 20 6e 69 6c 20 7c | 7c 20 76 69 65 77 65 72 |== nil ||| viewer|
|000029a0| 2d 3e 6f 72 74 68 6f 43 | 61 6d 20 3d 3d 20 6e 69 |->orthoC|am == ni|
|000029b0| 6c 29 20 67 6f 74 6f 20 | 66 61 69 6c 3b 0d 0d 09 |l) goto |fail;...|
|000029c0| 09 6c 69 67 68 74 47 72 | 6f 75 70 20 3d 20 51 33 |.lightGr|oup = Q3|
|000029d0| 4c 69 67 68 74 47 72 6f | 75 70 5f 4e 65 77 28 29 |LightGro|up_New()|
|000029e0| 3b 0d 09 09 69 66 20 28 | 6c 69 67 68 74 47 72 6f |;...if (|lightGro|
|000029f0| 75 70 20 3d 3d 20 6e 69 | 6c 29 20 67 6f 74 6f 20 |up == ni|l) goto |
|00002a00| 66 61 69 6c 3b 0d 0d 09 | 09 66 6f 72 20 28 69 3d |fail;...|.for (i=|
|00002a10| 30 3b 20 69 3c 34 3b 20 | 69 2b 2b 29 0d 09 09 7b |0; i<4; |i++)...{|
|00002a20| 09 6c 69 67 68 74 20 3d | 20 51 33 50 6f 69 6e 74 |.light =| Q3Point|
|00002a30| 4c 69 67 68 74 5f 4e 65 | 77 28 26 70 6f 69 6e 74 |Light_Ne|w(&point|
|00002a40| 4c 69 67 68 74 44 61 74 | 61 5b 69 5d 29 3b 0d 09 |LightDat|a[i]);..|
|00002a50| 09 09 69 66 20 28 6c 69 | 67 68 74 20 21 3d 20 6e |..if (li|ght != n|
|00002a60| 69 6c 29 0d 09 09 09 7b | 09 51 33 47 72 6f 75 70 |il)....{|.Q3Group|
|00002a70| 5f 41 64 64 4f 62 6a 65 | 63 74 28 6c 69 67 68 74 |_AddObje|ct(light|
|00002a80| 47 72 6f 75 70 2c 20 6c | 69 67 68 74 29 3b 0d 09 |Group, l|ight);..|
|00002a90| 09 09 09 76 69 65 77 65 | 72 2d 3e 73 70 6f 74 4c |...viewe|r->spotL|
|00002aa0| 69 67 68 74 73 5b 69 5d | 20 3d 20 6c 69 67 68 74 |ights[i]| = light|
|00002ab0| 3b 0d 09 09 09 7d 0d 09 | 09 7d 09 0d 09 09 0d 09 |;....}..|.}......|
|00002ac0| 09 6c 69 67 68 74 20 3d | 20 51 33 41 6d 62 69 65 |.light =| Q3Ambie|
|00002ad0| 6e 74 4c 69 67 68 74 5f | 4e 65 77 28 26 61 6d 62 |ntLight_|New(&amb|
|00002ae0| 69 65 6e 74 4c 69 67 68 | 74 44 61 74 61 29 3b 0d |ientLigh|tData);.|
|00002af0| 09 09 69 66 20 28 6c 69 | 67 68 74 20 21 3d 20 6e |..if (li|ght != n|
|00002b00| 69 6c 29 0d 09 09 7b 09 | 0d 09 09 09 51 33 47 72 |il)...{.|....Q3Gr|
|00002b10| 6f 75 70 5f 41 64 64 4f | 62 6a 65 63 74 28 6c 69 |oup_AddO|bject(li|
|00002b20| 67 68 74 47 72 6f 75 70 | 2c 20 6c 69 67 68 74 29 |ghtGroup|, light)|
|00002b30| 3b 0d 09 09 09 76 69 65 | 77 65 72 2d 3e 61 6d 62 |;....vie|wer->amb|
|00002b40| 69 65 6e 74 4c 69 67 68 | 74 20 3d 20 6c 69 67 68 |ientLigh|t = ligh|
|00002b50| 74 3b 09 0d 09 09 7d 0d | 0d 09 09 76 69 65 77 65 |t;....}.|...viewe|
|00002b60| 72 2d 3e 76 69 65 77 20 | 3d 20 51 33 56 69 65 77 |r->view |= Q3View|
|00002b70| 5f 4e 65 77 28 29 3b 0d | 09 09 69 66 20 28 76 69 |_New();.|..if (vi|
|00002b80| 65 77 65 72 2d 3e 76 69 | 65 77 20 3d 3d 20 6e 69 |ewer->vi|ew == ni|
|00002b90| 6c 29 20 67 6f 74 6f 20 | 66 61 69 6c 3b 0d 09 09 |l) goto |fail;...|
|00002ba0| 69 66 20 28 51 33 56 69 | 65 77 5f 53 65 74 44 72 |if (Q3Vi|ew_SetDr|
|00002bb0| 61 77 43 6f 6e 74 65 78 | 74 28 76 69 65 77 65 72 |awContex|t(viewer|
|00002bc0| 2d 3e 76 69 65 77 2c 20 | 63 6f 6e 74 65 78 74 29 |->view, |context)|
|00002bd0| 3d 3d 6b 51 33 46 61 69 | 6c 75 72 65 29 20 67 6f |==kQ3Fai|lure) go|
|00002be0| 74 6f 20 66 61 69 6c 3b | 0d 09 09 69 66 20 28 51 |to fail;|...if (Q|
|00002bf0| 33 56 69 65 77 5f 53 65 | 74 52 65 6e 64 65 72 65 |3View_Se|tRendere|
|00002c00| 72 28 76 69 65 77 65 72 | 2d 3e 76 69 65 77 2c 20 |r(viewer|->view, |
|00002c10| 72 65 6e 64 65 72 65 72 | 29 20 3d 3d 20 6b 51 33 |renderer|) == kQ3|
|00002c20| 46 61 69 6c 75 72 65 29 | 20 67 6f 74 6f 20 66 61 |Failure)| goto fa|
|00002c30| 69 6c 3b 0d 09 09 69 66 | 20 28 51 33 56 69 65 77 |il;...if| (Q3View|
|00002c40| 5f 53 65 74 4c 69 67 68 | 74 47 72 6f 75 70 28 76 |_SetLigh|tGroup(v|
|00002c50| 69 65 77 65 72 2d 3e 76 | 69 65 77 2c 20 6c 69 67 |iewer->v|iew, lig|
|00002c60| 68 74 47 72 6f 75 70 29 | 3d 3d 6b 51 33 46 61 69 |htGroup)|==kQ3Fai|
|00002c70| 6c 75 72 65 29 20 67 6f | 74 6f 20 66 61 69 6c 3b |lure) go|to fail;|
|00002c80| 0d 09 09 53 65 74 75 70 | 43 61 6d 65 72 61 73 28 |...Setup|Cameras(|
|00002c90| 76 69 65 77 65 72 29 3b | 0d 0d 09 09 69 66 20 28 |viewer);|....if (|
|00002ca0| 66 6c 61 67 73 20 26 20 | 6b 33 46 6c 61 67 57 69 |flags & |k3FlagWi|
|00002cb0| 74 68 50 6f 70 75 70 73 | 29 0d 09 09 7b 0d 09 09 |thPopups|)...{...|
|00002cc0| 09 53 65 74 52 65 63 74 | 28 26 72 2c 20 31 30 30 |.SetRect|(&r, 100|
|00002cd0| 30 30 2c 20 31 30 30 30 | 30 2c 20 31 30 31 35 30 |00, 1000|0, 10150|
|00002ce0| 2c 20 31 30 30 31 38 29 | 3b 09 09 2f 2f 20 73 6f |, 10018)|;..// so|
|00002cf0| 6d 65 77 68 65 72 65 20 | 6f 66 66 73 63 72 65 65 |mewhere |offscree|
|00002d00| 6e 20 2d 20 77 65 27 6c | 6c 20 70 6f 73 69 74 69 |n - we'l|l positi|
|00002d10| 6f 6e 20 74 68 65 6d 20 | 63 6f 72 72 65 63 74 6c |on them |correctl|
|00002d20| 79 20 62 65 6c 6f 77 0d | 09 09 09 76 69 65 77 65 |y below.|...viewe|
|00002d30| 72 2d 3e 7a 56 65 72 74 | 69 63 61 6c 43 74 6c 20 |r->zVert|icalCtl |
|00002d40| 3d 20 4e 65 77 43 6f 6e | 74 72 6f 6c 28 77 69 6e |= NewCon|trol(win|
|00002d50| 64 6f 77 2c 20 26 72 2c | 20 22 5c 70 56 65 72 74 |dow, &r,| "\pVert|
|00002d60| 69 63 61 6c 20 5a 2d 61 | 78 69 73 22 2c 20 74 72 |ical Z-a|xis", tr|
|00002d70| 75 65 2c 20 7a 56 65 72 | 74 69 63 61 6c 2c 20 30 |ue, zVer|tical, 0|
|00002d80| 2c 20 31 2c 20 63 68 65 | 63 6b 42 6f 78 50 72 6f |, 1, che|ckBoxPro|
|00002d90| 63 2c 20 30 29 3b 0d 09 | 09 09 72 2e 72 69 67 68 |c, 0);..|..r.righ|
|00002da0| 74 20 3d 20 31 30 30 36 | 30 3b 0d 09 09 09 76 69 |t = 1006|0;....vi|
|00002db0| 65 77 65 72 2d 3e 73 70 | 69 6e 43 74 6c 20 3d 20 |ewer->sp|inCtl = |
|00002dc0| 4e 65 77 43 6f 6e 74 72 | 6f 6c 28 77 69 6e 64 6f |NewContr|ol(windo|
|00002dd0| 77 2c 20 26 72 2c 20 22 | 5c 70 53 70 69 6e 22 2c |w, &r, "|\pSpin",|
|00002de0| 20 74 72 75 65 2c 20 64 | 6f 53 70 69 6e 44 65 66 | true, d|oSpinDef|
|00002df0| 61 75 6c 74 2c 20 30 2c | 20 31 2c 20 63 68 65 63 |ault, 0,| 1, chec|
|00002e00| 6b 42 6f 78 50 72 6f 63 | 2c 20 30 29 3b 0d 09 09 |kBoxProc|, 0);...|
|00002e10| 09 69 66 20 28 76 69 65 | 77 65 72 2d 3e 7a 56 65 |.if (vie|wer->zVe|
|00002e20| 72 74 69 63 61 6c 43 74 | 6c 20 3d 3d 20 6e 69 6c |rticalCt|l == nil|
|00002e30| 20 7c 7c 20 76 69 65 77 | 65 72 2d 3e 73 70 69 6e | || view|er->spin|
|00002e40| 43 74 6c 20 3d 3d 20 6e | 69 6c 29 20 67 6f 74 6f |Ctl == n|il) goto|
|00002e50| 20 66 61 69 6c 3b 0d 09 | 09 7d 0d 09 09 76 69 65 | fail;..|.}...vie|
|00002e60| 77 65 72 2d 3e 77 69 6e | 64 6f 77 20 3d 20 77 69 |wer->win|dow = wi|
|00002e70| 6e 64 6f 77 3b 0d 09 09 | 76 69 65 77 65 72 2d 3e |ndow;...|viewer->|
|00002e80| 62 6f 75 6e 64 73 20 3d | 20 76 69 65 77 65 72 2d |bounds =| viewer-|
|00002e90| 3e 76 69 65 77 52 65 63 | 74 20 3d 20 76 69 65 77 |>viewRec|t = view|
|00002ea0| 65 72 2d 3e 62 75 74 74 | 6f 6e 52 65 63 74 20 3d |er->butt|onRect =|
|00002eb0| 20 2a 62 6f 75 6e 64 73 | 3b 09 2f 2f 20 69 6e 69 | *bounds|;.// ini|
|00002ec0| 74 69 61 6c 69 7a 65 20 | 74 6f 20 73 6f 6d 65 74 |tialize |to somet|
|00002ed0| 68 69 6e 67 20 76 61 67 | 75 65 6c 79 20 64 65 66 |hing vag|uely def|
|00002ee0| 69 6e 65 64 0d 09 09 50 | 33 56 69 65 77 65 72 53 |ined...P|3ViewerS|
|00002ef0| 65 74 42 6f 75 6e 64 73 | 28 76 69 65 77 65 72 2c |etBounds|(viewer,|
|00002f00| 20 62 6f 75 6e 64 73 29 | 3b 09 09 2f 2f 20 63 61 | bounds)|;..// ca|
|00002f10| 6c 63 75 6c 61 74 65 73 | 20 62 75 74 74 6f 6e 52 |lculates| buttonR|
|00002f20| 65 63 74 20 61 6e 64 20 | 76 69 65 77 52 65 63 74 |ect and |viewRect|
|00002f30| 2c 20 70 6f 73 69 74 69 | 6f 6e 73 20 63 6f 6e 74 |, positi|ons cont|
|00002f40| 72 6f 6c 73 0d 09 7d 0d | 09 67 6f 74 6f 20 64 6f |rols..}.|.goto do|
|00002f50| 6e 65 3b 0d 0d 66 61 69 | 6c 3a 0d 09 50 33 56 69 |ne;..fai|l:..P3Vi|
|00002f60| 65 77 65 72 44 69 73 70 | 6f 73 65 28 76 69 65 77 |ewerDisp|ose(view|
|00002f70| 65 72 29 3b 0d 09 76 69 | 65 77 65 72 20 3d 20 6e |er);..vi|ewer = n|
|00002f80| 69 6c 3b 0d 0d 64 6f 6e | 65 3a 0d 09 51 33 4f 62 |il;..don|e:..Q3Ob|
|00002f90| 6a 65 63 74 5f 44 69 73 | 70 6f 73 65 49 66 4e 6f |ject_Dis|poseIfNo|
|00002fa0| 74 4e 69 6c 28 72 65 6e | 64 65 72 65 72 29 3b 09 |tNil(ren|derer);.|
|00002fb0| 0d 09 51 33 4f 62 6a 65 | 63 74 5f 44 69 73 70 6f |..Q3Obje|ct_Dispo|
|00002fc0| 73 65 49 66 4e 6f 74 4e | 69 6c 28 6c 69 67 68 74 |seIfNotN|il(light|
|00002fd0| 47 72 6f 75 70 29 3b 09 | 0d 09 51 33 4f 62 6a 65 |Group);.|..Q3Obje|
|00002fe0| 63 74 5f 44 69 73 70 6f | 73 65 49 66 4e 6f 74 4e |ct_Dispo|seIfNotN|
|00002ff0| 69 6c 28 63 6f 6e 74 65 | 78 74 29 3b 09 0d 09 72 |il(conte|xt);...r|
|00003000| 65 74 75 72 6e 20 76 69 | 65 77 65 72 3b 0d 7d 0d |eturn vi|ewer;.}.|
|00003010| 0d 76 6f 69 64 20 50 33 | 56 69 65 77 65 72 44 69 |.void P3|ViewerDi|
|00003020| 73 70 6f 73 65 28 50 33 | 56 69 65 77 65 72 44 61 |spose(P3|ViewerDa|
|00003030| 74 61 2a 20 63 6f 6e 73 | 74 20 76 69 65 77 65 72 |ta* cons|t viewer|
|00003040| 29 0d 09 2f 2f 20 63 61 | 6c 6c 20 66 6f 72 20 64 |)..// ca|ll for d|
|00003050| 65 61 6c 6c 6f 63 61 74 | 69 6e 67 0d 7b 0d 09 69 |eallocat|ing.{..i|
|00003060| 66 20 28 76 69 65 77 65 | 72 29 0d 09 7b 0d 09 09 |f (viewe|r)..{...|
|00003070| 69 6e 74 09 69 3b 0d 0d | 09 09 51 33 4f 62 6a 65 |int.i;..|..Q3Obje|
|00003080| 63 74 5f 44 69 73 70 6f | 73 65 49 66 4e 6f 74 4e |ct_Dispo|seIfNotN|
|00003090| 69 6c 28 76 69 65 77 65 | 72 2d 3e 76 69 65 77 29 |il(viewe|r->view)|
|000030a0| 3b 09 0d 09 09 51 33 4f | 62 6a 65 63 74 5f 44 69 |;....Q3O|bject_Di|
|000030b0| 73 70 6f 73 65 49 66 4e | 6f 74 4e 69 6c 28 76 69 |sposeIfN|otNil(vi|
|000030c0| 65 77 65 72 2d 3e 6f 72 | 74 68 6f 43 61 6d 29 3b |ewer->or|thoCam);|
|000030d0| 0d 09 09 51 33 4f 62 6a | 65 63 74 5f 44 69 73 70 |...Q3Obj|ect_Disp|
|000030e0| 6f 73 65 49 66 4e 6f 74 | 4e 69 6c 28 76 69 65 77 |oseIfNot|Nil(view|
|000030f0| 65 72 2d 3e 70 6f 69 6e | 74 43 61 6d 29 3b 0d 09 |er->poin|tCam);..|
|00003100| 09 66 6f 72 20 28 69 3d | 30 3b 20 69 3c 34 3b 20 |.for (i=|0; i<4; |
|00003110| 69 2b 2b 29 0d 09 09 09 | 51 33 4f 62 6a 65 63 74 |i++)....|Q3Object|
|00003120| 5f 44 69 73 70 6f 73 65 | 49 66 4e 6f 74 4e 69 6c |_Dispose|IfNotNil|
|00003130| 28 76 69 65 77 65 72 2d | 3e 73 70 6f 74 4c 69 67 |(viewer-|>spotLig|
|00003140| 68 74 73 5b 69 5d 29 3b | 0d 09 09 51 33 4f 62 6a |hts[i]);|...Q3Obj|
|00003150| 65 63 74 5f 44 69 73 70 | 6f 73 65 49 66 4e 6f 74 |ect_Disp|oseIfNot|
|00003160| 4e 69 6c 28 76 69 65 77 | 65 72 2d 3e 61 6d 62 69 |Nil(view|er->ambi|
|00003170| 65 6e 74 4c 69 67 68 74 | 29 3b 0d 09 09 69 66 20 |entLight|);...if |
|00003180| 28 76 69 65 77 65 72 2d | 3e 7a 56 65 72 74 69 63 |(viewer-|>zVertic|
|00003190| 61 6c 43 74 6c 29 20 44 | 69 73 70 6f 73 65 43 6f |alCtl) D|isposeCo|
|000031a0| 6e 74 72 6f 6c 28 76 69 | 65 77 65 72 2d 3e 7a 56 |ntrol(vi|ewer->zV|
|000031b0| 65 72 74 69 63 61 6c 43 | 74 6c 29 3b 0d 09 09 69 |erticalC|tl);...i|
|000031c0| 66 20 28 76 69 65 77 65 | 72 2d 3e 73 70 69 6e 43 |f (viewe|r->spinC|
|000031d0| 74 6c 29 20 44 69 73 70 | 6f 73 65 43 6f 6e 74 72 |tl) Disp|oseContr|
|000031e0| 6f 6c 28 76 69 65 77 65 | 72 2d 3e 73 70 69 6e 43 |ol(viewe|r->spinC|
|000031f0| 74 6c 29 3b 0d 09 09 44 | 69 73 70 6f 73 65 50 74 |tl);...D|isposePt|
|00003200| 72 28 28 50 74 72 29 76 | 69 65 77 65 72 29 3b 0d |r((Ptr)v|iewer);.|
|00003210| 09 7d 0d 7d 0d 0d 0d 76 | 6f 69 64 20 50 33 56 69 |.}.}...v|oid P3Vi|
|00003220| 65 77 65 72 53 65 74 42 | 6f 75 6e 64 73 28 50 33 |ewerSetB|ounds(P3|
|00003230| 56 69 65 77 65 72 44 61 | 74 61 2a 20 63 6f 6e 73 |ViewerDa|ta* cons|
|00003240| 74 20 76 69 65 77 65 72 | 2c 20 52 65 63 74 2a 20 |t viewer|, Rect* |
|00003250| 63 6f 6e 73 74 20 62 6f | 75 6e 64 73 29 0d 09 2f |const bo|unds)../|
|00003260| 2f 20 73 65 74 73 20 74 | 68 65 20 65 6e 63 6c 6f |/ sets t|he enclo|
|00003270| 73 69 6e 67 20 62 6f 75 | 6e 64 73 20 6f 66 20 74 |sing bou|nds of t|
|00003280| 68 65 20 76 69 65 77 65 | 72 0d 7b 0d 09 54 51 33 |he viewe|r.{..TQ3|
|00003290| 44 72 61 77 43 6f 6e 74 | 65 78 74 4f 62 6a 65 63 |DrawCont|extObjec|
|000032a0| 74 09 63 6f 6e 74 65 78 | 74 3b 0d 09 54 51 33 41 |t.contex|t;..TQ3A|
|000032b0| 72 65 61 09 09 09 09 09 | 70 61 6e 65 3b 0d 09 52 |rea.....|pane;..R|
|000032c0| 65 63 74 09 09 09 09 09 | 72 20 3d 20 2a 62 6f 75 |ect.....|r = *bou|
|000032d0| 6e 64 73 3b 0d 09 73 68 | 6f 72 74 09 09 09 09 09 |nds;..sh|ort.....|
|000032e0| 63 6f 6e 74 72 6f 6c 4c | 65 66 74 2c 20 63 6f 6e |controlL|eft, con|
|000032f0| 74 72 6f 6c 54 6f 70 3b | 0d 09 42 6f 6f 6c 65 61 |trolTop;|..Boolea|
|00003300| 6e 09 09 09 09 09 77 69 | 74 68 43 6f 6e 74 72 6f |n.....wi|thContro|
|00003310| 6c 73 20 3d 20 28 76 69 | 65 77 65 72 2d 3e 66 6c |ls = (vi|ewer->fl|
|00003320| 61 67 73 20 26 20 6b 33 | 46 6c 61 67 57 69 74 68 |ags & k3|FlagWith|
|00003330| 50 6f 70 75 70 73 29 21 | 3d 30 3b 0d 09 73 68 6f |Popups)!|=0;..sho|
|00003340| 72 74 09 09 09 09 09 62 | 75 74 74 6f 6e 48 65 69 |rt.....b|uttonHei|
|00003350| 67 68 74 20 3d 20 77 69 | 74 68 43 6f 6e 74 72 6f |ght = wi|thContro|
|00003360| 6c 73 3f 20 42 55 54 54 | 4f 4e 5f 48 45 49 47 48 |ls? BUTT|ON_HEIGH|
|00003370| 54 3a 30 3b 0d 0d 09 50 | 33 56 69 65 77 65 72 49 |T:0;...P|3ViewerI|
|00003380| 6e 76 61 6c 69 64 61 74 | 65 28 76 69 65 77 65 72 |nvalidat|e(viewer|
|00003390| 29 3b 09 09 09 2f 2f 20 | 69 6e 76 61 6c 69 64 61 |);...// |invalida|
|000033a0| 74 65 20 6f 6c 64 20 72 | 65 63 74 0d 09 76 69 65 |te old r|ect..vie|
|000033b0| 77 65 72 2d 3e 62 6f 75 | 6e 64 73 20 3d 20 2a 62 |wer->bou|nds = *b|
|000033c0| 6f 75 6e 64 73 3b 0d 09 | 72 2e 74 6f 70 20 3d 20 |ounds;..|r.top = |
|000033d0| 72 2e 62 6f 74 74 6f 6d | 2d 62 75 74 74 6f 6e 48 |r.bottom|-buttonH|
|000033e0| 65 69 67 68 74 3b 0d 09 | 76 69 65 77 65 72 2d 3e |eight;..|viewer->|
|000033f0| 62 75 74 74 6f 6e 52 65 | 63 74 20 3d 20 72 3b 0d |buttonRe|ct = r;.|
|00003400| 09 72 20 3d 20 2a 62 6f | 75 6e 64 73 3b 0d 09 72 |.r = *bo|unds;..r|
|00003410| 2e 62 6f 74 74 6f 6d 20 | 2d 3d 20 62 75 74 74 6f |.bottom |-= butto|
|00003420| 6e 48 65 69 67 68 74 3b | 0d 09 76 69 65 77 65 72 |nHeight;|..viewer|
|00003430| 2d 3e 76 69 65 77 52 65 | 63 74 20 3d 20 72 3b 0d |->viewRe|ct = r;.|
|00003440| 0d 09 69 66 20 28 77 69 | 74 68 43 6f 6e 74 72 6f |..if (wi|thContro|
|00003450| 6c 73 29 0d 09 7b 09 63 | 6f 6e 74 72 6f 6c 4c 65 |ls)..{.c|ontrolLe|
|00003460| 66 74 20 3d 20 76 69 65 | 77 65 72 2d 3e 62 75 74 |ft = vie|wer->but|
|00003470| 74 6f 6e 52 65 63 74 2e | 6c 65 66 74 20 2b 20 31 |tonRect.|left + 1|
|00003480| 30 3b 0d 09 09 63 6f 6e | 74 72 6f 6c 54 6f 70 20 |0;...con|trolTop |
|00003490| 3d 20 76 69 65 77 65 72 | 2d 3e 62 75 74 74 6f 6e |= viewer|->button|
|000034a0| 52 65 63 74 2e 74 6f 70 | 20 2b 20 31 38 3b 0d 09 |Rect.top| + 18;..|
|000034b0| 09 4d 6f 76 65 43 6f 6e | 74 72 6f 6c 28 76 69 65 |.MoveCon|trol(vie|
|000034c0| 77 65 72 2d 3e 7a 56 65 | 72 74 69 63 61 6c 43 74 |wer->zVe|rticalCt|
|000034d0| 6c 2c 20 63 6f 6e 74 72 | 6f 6c 4c 65 66 74 2c 20 |l, contr|olLeft, |
|000034e0| 63 6f 6e 74 72 6f 6c 54 | 6f 70 29 3b 0d 09 09 4d |controlT|op);...M|
|000034f0| 6f 76 65 43 6f 6e 74 72 | 6f 6c 28 76 69 65 77 65 |oveContr|ol(viewe|
|00003500| 72 2d 3e 73 70 69 6e 43 | 74 6c 2c 20 63 6f 6e 74 |r->spinC|tl, cont|
|00003510| 72 6f 6c 4c 65 66 74 2b | 31 35 30 2c 20 63 6f 6e |rolLeft+|150, con|
|00003520| 74 72 6f 6c 54 6f 70 29 | 3b 0d 09 7d 0d 09 70 61 |trolTop)|;..}..pa|
|00003530| 6e 65 2e 6d 69 6e 2e 78 | 20 3d 20 28 66 6c 6f 61 |ne.min.x| = (floa|
|00003540| 74 29 72 2e 6c 65 66 74 | 3b 0d 09 70 61 6e 65 2e |t)r.left|;..pane.|
|00003550| 6d 61 78 2e 78 20 3d 20 | 28 66 6c 6f 61 74 29 72 |max.x = |(float)r|
|00003560| 2e 72 69 67 68 74 3b 0d | 09 70 61 6e 65 2e 6d 69 |.right;.|.pane.mi|
|00003570| 6e 2e 79 20 3d 20 28 66 | 6c 6f 61 74 29 72 2e 74 |n.y = (f|loat)r.t|
|00003580| 6f 70 3b 0d 09 70 61 6e | 65 2e 6d 61 78 2e 79 20 |op;..pan|e.max.y |
|00003590| 3d 20 28 66 6c 6f 61 74 | 29 72 2e 62 6f 74 74 6f |= (float|)r.botto|
|000035a0| 6d 3b 0d 0d 09 69 66 20 | 28 51 33 56 69 65 77 5f |m;...if |(Q3View_|
|000035b0| 47 65 74 44 72 61 77 43 | 6f 6e 74 65 78 74 28 76 |GetDrawC|ontext(v|
|000035c0| 69 65 77 65 72 2d 3e 76 | 69 65 77 2c 20 26 63 6f |iewer->v|iew, &co|
|000035d0| 6e 74 65 78 74 29 20 3d | 3d 20 6b 51 33 53 75 63 |ntext) =|= kQ3Suc|
|000035e0| 63 65 73 73 29 0d 09 7b | 09 51 33 44 72 61 77 43 |cess)..{|.Q3DrawC|
|000035f0| 6f 6e 74 65 78 74 5f 53 | 65 74 50 61 6e 65 28 63 |ontext_S|etPane(c|
|00003600| 6f 6e 74 65 78 74 2c 20 | 26 70 61 6e 65 29 3b 0d |ontext, |&pane);.|
|00003610| 09 09 51 33 4f 62 6a 65 | 63 74 5f 44 69 73 70 6f |..Q3Obje|ct_Dispo|
|00003620| 73 65 28 63 6f 6e 74 65 | 78 74 29 3b 0d 09 7d 0d |se(conte|xt);..}.|
|00003630| 09 50 33 56 69 65 77 65 | 72 49 6e 76 61 6c 69 64 |.P3Viewe|rInvalid|
|00003640| 61 74 65 28 76 69 65 77 | 65 72 29 3b 09 09 09 2f |ate(view|er);.../|
|00003650| 2f 20 69 6e 76 61 6c 69 | 64 61 74 65 20 6e 65 77 |/ invali|date new|
|00003660| 20 72 65 63 74 0d 7d 0d | 0d 0d 73 74 61 74 69 63 | rect.}.|..static|
|00003670| 20 42 6f 6f 6c 65 61 6e | 20 47 65 74 43 6c 69 63 | Boolean| GetClic|
|00003680| 6b 65 64 56 65 63 74 6f | 72 28 50 33 56 69 65 77 |kedVecto|r(P3View|
|00003690| 65 72 44 61 74 61 2a 20 | 63 6f 6e 73 74 20 76 69 |erData* |const vi|
|000036a0| 65 77 65 72 2c 20 50 6f | 69 6e 74 20 70 74 2c 20 |ewer, Po|int pt, |
|000036b0| 54 51 33 56 65 63 74 6f | 72 33 44 2a 20 63 6f 6e |TQ3Vecto|r3D* con|
|000036c0| 73 74 20 76 2c 0d 09 09 | 54 51 33 4d 61 74 72 69 |st v,...|TQ3Matri|
|000036d0| 78 34 78 34 2a 20 63 6f | 6e 73 74 20 6d 29 0d 09 |x4x4* co|nst m)..|
|000036e0| 2f 2f 20 72 65 74 75 72 | 6e 73 20 69 6e 20 76 20 |// retur|ns in v |
|000036f0| 74 68 65 20 76 65 63 74 | 6f 72 20 6f 6e 20 74 68 |the vect|or on th|
|00003700| 65 20 75 6e 69 74 20 73 | 70 68 65 72 65 20 63 6f |e unit s|phere co|
|00003710| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 74 6f 20 70 |rrespond|ing to p|
|00003720| 74 0d 09 2f 2f 20 6d 3a | 20 61 20 6d 61 74 72 69 |t..// m:| a matri|
|00003730| 78 20 66 6f 72 20 74 72 | 61 6e 73 66 6f 72 6d 69 |x for tr|ansformi|
|00003740| 6e 67 20 66 72 6f 6d 20 | 74 68 65 20 63 6f 6f 72 |ng from |the coor|
|00003750| 64 20 73 79 73 74 65 6d | 20 6f 66 20 74 68 65 20 |d system| of the |
|00003760| 63 61 6d 65 72 61 20 74 | 6f 20 74 68 65 20 77 6f |camera t|o the wo|
|00003770| 72 6c 64 20 73 79 73 74 | 65 6d 0d 7b 0d 09 52 65 |rld syst|em.{..Re|
|00003780| 63 74 09 09 09 72 20 3d | 20 76 69 65 77 65 72 2d |ct...r =| viewer-|
|00003790| 3e 76 69 65 77 52 65 63 | 74 3b 0d 09 54 51 33 50 |>viewRec|t;..TQ3P|
|000037a0| 6f 69 6e 74 32 44 09 09 | 63 65 6e 74 65 72 3b 0d |oint2D..|center;.|
|000037b0| 09 54 51 33 50 6f 69 6e | 74 32 44 09 09 6d 6f 75 |.TQ3Poin|t2D..mou|
|000037c0| 73 65 3b 0d 09 66 6c 6f | 61 74 09 09 09 72 61 64 |se;..flo|at...rad|
|000037d0| 69 75 73 32 3b 0d 09 54 | 51 33 56 65 63 74 6f 72 |ius2;..T|Q3Vector|
|000037e0| 32 44 09 09 76 32 64 3b | 09 09 09 2f 2f 20 76 65 |2D..v2d;|...// ve|
|000037f0| 63 74 6f 72 20 66 72 6f | 6d 20 63 65 6e 74 65 72 |ctor fro|m center|
|00003800| 20 74 6f 20 6d 6f 75 73 | 65 0d 09 42 6f 6f 6c 65 | to mous|e..Boole|
|00003810| 61 6e 09 09 09 72 65 74 | 76 61 6c 20 3d 20 74 72 |an...ret|val = tr|
|00003820| 75 65 3b 0d 09 54 51 33 | 56 65 63 74 6f 72 33 44 |ue;..TQ3|Vector3D|
|00003830| 09 09 76 31 3b 0d 0d 09 | 51 33 50 6f 69 6e 74 32 |..v1;...|Q3Point2|
|00003840| 44 5f 53 65 74 28 26 63 | 65 6e 74 65 72 2c 20 28 |D_Set(&c|enter, (|
|00003850| 72 2e 6c 65 66 74 2b 72 | 2e 72 69 67 68 74 29 2f |r.left+r|.right)/|
|00003860| 32 2e 30 2c 20 28 72 2e | 74 6f 70 2b 72 2e 62 6f |2.0, (r.|top+r.bo|
|00003870| 74 74 6f 6d 29 2f 32 2e | 30 29 3b 0d 09 51 33 50 |ttom)/2.|0);..Q3P|
|00003880| 6f 69 6e 74 32 44 5f 53 | 65 74 28 26 6d 6f 75 73 |oint2D_S|et(&mous|
|00003890| 65 2c 20 70 74 2e 68 2c | 20 70 74 2e 76 29 3b 0d |e, pt.h,| pt.v);.|
|000038a0| 09 51 33 56 65 63 74 6f | 72 32 44 5f 53 65 74 28 |.Q3Vecto|r2D_Set(|
|000038b0| 26 76 32 64 2c 20 6d 6f | 75 73 65 2e 78 2d 63 65 |&v2d, mo|use.x-ce|
|000038c0| 6e 74 65 72 2e 78 2c 20 | 6d 6f 75 73 65 2e 79 2d |nter.x, |mouse.y-|
|000038d0| 63 65 6e 74 65 72 2e 79 | 29 3b 0d 09 76 32 64 2e |center.y|);..v2d.|
|000038e0| 78 20 2a 3d 20 28 32 2e | 35 2f 28 66 6c 6f 61 74 |x *= (2.|5/(float|
|000038f0| 29 28 72 2e 72 69 67 68 | 74 2d 72 2e 6c 65 66 74 |)(r.righ|t-r.left|
|00003900| 29 29 3b 09 09 09 2f 2f | 20 6e 6f 72 6d 61 6c 69 |));...//| normali|
|00003910| 7a 65 0d 09 76 32 64 2e | 79 20 2a 3d 20 28 32 2e |ze..v2d.|y *= (2.|
|00003920| 35 2f 28 66 6c 6f 61 74 | 29 28 72 2e 74 6f 70 2d |5/(float|)(r.top-|
|00003930| 72 2e 62 6f 74 74 6f 6d | 29 29 3b 0d 09 72 61 64 |r.bottom|));..rad|
|00003940| 69 75 73 32 20 3d 20 76 | 32 64 2e 78 2a 76 32 64 |ius2 = v|2d.x*v2d|
|00003950| 2e 78 20 2b 20 76 32 64 | 2e 79 2a 76 32 64 2e 79 |.x + v2d|.y*v2d.y|
|00003960| 3b 0d 0d 09 69 66 20 28 | 72 61 64 69 75 73 32 20 |;...if (|radius2 |
|00003970| 3c 20 31 2e 30 29 09 09 | 09 2f 2f 20 69 66 20 75 |< 1.0)..|.// if u|
|00003980| 6e 69 74 20 73 70 68 65 | 72 65 20 63 6c 69 63 6b |nit sphe|re click|
|00003990| 65 64 0d 09 09 51 33 56 | 65 63 74 6f 72 33 44 5f |ed...Q3V|ector3D_|
|000039a0| 53 65 74 28 26 76 31 2c | 20 2d 76 32 64 2e 78 2c |Set(&v1,| -v2d.x,|
|000039b0| 20 73 71 72 74 28 31 2e | 30 2d 72 61 64 69 75 73 | sqrt(1.|0-radius|
|000039c0| 32 29 2c 20 76 32 64 2e | 79 29 3b 0d 09 65 6c 73 |2), v2d.|y);..els|
|000039d0| 65 0d 09 7b 0d 09 09 51 | 33 56 65 63 74 6f 72 33 |e..{...Q|3Vector3|
|000039e0| 44 5f 53 65 74 28 26 76 | 31 2c 20 2d 76 32 64 2e |D_Set(&v|1, -v2d.|
|000039f0| 78 2f 73 71 72 74 28 72 | 61 64 69 75 73 32 29 2c |x/sqrt(r|adius2),|
|00003a00| 20 30 2c 20 76 32 64 2e | 79 2f 73 71 72 74 28 72 | 0, v2d.|y/sqrt(r|
|00003a10| 61 64 69 75 73 32 29 29 | 3b 0d 09 09 72 65 74 76 |adius2))|;...retv|
|00003a20| 61 6c 20 3d 20 66 61 6c | 73 65 3b 0d 09 7d 0d 09 |al = fal|se;..}..|
|00003a30| 0d 09 51 33 56 65 63 74 | 6f 72 33 44 5f 54 72 61 |..Q3Vect|or3D_Tra|
|00003a40| 6e 73 66 6f 72 6d 28 26 | 76 31 2c 20 6d 2c 20 76 |nsform(&|v1, m, v|
|00003a50| 29 3b 0d 09 72 65 74 75 | 72 6e 20 72 65 74 76 61 |);..retu|rn retva|
|00003a60| 6c 3b 0d 7d 0d 09 0d 73 | 74 61 74 69 63 20 76 6f |l;.}...s|tatic vo|
|00003a70| 69 64 20 4d 61 6b 65 53 | 70 69 6e 56 65 72 74 69 |id MakeS|pinVerti|
|00003a80| 63 61 6c 49 66 4e 65 63 | 65 73 73 61 72 79 28 50 |calIfNec|essary(P|
|00003a90| 33 56 69 65 77 65 72 44 | 61 74 61 2a 20 63 6f 6e |3ViewerD|ata* con|
|00003aa0| 73 74 20 76 69 65 77 65 | 72 29 0d 7b 0d 09 2f 2f |st viewe|r).{..//|
|00003ab0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 63 | the fol|lowing c|
|00003ac0| 6f 64 65 20 69 73 20 66 | 6f 72 20 69 76 61 6e 3a |ode is f|or ivan:|
|00003ad0| 20 69 66 20 77 65 20 61 | 72 65 20 73 70 69 6e 6e | if we a|re spinn|
|00003ae0| 69 6e 67 20 77 69 74 68 | 20 7a 56 65 72 74 69 63 |ing with| zVertic|
|00003af0| 61 6c 2c 20 77 65 20 74 | 61 6b 65 20 63 61 72 65 |al, we t|ake care|
|00003b00| 20 74 68 61 74 20 74 68 | 65 20 7a 2d 61 78 69 73 | that th|e z-axis|
|00003b10| 20 69 73 20 6e 6f 74 20 | 72 6f 74 61 74 65 64 0d | is not |rotated.|
|00003b20| 09 54 51 33 56 65 63 74 | 6f 72 33 44 09 09 76 65 |.TQ3Vect|or3D..ve|
|00003b30| 63 74 6f 72 31 3b 0d 09 | 54 51 33 4d 61 74 72 69 |ctor1;..|TQ3Matri|
|00003b40| 78 34 78 34 09 6d 3b 0d | 09 51 33 4d 61 74 72 69 |x4x4.m;.|.Q3Matri|
|00003b50| 78 34 78 34 5f 53 65 74 | 49 64 65 6e 74 69 74 79 |x4x4_Set|Identity|
|00003b60| 28 26 6d 29 3b 0d 09 69 | 66 20 28 21 47 65 74 43 |(&m);..i|f (!GetC|
|00003b70| 6f 6e 74 72 6f 6c 56 61 | 6c 75 65 28 76 69 65 77 |ontrolVa|lue(view|
|00003b80| 65 72 2d 3e 7a 56 65 72 | 74 69 63 61 6c 43 74 6c |er->zVer|ticalCtl|
|00003b90| 29 29 20 72 65 74 75 72 | 6e 3b 09 2f 2f 20 69 66 |)) retur|n;.// if|
|00003ba0| 20 77 65 20 6e 65 65 64 | 20 6e 6f 74 20 6b 65 65 | we need| not kee|
|00003bb0| 70 20 7a 20 76 65 72 74 | 69 63 61 6c 0d 09 69 66 |p z vert|ical..if|
|00003bc0| 20 28 21 51 33 4d 61 74 | 72 69 78 34 78 34 5f 43 | (!Q3Mat|rix4x4_C|
|00003bd0| 6f 6d 70 61 72 65 28 26 | 73 70 69 6e 2c 20 26 6d |ompare(&|spin, &m|
|00003be0| 29 29 09 09 09 09 2f 2f | 20 69 66 20 77 65 20 73 |))....//| if we s|
|00003bf0| 70 69 6e 0d 09 7b 0d 09 | 09 73 74 61 74 69 63 20 |pin..{..|.static |
|00003c00| 63 6f 6e 73 74 20 54 51 | 33 56 65 63 74 6f 72 33 |const TQ|3Vector3|
|00003c10| 44 20 70 6c 75 73 5a 20 | 3d 20 7b 30 2c 30 2c 31 |D plusZ |= {0,0,1|
|00003c20| 7d 3b 0d 09 09 51 33 56 | 65 63 74 6f 72 33 44 5f |};...Q3V|ector3D_|
|00003c30| 54 72 61 6e 73 66 6f 72 | 6d 28 26 70 6c 75 73 5a |Transfor|m(&plusZ|
|00003c40| 2c 20 26 73 70 69 6e 2c | 20 26 76 65 63 74 6f 72 |, &spin,| &vector|
|00003c50| 31 29 3b 0d 09 09 51 33 | 4d 61 74 72 69 78 34 78 |1);...Q3|Matrix4x|
|00003c60| 34 5f 53 65 74 52 6f 74 | 61 74 65 56 65 63 74 6f |4_SetRot|ateVecto|
|00003c70| 72 54 6f 56 65 63 74 6f | 72 28 26 6d 2c 20 26 76 |rToVecto|r(&m, &v|
|00003c80| 65 63 74 6f 72 31 2c 20 | 26 70 6c 75 73 5a 29 3b |ector1, |&plusZ);|
|00003c90| 09 2f 2f 20 74 6f 20 72 | 6f 74 61 74 65 20 7a 20 |.// to r|otate z |
|00003ca0| 62 61 63 6b 0d 09 09 51 | 33 4d 61 74 72 69 78 34 |back...Q|3Matrix4|
|00003cb0| 78 34 5f 4d 75 6c 74 69 | 70 6c 79 28 26 73 70 69 |x4_Multi|ply(&spi|
|00003cc0| 6e 2c 20 26 6d 2c 20 26 | 73 70 69 6e 29 3b 0d 09 |n, &m, &|spin);..|
|00003cd0| 7d 0d 09 0d 7d 0d 0d 0d | 42 6f 6f 6c 65 61 6e 20 |}...}...|Boolean |
|00003ce0| 50 33 56 69 65 77 65 72 | 45 76 65 6e 74 28 50 33 |P3Viewer|Event(P3|
|00003cf0| 56 69 65 77 65 72 44 61 | 74 61 2a 20 63 6f 6e 73 |ViewerDa|ta* cons|
|00003d00| 74 20 76 69 65 77 65 72 | 2c 20 45 76 65 6e 74 52 |t viewer|, EventR|
|00003d10| 65 63 6f 72 64 2a 20 63 | 6f 6e 73 74 20 65 76 65 |ecord* c|onst eve|
|00003d20| 6e 74 29 0d 09 2f 2f 20 | 74 72 79 20 68 61 6e 64 |nt)..// |try hand|
|00003d30| 6c 69 6e 67 20 61 6e 20 | 65 76 65 6e 74 2c 20 72 |ling an |event, r|
|00003d40| 65 74 75 72 6e 20 74 72 | 75 65 20 69 66 20 68 61 |eturn tr|ue if ha|
|00003d50| 6e 64 6c 65 64 0d 7b 0d | 09 42 6f 6f 6c 65 61 6e |ndled.{.|.Boolean|
|00003d60| 09 09 72 65 74 76 61 6c | 20 3d 20 66 61 6c 73 65 |..retval| = false|
|00003d70| 3b 0d 09 47 72 61 66 50 | 74 72 09 09 6f 6c 64 50 |;..GrafP|tr..oldP|
|00003d80| 6f 72 74 3b 0d 09 73 74 | 61 74 69 63 20 6c 6f 6e |ort;..st|atic lon|
|00003d90| 67 09 6e 65 78 74 52 6f | 74 61 74 69 6f 6e 20 3d |g.nextRo|tation =|
|00003da0| 20 30 3b 09 09 09 2f 2f | 20 74 68 65 20 74 69 6d | 0;...//| the tim|
|00003db0| 65 20 66 6f 72 20 74 68 | 65 20 6e 65 78 74 20 72 |e for th|e next r|
|00003dc0| 6f 74 61 74 69 6f 6e 0d | 0d 09 47 65 74 50 6f 72 |otation.|..GetPor|
|00003dd0| 74 28 26 6f 6c 64 50 6f | 72 74 29 3b 0d 09 53 65 |t(&oldPo|rt);..Se|
|00003de0| 74 50 6f 72 74 28 28 47 | 72 61 66 50 74 72 29 47 |tPort((G|rafPtr)G|
|00003df0| 65 74 57 69 6e 64 6f 77 | 50 6f 72 74 28 76 69 65 |etWindow|Port(vie|
|00003e00| 77 65 72 2d 3e 77 69 6e | 64 6f 77 29 29 3b 0d 0d |wer->win|dow));..|
|00003e10| 09 73 77 69 74 63 68 20 | 28 65 76 65 6e 74 2d 3e |.switch |(event->|
|00003e20| 77 68 61 74 29 0d 09 7b | 0d 09 09 63 61 73 65 20 |what)..{|...case |
|00003e30| 6d 6f 75 73 65 44 6f 77 | 6e 3a 0d 09 09 09 7b 0d |mouseDow|n:....{.|
|00003e40| 09 09 09 09 50 6f 69 6e | 74 09 77 68 65 72 65 20 |....Poin|t.where |
|00003e50| 3d 20 65 76 65 6e 74 2d | 3e 77 68 65 72 65 3b 0d |= event-|>where;.|
|00003e60| 0d 09 09 09 09 47 6c 6f | 62 61 6c 54 6f 4c 6f 63 |.....Glo|balToLoc|
|00003e70| 61 6c 28 26 77 68 65 72 | 65 29 3b 0d 09 09 09 09 |al(&wher|e);.....|
|00003e80| 69 66 20 28 50 74 49 6e | 52 65 63 74 28 77 68 65 |if (PtIn|Rect(whe|
|00003e90| 72 65 2c 20 26 76 69 65 | 77 65 72 2d 3e 62 6f 75 |re, &vie|wer->bou|
|00003ea0| 6e 64 73 29 29 0d 09 09 | 09 09 7b 0d 09 09 09 09 |nds))...|..{.....|
|00003eb0| 09 52 65 63 74 09 72 20 | 3d 20 76 69 65 77 65 72 |.Rect.r |= viewer|
|00003ec0| 2d 3e 76 69 65 77 52 65 | 63 74 3b 0d 09 09 09 09 |->viewRe|ct;.....|
|00003ed0| 09 69 66 20 28 50 74 49 | 6e 52 65 63 74 28 77 68 |.if (PtI|nRect(wh|
|00003ee0| 65 72 65 2c 20 26 72 29 | 29 09 09 09 2f 2f 20 69 |ere, &r)|)...// i|
|00003ef0| 66 20 63 6c 69 63 6b 65 | 64 20 77 69 74 68 69 6e |f clicke|d within|
|00003f00| 20 76 69 65 77 52 65 63 | 74 0d 09 09 09 09 09 7b | viewRec|t......{|
|00003f10| 0d 09 09 09 09 09 09 54 | 51 33 4d 61 74 72 69 78 |.......T|Q3Matrix|
|00003f20| 34 78 34 09 6d 3b 0d 09 | 09 09 09 09 09 54 51 33 |4x4.m;..|.....TQ3|
|00003f30| 56 65 63 74 6f 72 33 44 | 09 09 63 61 6d 65 72 61 |Vector3D|..camera|
|00003f40| 44 69 72 65 63 74 69 6f | 6e 3b 09 2f 2f 20 76 65 |Directio|n;.// ve|
|00003f50| 63 74 6f 72 20 66 72 6f | 6d 20 63 61 6d 65 72 61 |ctor fro|m camera|
|00003f60| 20 74 6f 20 70 6f 69 6e | 74 20 6f 66 20 69 6e 74 | to poin|t of int|
|00003f70| 65 72 65 73 74 0d 09 09 | 09 09 09 09 54 51 33 56 |erest...|....TQ3V|
|00003f80| 65 63 74 6f 72 33 44 09 | 09 70 61 6e 65 58 2c 20 |ector3D.|.paneX, |
|00003f90| 70 61 6e 65 59 3b 09 09 | 2f 2f 20 75 6e 69 74 20 |paneY;..|// unit |
|00003fa0| 76 65 63 74 6f 72 73 20 | 69 6e 20 76 69 65 77 20 |vectors |in view |
|00003fb0| 70 61 6e 65 0d 0d 09 09 | 09 09 09 09 51 33 50 6f |pane....|....Q3Po|
|00003fc0| 69 6e 74 33 44 5f 53 75 | 62 74 72 61 63 74 28 26 |int3D_Su|btract(&|
|00003fd0| 70 6f 69 6e 74 43 61 6d | 44 61 74 61 2e 63 61 6d |pointCam|Data.cam|
|00003fe0| 65 72 61 44 61 74 61 2e | 70 6c 61 63 65 6d 65 6e |eraData.|placemen|
|00003ff0| 74 2e 70 6f 69 6e 74 4f | 66 49 6e 74 65 72 65 73 |t.pointO|fInteres|
|00004000| 74 2c 0d 09 09 09 09 09 | 09 09 09 09 09 09 26 70 |t,......|......&p|
|00004010| 6f 69 6e 74 43 61 6d 44 | 61 74 61 2e 63 61 6d 65 |ointCamD|ata.came|
|00004020| 72 61 44 61 74 61 2e 70 | 6c 61 63 65 6d 65 6e 74 |raData.p|lacement|
|00004030| 2e 63 61 6d 65 72 61 4c | 6f 63 61 74 69 6f 6e 2c |.cameraL|ocation,|
|00004040| 0d 09 09 09 09 09 09 09 | 09 09 09 09 26 63 61 6d |........|....&cam|
|00004050| 65 72 61 44 69 72 65 63 | 74 69 6f 6e 29 3b 0d 09 |eraDirec|tion);..|
|00004060| 09 09 09 09 09 51 33 56 | 65 63 74 6f 72 33 44 5f |.....Q3V|ector3D_|
|00004070| 43 72 6f 73 73 28 26 63 | 61 6d 65 72 61 44 69 72 |Cross(&c|ameraDir|
|00004080| 65 63 74 69 6f 6e 2c 0d | 09 09 09 09 09 09 09 09 |ection,.|........|
|00004090| 09 09 09 26 70 6f 69 6e | 74 43 61 6d 44 61 74 61 |...&poin|tCamData|
|000040a0| 2e 63 61 6d 65 72 61 44 | 61 74 61 2e 70 6c 61 63 |.cameraD|ata.plac|
|000040b0| 65 6d 65 6e 74 2e 75 70 | 56 65 63 74 6f 72 2c 0d |ement.up|Vector,.|
|000040c0| 09 09 09 09 09 09 09 09 | 09 09 09 26 70 61 6e 65 |........|...&pane|
|000040d0| 58 29 3b 0d 09 09 09 09 | 09 09 51 33 56 65 63 74 |X);.....|..Q3Vect|
|000040e0| 6f 72 33 44 5f 4e 6f 72 | 6d 61 6c 69 7a 65 28 26 |or3D_Nor|malize(&|
|000040f0| 70 61 6e 65 58 2c 20 26 | 70 61 6e 65 58 29 3b 0d |paneX, &|paneX);.|
|00004100| 09 09 09 09 09 09 51 33 | 56 65 63 74 6f 72 33 44 |......Q3|Vector3D|
|00004110| 5f 4e 6f 72 6d 61 6c 69 | 7a 65 28 26 70 6f 69 6e |_Normali|ze(&poin|
|00004120| 74 43 61 6d 44 61 74 61 | 2e 63 61 6d 65 72 61 44 |tCamData|.cameraD|
|00004130| 61 74 61 2e 70 6c 61 63 | 65 6d 65 6e 74 2e 75 70 |ata.plac|ement.up|
|00004140| 56 65 63 74 6f 72 2c 20 | 26 70 61 6e 65 59 29 3b |Vector, |&paneY);|
|00004150| 0d 09 09 09 09 09 09 09 | 09 09 09 09 0d 09 09 09 |........|........|
|00004160| 09 09 09 69 66 20 28 53 | 68 69 66 74 50 72 65 73 |...if (S|hiftPres|
|00004170| 73 65 64 28 29 29 09 09 | 09 09 2f 2f 20 69 66 20 |sed())..|..// if |
|00004180| 6d 6f 76 69 6e 67 0d 09 | 09 09 09 09 09 7b 0d 09 |moving..|.....{..|
|00004190| 09 09 09 09 09 09 66 6c | 6f 61 74 09 73 20 3d 20 |......fl|oat.s = |
|000041a0| 73 69 6e 28 70 6f 69 6e | 74 43 61 6d 44 61 74 61 |sin(poin|tCamData|
|000041b0| 2e 66 6f 76 29 2a 0d 09 | 09 09 09 09 09 09 09 09 |.fov)*..|........|
|000041c0| 09 09 51 33 56 65 63 74 | 6f 72 33 44 5f 4c 65 6e |..Q3Vect|or3D_Len|
|000041d0| 67 74 68 28 26 63 61 6d | 65 72 61 44 69 72 65 63 |gth(&cam|eraDirec|
|000041e0| 74 69 6f 6e 29 3b 0d 09 | 09 09 09 09 09 09 0d 09 |tion);..|........|
|000041f0| 09 09 09 09 09 09 77 68 | 69 6c 65 20 28 53 74 69 |......wh|ile (Sti|
|00004200| 6c 6c 44 6f 77 6e 28 29 | 29 0d 09 09 09 09 09 09 |llDown()|).......|
|00004210| 09 7b 09 50 6f 69 6e 74 | 09 6f 6c 64 57 68 65 72 |.{.Point|.oldWher|
|00004220| 65 20 3d 20 77 68 65 72 | 65 3b 0d 09 09 09 09 09 |e = wher|e;......|
|00004230| 09 09 09 64 6f 20 47 65 | 74 4d 6f 75 73 65 28 26 |...do Ge|tMouse(&|
|00004240| 77 68 65 72 65 29 3b 0d | 09 09 09 09 09 09 09 09 |where);.|........|
|00004250| 77 68 69 6c 65 20 28 53 | 74 69 6c 6c 44 6f 77 6e |while (S|tillDown|
|00004260| 28 29 20 26 26 20 45 71 | 75 61 6c 50 74 28 77 68 |() && Eq|ualPt(wh|
|00004270| 65 72 65 2c 20 6f 6c 64 | 57 68 65 72 65 29 29 3b |ere, old|Where));|
|00004280| 0d 09 09 09 09 09 09 09 | 09 69 66 20 28 53 74 69 |........|.if (Sti|
|00004290| 6c 6c 44 6f 77 6e 28 29 | 29 0d 09 09 09 09 09 09 |llDown()|).......|
|000042a0| 09 09 7b 09 66 6c 6f 61 | 74 20 64 78 20 3d 20 73 |..{.floa|t dx = s|
|000042b0| 2a 20 28 77 68 65 72 65 | 2e 68 2d 6f 6c 64 57 68 |* (where|.h-oldWh|
|000042c0| 65 72 65 2e 68 29 20 2f | 20 28 72 2e 72 69 67 68 |ere.h) /| (r.righ|
|000042d0| 74 2d 72 2e 6c 65 66 74 | 29 3b 0d 09 09 09 09 09 |t-r.left|);......|
|000042e0| 09 09 09 09 66 6c 6f 61 | 74 20 64 79 20 3d 20 73 |....floa|t dy = s|
|000042f0| 2a 20 28 77 68 65 72 65 | 2e 76 2d 6f 6c 64 57 68 |* (where|.v-oldWh|
|00004300| 65 72 65 2e 76 29 20 2f | 20 28 72 2e 74 6f 70 2d |ere.v) /| (r.top-|
|00004310| 72 2e 62 6f 74 74 6f 6d | 29 3b 0d 09 09 09 09 09 |r.bottom|);......|
|00004320| 09 09 09 09 54 51 33 56 | 65 63 74 6f 72 33 44 09 |....TQ3V|ector3D.|
|00004330| 74 31 2c 20 74 32 2c 20 | 74 72 61 6e 73 3b 0d 09 |t1, t2, |trans;..|
|00004340| 09 09 09 09 09 09 09 09 | 51 33 56 65 63 74 6f 72 |........|Q3Vector|
|00004350| 33 44 5f 41 64 64 28 09 | 51 33 56 65 63 74 6f 72 |3D_Add(.|Q3Vector|
|00004360| 33 44 5f 53 63 61 6c 65 | 28 26 70 61 6e 65 58 2c |3D_Scale|(&paneX,|
|00004370| 20 2d 64 78 2c 20 26 74 | 31 29 2c 0d 09 09 09 09 | -dx, &t|1),.....|
|00004380| 09 09 09 09 09 09 09 09 | 09 51 33 56 65 63 74 6f |........|.Q3Vecto|
|00004390| 72 33 44 5f 53 63 61 6c | 65 28 26 70 61 6e 65 59 |r3D_Scal|e(&paneY|
|000043a0| 2c 20 2d 64 79 2c 20 26 | 74 32 29 2c 0d 09 09 09 |, -dy, &|t2),....|
|000043b0| 09 09 09 09 09 09 09 09 | 09 09 26 74 72 61 6e 73 |........|..&trans|
|000043c0| 29 3b 0d 2f 2f 09 09 09 | 09 09 09 09 09 09 51 33 |);.//...|......Q3|
|000043d0| 4d 61 74 72 69 78 34 78 | 34 5f 53 65 74 54 72 61 |Matrix4x|4_SetTra|
|000043e0| 6e 73 6c 61 74 65 28 26 | 6d 2c 20 74 72 61 6e 73 |nslate(&|m, trans|
|000043f0| 2e 78 2c 20 74 72 61 6e | 73 2e 79 2c 20 74 72 61 |.x, tran|s.y, tra|
|00004400| 6e 73 2e 7a 29 3b 0d 2f | 2f 09 09 09 09 09 09 09 |ns.z);./|/.......|
|00004410| 09 09 51 33 4d 61 74 72 | 69 78 34 78 34 5f 4d 75 |..Q3Matr|ix4x4_Mu|
|00004420| 6c 74 69 70 6c 79 28 26 | 72 6f 74 61 74 69 6f 6e |ltiply(&|rotation|
|00004430| 2c 20 26 6d 2c 20 26 72 | 6f 74 61 74 69 6f 6e 29 |, &m, &r|otation)|
|00004440| 3b 0d 09 09 09 09 09 09 | 09 09 09 51 33 50 6f 69 |;.......|...Q3Poi|
|00004450| 6e 74 33 44 5f 56 65 63 | 74 6f 72 33 44 5f 41 64 |nt3D_Vec|tor3D_Ad|
|00004460| 64 28 09 26 70 6f 69 6e | 74 43 61 6d 44 61 74 61 |d(.&poin|tCamData|
|00004470| 2e 63 61 6d 65 72 61 44 | 61 74 61 2e 70 6c 61 63 |.cameraD|ata.plac|
|00004480| 65 6d 65 6e 74 2e 70 6f | 69 6e 74 4f 66 49 6e 74 |ement.po|intOfInt|
|00004490| 65 72 65 73 74 2c 0d 09 | 09 09 09 09 09 09 09 09 |erest,..|........|
|000044a0| 09 09 09 09 26 74 72 61 | 6e 73 2c 0d 09 09 09 09 |....&tra|ns,.....|
|000044b0| 09 09 09 09 09 09 09 09 | 09 26 70 6f 69 6e 74 43 |........|.&pointC|
|000044c0| 61 6d 44 61 74 61 2e 63 | 61 6d 65 72 61 44 61 74 |amData.c|ameraDat|
|000044d0| 61 2e 70 6c 61 63 65 6d | 65 6e 74 2e 70 6f 69 6e |a.placem|ent.poin|
|000044e0| 74 4f 66 49 6e 74 65 72 | 65 73 74 29 3b 0d 09 09 |tOfInter|est);...|
|000044f0| 09 09 09 09 09 09 09 51 | 33 50 6f 69 6e 74 33 44 |.......Q|3Point3D|
|00004500| 5f 56 65 63 74 6f 72 33 | 44 5f 41 64 64 28 09 26 |_Vector3|D_Add(.&|
|00004510| 70 6f 69 6e 74 43 61 6d | 44 61 74 61 2e 63 61 6d |pointCam|Data.cam|
|00004520| 65 72 61 44 61 74 61 2e | 70 6c 61 63 65 6d 65 6e |eraData.|placemen|
|00004530| 74 2e 63 61 6d 65 72 61 | 4c 6f 63 61 74 69 6f 6e |t.camera|Location|
|00004540| 2c 0d 09 09 09 09 09 09 | 09 09 09 09 09 09 09 26 |,.......|.......&|
|00004550| 74 72 61 6e 73 2c 0d 09 | 09 09 09 09 09 09 09 09 |trans,..|........|
|00004560| 09 09 09 09 26 70 6f 69 | 6e 74 43 61 6d 44 61 74 |....&poi|ntCamDat|
|00004570| 61 2e 63 61 6d 65 72 61 | 44 61 74 61 2e 70 6c 61 |a.camera|Data.pla|
|00004580| 63 65 6d 65 6e 74 2e 63 | 61 6d 65 72 61 4c 6f 63 |cement.c|ameraLoc|
|00004590| 61 74 69 6f 6e 29 3b 0d | 09 09 09 09 09 09 09 09 |ation);.|........|
|000045a0| 09 53 65 74 75 70 43 61 | 6d 65 72 61 73 28 76 69 |.SetupCa|meras(vi|
|000045b0| 65 77 65 72 29 3b 0d 09 | 09 09 09 09 09 09 09 09 |ewer);..|........|
|000045c0| 50 33 56 69 65 77 65 72 | 44 72 61 77 44 65 65 70 |P3Viewer|DrawDeep|
|000045d0| 28 76 69 65 77 65 72 2c | 20 66 61 6c 73 65 29 3b |(viewer,| false);|
|000045e0| 09 09 09 09 09 09 0d 09 | 09 09 09 09 09 09 09 7d |........|.......}|
|000045f0| 0d 09 09 09 09 09 09 09 | 7d 2f 2f 77 68 69 6c 65 |........|}//while|
|00004600| 0d 09 09 09 09 09 09 7d | 2f 2f 69 66 20 53 68 69 |.......}|//if Shi|
|00004610| 66 74 50 72 65 73 73 65 | 64 0d 09 09 09 09 09 09 |ftPresse|d.......|
|00004620| 65 6c 73 65 20 69 66 20 | 28 4f 70 74 69 6f 6e 50 |else if |(OptionP|
|00004630| 72 65 73 73 65 64 28 29 | 29 09 09 2f 2f 20 69 66 |ressed()|)..// if|
|00004640| 20 7a 6f 6f 6d 69 6e 67 | 0d 09 09 09 09 09 09 7b | zooming|.......{|
|00004650| 0d 09 09 09 09 09 09 09 | 77 68 69 6c 65 20 28 53 |........|while (S|
|00004660| 74 69 6c 6c 44 6f 77 6e | 28 29 29 0d 09 09 09 09 |tillDown|()).....|
|00004670| 09 09 09 7b 0d 09 09 09 | 09 09 09 09 09 50 6f 69 |...{....|.....Poi|
|00004680| 6e 74 09 6f 6c 64 57 68 | 65 72 65 20 3d 20 77 68 |nt.oldWh|ere = wh|
|00004690| 65 72 65 3b 0d 09 09 09 | 09 09 09 09 09 64 6f 20 |ere;....|.....do |
|000046a0| 47 65 74 4d 6f 75 73 65 | 28 26 77 68 65 72 65 29 |GetMouse|(&where)|
|000046b0| 3b 0d 09 09 09 09 09 09 | 09 09 77 68 69 6c 65 20 |;.......|..while |
|000046c0| 28 53 74 69 6c 6c 44 6f | 77 6e 28 29 20 26 26 20 |(StillDo|wn() && |
|000046d0| 6f 6c 64 57 68 65 72 65 | 2e 76 20 3d 3d 20 77 68 |oldWhere|.v == wh|
|000046e0| 65 72 65 2e 76 29 3b 0d | 09 09 09 09 09 09 09 09 |ere.v);.|........|
|000046f0| 69 66 20 28 53 74 69 6c | 6c 44 6f 77 6e 28 29 29 |if (Stil|lDown())|
|00004700| 0d 09 09 09 09 09 09 09 | 09 7b 09 66 6c 6f 61 74 |........|.{.float|
|00004710| 20 64 20 3d 20 70 6f 77 | 28 32 2c 20 28 6f 6c 64 | d = pow|(2, (old|
|00004720| 57 68 65 72 65 2e 76 2d | 77 68 65 72 65 2e 76 29 |Where.v-|where.v)|
|00004730| 2f 34 30 2e 30 29 3b 0d | 0d 09 09 09 09 09 09 09 |/40.0);.|........|
|00004740| 09 09 51 33 56 65 63 74 | 6f 72 33 44 5f 53 63 61 |..Q3Vect|or3D_Sca|
|00004750| 6c 65 28 26 63 61 6d 65 | 72 61 44 69 72 65 63 74 |le(&came|raDirect|
|00004760| 69 6f 6e 2c 20 64 2c 20 | 26 63 61 6d 65 72 61 44 |ion, d, |&cameraD|
|00004770| 69 72 65 63 74 69 6f 6e | 29 3b 0d 09 09 09 09 09 |irection|);......|
|00004780| 09 09 09 09 51 33 50 6f | 69 6e 74 33 44 5f 56 65 |....Q3Po|int3D_Ve|
|00004790| 63 74 6f 72 33 44 5f 53 | 75 62 74 72 61 63 74 28 |ctor3D_S|ubtract(|
|000047a0| 0d 09 09 09 09 09 09 09 | 09 09 09 26 70 6f 69 6e |........|...&poin|
|000047b0| 74 43 61 6d 44 61 74 61 | 2e 63 61 6d 65 72 61 44 |tCamData|.cameraD|
|000047c0| 61 74 61 2e 70 6c 61 63 | 65 6d 65 6e 74 2e 70 6f |ata.plac|ement.po|
|000047d0| 69 6e 74 4f 66 49 6e 74 | 65 72 65 73 74 2c 0d 09 |intOfInt|erest,..|
|000047e0| 09 09 09 09 09 09 09 09 | 09 26 63 61 6d 65 72 61 |........|.&camera|
|000047f0| 44 69 72 65 63 74 69 6f | 6e 2c 0d 09 09 09 09 09 |Directio|n,......|
|00004800| 09 09 09 09 09 26 70 6f | 69 6e 74 43 61 6d 44 61 |.....&po|intCamDa|
|00004810| 74 61 2e 63 61 6d 65 72 | 61 44 61 74 61 2e 70 6c |ta.camer|aData.pl|
|00004820| 61 63 65 6d 65 6e 74 2e | 63 61 6d 65 72 61 4c 6f |acement.|cameraLo|
|00004830| 63 61 74 69 6f 6e 29 3b | 0d 09 09 09 09 09 09 09 |cation);|........|
|00004840| 09 09 53 65 74 75 70 43 | 61 6d 65 72 61 73 28 76 |..SetupC|ameras(v|
|00004850| 69 65 77 65 72 29 3b 0d | 09 09 09 09 09 09 09 09 |iewer);.|........|
|00004860| 09 50 33 56 69 65 77 65 | 72 44 72 61 77 44 65 65 |.P3Viewe|rDrawDee|
|00004870| 70 28 76 69 65 77 65 72 | 2c 20 66 61 6c 73 65 29 |p(viewer|, false)|
|00004880| 3b 09 09 09 09 09 09 0d | 09 09 09 09 09 09 09 09 |;.......|........|
|00004890| 7d 09 09 09 09 09 09 09 | 09 0d 09 09 09 09 09 09 |}.......|........|
|000048a0| 09 09 0d 09 09 09 09 09 | 09 09 7d 2f 2f 77 68 69 |........|..}//whi|
|000048b0| 6c 65 0d 09 09 09 09 09 | 09 7d 0d 09 09 09 09 09 |le......|.}......|
|000048c0| 09 65 6c 73 65 0d 09 09 | 09 09 09 09 7b 0d 09 09 |.else...|....{...|
|000048d0| 09 09 09 09 09 54 51 33 | 56 65 63 74 6f 72 33 44 |.....TQ3|Vector3D|
|000048e0| 09 09 76 65 63 74 6f 72 | 31 2c 20 76 65 63 74 6f |..vector|1, vecto|
|000048f0| 72 32 3b 0d 09 09 09 09 | 09 09 09 6c 6f 6e 67 09 |r2;.....|...long.|
|00004900| 09 09 73 74 6f 70 70 65 | 64 54 69 6d 65 3b 0d 09 |..stoppe|dTime;..|
|00004910| 09 09 09 09 09 09 73 74 | 61 74 69 63 20 63 6f 6e |......st|atic con|
|00004920| 73 74 20 54 51 33 56 65 | 63 74 6f 72 33 44 20 6d |st TQ3Ve|ctor3D m|
|00004930| 69 6e 75 73 59 20 3d 20 | 7b 30 2c 20 2d 31 2c 20 |inusY = |{0, -1, |
|00004940| 30 7d 3b 0d 09 09 09 09 | 09 09 09 51 33 56 65 63 |0};.....|...Q3Vec|
|00004950| 74 6f 72 33 44 5f 4e 6f | 72 6d 61 6c 69 7a 65 28 |tor3D_No|rmalize(|
|00004960| 26 63 61 6d 65 72 61 44 | 69 72 65 63 74 69 6f 6e |&cameraD|irection|
|00004970| 2c 20 26 63 61 6d 65 72 | 61 44 69 72 65 63 74 69 |, &camer|aDirecti|
|00004980| 6f 6e 29 3b 0d 09 09 09 | 09 09 09 09 51 33 4d 61 |on);....|....Q3Ma|
|00004990| 74 72 69 78 34 78 34 5f | 53 65 74 52 6f 74 61 74 |trix4x4_|SetRotat|
|000049a0| 65 56 65 63 74 6f 72 54 | 6f 56 65 63 74 6f 72 28 |eVectorT|oVector(|
|000049b0| 26 6d 2c 20 26 6d 69 6e | 75 73 59 2c 20 26 63 61 |&m, &min|usY, &ca|
|000049c0| 6d 65 72 61 44 69 72 65 | 63 74 69 6f 6e 29 3b 0d |meraDire|ction);.|
|000049d0| 09 09 09 09 09 09 09 51 | 33 4d 61 74 72 69 78 34 |.......Q|3Matrix4|
|000049e0| 78 34 5f 53 65 74 49 64 | 65 6e 74 69 74 79 28 26 |x4_SetId|entity(&|
|000049f0| 73 70 69 6e 29 3b 0d 09 | 09 09 09 09 09 09 47 65 |spin);..|......Ge|
|00004a00| 74 43 6c 69 63 6b 65 64 | 56 65 63 74 6f 72 28 76 |tClicked|Vector(v|
|00004a10| 69 65 77 65 72 2c 20 77 | 68 65 72 65 2c 20 26 76 |iewer, w|here, &v|
|00004a20| 65 63 74 6f 72 31 2c 20 | 26 6d 29 3b 0d 09 09 09 |ector1, |&m);....|
|00004a30| 09 09 09 09 77 68 69 6c | 65 20 28 53 74 69 6c 6c |....whil|e (Still|
|00004a40| 44 6f 77 6e 28 29 29 0d | 09 09 09 09 09 09 09 7b |Down()).|.......{|
|00004a50| 0d 09 09 09 09 09 09 09 | 09 73 74 6f 70 70 65 64 |........|.stopped|
|00004a60| 54 69 6d 65 20 3d 20 54 | 69 63 6b 43 6f 75 6e 74 |Time = T|ickCount|
|00004a70| 28 29 3b 0d 09 09 09 09 | 09 09 09 09 64 6f 0d 09 |();.....|....do..|
|00004a80| 09 09 09 09 09 09 09 7b | 0d 09 09 09 09 09 09 09 |.......{|........|
|00004a90| 09 09 47 65 74 4d 6f 75 | 73 65 28 26 77 68 65 72 |..GetMou|se(&wher|
|00004aa0| 65 29 3b 0d 09 09 09 09 | 09 09 09 09 09 47 65 74 |e);.....|.....Get|
|00004ab0| 43 6c 69 63 6b 65 64 56 | 65 63 74 6f 72 28 76 69 |ClickedV|ector(vi|
|00004ac0| 65 77 65 72 2c 20 77 68 | 65 72 65 2c 20 26 76 65 |ewer, wh|ere, &ve|
|00004ad0| 63 74 6f 72 32 2c 20 26 | 6d 29 3b 0d 09 09 09 09 |ctor2, &|m);.....|
|00004ae0| 09 09 09 09 7d 77 68 69 | 6c 65 20 28 53 74 69 6c |....}whi|le (Stil|
|00004af0| 6c 44 6f 77 6e 28 29 20 | 26 26 20 76 65 63 74 6f |lDown() |&& vecto|
|00004b00| 72 32 2e 78 3d 3d 76 65 | 63 74 6f 72 31 2e 78 20 |r2.x==ve|ctor1.x |
|00004b10| 26 26 0d 09 09 09 09 09 | 09 09 09 09 09 76 65 63 |&&......|.....vec|
|00004b20| 74 6f 72 32 2e 79 20 3d | 3d 20 76 65 63 74 6f 72 |tor2.y =|= vector|
|00004b30| 31 2e 79 20 26 26 20 76 | 65 63 74 6f 72 32 2e 7a |1.y && v|ector2.z|
|00004b40| 20 3d 3d 20 76 65 63 74 | 6f 72 31 2e 7a 29 3b 0d | == vect|or1.z);.|
|00004b50| 09 09 09 09 09 09 09 09 | 69 66 20 28 53 74 69 6c |........|if (Stil|
|00004b60| 6c 44 6f 77 6e 28 29 29 | 0d 09 09 09 09 09 09 09 |lDown())|........|
|00004b70| 09 7b 09 0d 09 09 09 09 | 09 09 09 09 09 51 33 4d |.{......|.....Q3M|
|00004b80| 61 74 72 69 78 34 78 34 | 5f 53 65 74 52 6f 74 61 |atrix4x4|_SetRota|
|00004b90| 74 65 56 65 63 74 6f 72 | 54 6f 56 65 63 74 6f 72 |teVector|ToVector|
|00004ba0| 28 26 73 70 69 6e 2c 20 | 26 76 65 63 74 6f 72 31 |(&spin, |&vector1|
|00004bb0| 2c 20 26 76 65 63 74 6f | 72 32 29 3b 0d 09 09 09 |, &vecto|r2);....|
|00004bc0| 09 09 09 09 09 09 51 33 | 4d 61 74 72 69 78 34 78 |......Q3|Matrix4x|
|00004bd0| 34 5f 4d 75 6c 74 69 70 | 6c 79 28 26 72 6f 74 61 |4_Multip|ly(&rota|
|00004be0| 74 69 6f 6e 2c 20 26 73 | 70 69 6e 2c 20 26 72 6f |tion, &s|pin, &ro|
|00004bf0| 74 61 74 69 6f 6e 29 3b | 0d 09 09 09 09 09 09 09 |tation);|........|
|00004c00| 09 09 50 33 56 69 65 77 | 65 72 43 68 65 63 6b 52 |..P3View|erCheckR|
|00004c10| 6f 74 61 74 69 6f 6e 28 | 76 69 65 77 65 72 29 3b |otation(|viewer);|
|00004c20| 0d 09 09 09 09 09 09 09 | 09 09 50 33 56 69 65 77 |........|..P3View|
|00004c30| 65 72 44 72 61 77 44 65 | 65 70 28 76 69 65 77 65 |erDrawDe|ep(viewe|
|00004c40| 72 2c 20 66 61 6c 73 65 | 29 3b 0d 09 09 09 09 09 |r, false|);......|
|00004c50| 09 09 09 7d 0d 09 09 09 | 09 09 09 09 09 65 6c 73 |...}....|.....els|
|00004c60| 65 20 69 66 20 28 73 74 | 6f 70 70 65 64 54 69 6d |e if (st|oppedTim|
|00004c70| 65 20 2b 20 32 30 20 3c | 20 54 69 63 6b 43 6f 75 |e + 20 <| TickCou|
|00004c80| 6e 74 28 29 29 09 2f 2f | 20 69 66 20 6d 6f 75 73 |nt()).//| if mous|
|00004c90| 65 20 6e 6f 74 20 6d 6f | 76 65 64 20 66 6f 72 20 |e not mo|ved for |
|00004ca0| 31 2f 33 20 73 65 63 6f | 6e 64 0d 09 09 09 09 09 |1/3 seco|nd......|
|00004cb0| 09 09 09 09 51 33 4d 61 | 74 72 69 78 34 78 34 5f |....Q3Ma|trix4x4_|
|00004cc0| 53 65 74 49 64 65 6e 74 | 69 74 79 28 26 73 70 69 |SetIdent|ity(&spi|
|00004cd0| 6e 29 3b 09 09 09 2f 2f | 20 74 68 65 6e 20 73 74 |n);...//| then st|
|00004ce0| 6f 70 20 73 70 69 6e 6e | 69 6e 67 0d 09 09 09 09 |op spinn|ing.....|
|00004cf0| 09 09 09 09 76 65 63 74 | 6f 72 31 20 3d 20 76 65 |....vect|or1 = ve|
|00004d00| 63 74 6f 72 32 3b 0d 09 | 09 09 09 09 09 09 7d 0d |ctor2;..|......}.|
|00004d10| 09 09 09 09 09 09 09 4d | 61 6b 65 53 70 69 6e 56 |.......M|akeSpinV|
|00004d20| 65 72 74 69 63 61 6c 49 | 66 4e 65 63 65 73 73 61 |erticalI|fNecessa|
|00004d30| 72 79 28 76 69 65 77 65 | 72 29 3b 0d 09 09 09 09 |ry(viewe|r);.....|
|00004d40| 09 09 7d 0d 09 09 09 09 | 09 7d 2f 2f 69 66 20 50 |..}.....|.}//if P|
|00004d50| 74 49 6e 52 65 63 74 0d | 09 09 09 09 09 65 6c 73 |tInRect.|.....els|
|00004d60| 65 20 69 66 20 28 50 74 | 49 6e 52 65 63 74 28 77 |e if (Pt|InRect(w|
|00004d70| 68 65 72 65 2c 20 26 76 | 69 65 77 65 72 2d 3e 62 |here, &v|iewer->b|
|00004d80| 75 74 74 6f 6e 52 65 63 | 74 29 20 26 26 20 28 76 |uttonRec|t) && (v|
|00004d90| 69 65 77 65 72 2d 3e 66 | 6c 61 67 73 20 26 20 6b |iewer->f|lags & k|
|00004da0| 33 46 6c 61 67 57 69 74 | 68 50 6f 70 75 70 73 29 |3FlagWit|hPopups)|
|00004db0| 29 09 09 09 2f 2f 20 69 | 66 20 63 6c 69 63 6b 65 |)...// i|f clicke|
|00004dc0| 64 20 77 69 74 68 69 6e | 20 62 75 74 74 6f 6e 20 |d within| button |
|00004dd0| 72 65 63 74 0d 09 09 09 | 09 09 7b 0d 09 09 09 09 |rect....|..{.....|
|00004de0| 09 09 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 09 |..Contro|lHandle.|
|00004df0| 63 74 6c 3b 0d 0d 09 09 | 09 09 09 09 69 66 20 28 |ctl;....|....if (|
|00004e00| 46 69 6e 64 43 6f 6e 74 | 72 6f 6c 28 77 68 65 72 |FindCont|rol(wher|
|00004e10| 65 2c 20 76 69 65 77 65 | 72 2d 3e 77 69 6e 64 6f |e, viewe|r->windo|
|00004e20| 77 2c 20 26 63 74 6c 29 | 29 09 09 09 2f 2f 20 64 |w, &ctl)|)...// d|
|00004e30| 6f 20 63 68 65 63 6b 62 | 6f 78 20 61 63 74 69 6f |o checkb|ox actio|
|00004e40| 6e 0d 09 09 09 09 09 09 | 7b 0d 09 09 09 09 09 09 |n.......|{.......|
|00004e50| 09 69 66 20 28 54 72 61 | 63 6b 43 6f 6e 74 72 6f |.if (Tra|ckContro|
|00004e60| 6c 28 63 74 6c 2c 20 77 | 68 65 72 65 2c 20 6e 69 |l(ctl, w|here, ni|
|00004e70| 6c 29 29 0d 09 09 09 09 | 09 09 09 7b 09 0d 09 09 |l)).....|...{....|
|00004e80| 09 09 09 09 09 09 69 66 | 20 28 63 74 6c 20 3d 3d |......if| (ctl ==|
|00004e90| 20 76 69 65 77 65 72 2d | 3e 7a 56 65 72 74 69 63 | viewer-|>zVertic|
|00004ea0| 61 6c 43 74 6c 29 0d 09 | 09 09 09 09 09 09 09 09 |alCtl)..|........|
|00004eb0| 50 33 56 69 65 77 65 72 | 53 65 74 5a 28 76 69 65 |P3Viewer|SetZ(vie|
|00004ec0| 77 65 72 2c 21 47 65 74 | 43 6f 6e 74 72 6f 6c 56 |wer,!Get|ControlV|
|00004ed0| 61 6c 75 65 28 76 69 65 | 77 65 72 2d 3e 7a 56 65 |alue(vie|wer->zVe|
|00004ee0| 72 74 69 63 61 6c 43 74 | 6c 29 29 3b 0d 09 09 09 |rticalCt|l));....|
|00004ef0| 09 09 09 09 09 65 6c 73 | 65 0d 09 09 09 09 09 09 |.....els|e.......|
|00004f00| 09 09 09 50 33 56 69 65 | 77 65 72 53 65 74 53 70 |...P3Vie|werSetSp|
|00004f10| 69 6e 28 76 69 65 77 65 | 72 2c 21 47 65 74 43 6f |in(viewe|r,!GetCo|
|00004f20| 6e 74 72 6f 6c 56 61 6c | 75 65 28 76 69 65 77 65 |ntrolVal|ue(viewe|
|00004f30| 72 2d 3e 73 70 69 6e 43 | 74 6c 29 29 3b 0d 09 09 |r->spinC|tl));...|
|00004f40| 09 09 09 09 09 7d 2f 2f | 69 66 20 54 72 61 63 6b |.....}//|if Track|
|00004f50| 43 6f 6e 74 72 6f 6c 0d | 09 09 09 09 09 09 7d 0d |Control.|......}.|
|00004f60| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 72 65 74 76 |.....}..|....retv|
|00004f70| 61 6c 20 3d 20 74 72 75 | 65 3b 0d 09 09 09 09 7d |al = tru|e;.....}|
|00004f80| 0d 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 7d |.....bre|ak;....}|
|00004f90| 0d 09 09 63 61 73 65 20 | 6e 75 6c 6c 45 76 65 6e |...case |nullEven|
|00004fa0| 74 3a 0d 09 09 09 69 66 | 20 28 54 69 63 6b 43 6f |t:....if| (TickCo|
|00004fb0| 75 6e 74 28 29 20 3e 20 | 6e 65 78 74 52 6f 74 61 |unt() > |nextRota|
|00004fc0| 74 69 6f 6e 20 26 26 20 | 47 65 74 43 6f 6e 74 72 |tion && |GetContr|
|00004fd0| 6f 6c 56 61 6c 75 65 28 | 76 69 65 77 65 72 2d 3e |olValue(|viewer->|
|00004fe0| 73 70 69 6e 43 74 6c 29 | 29 09 2f 2f 20 69 66 20 |spinCtl)|).// if |
|00004ff0| 69 74 27 73 20 74 69 6d | 65 20 74 6f 20 72 6f 74 |it's tim|e to rot|
|00005000| 61 74 65 0d 09 09 09 7b | 0d 09 09 09 09 54 51 33 |ate....{|.....TQ3|
|00005010| 4d 61 74 72 69 78 34 78 | 34 09 69 64 65 6e 74 69 |Matrix4x|4.identi|
|00005020| 74 79 3b 0d 09 09 09 09 | 51 33 4d 61 74 72 69 78 |ty;.....|Q3Matrix|
|00005030| 34 78 34 5f 53 65 74 49 | 64 65 6e 74 69 74 79 28 |4x4_SetI|dentity(|
|00005040| 26 69 64 65 6e 74 69 74 | 79 29 3b 0d 09 09 09 09 |&identit|y);.....|
|00005050| 2f 2f 20 77 65 20 72 65 | 63 65 69 76 65 64 20 61 |// we re|ceived a|
|00005060| 20 6e 75 6c 6c 20 65 76 | 65 6e 74 2c 20 72 6f 74 | null ev|ent, rot|
|00005070| 61 74 65 20 74 68 65 20 | 6d 6f 64 65 6c 0d 09 09 |ate the |model...|
|00005080| 09 09 6e 65 78 74 52 6f | 74 61 74 69 6f 6e 20 3d |..nextRo|tation =|
|00005090| 20 54 69 63 6b 43 6f 75 | 6e 74 28 29 20 2b 20 32 | TickCou|nt() + 2|
|000050a0| 3b 0d 09 09 09 09 69 66 | 20 28 21 51 33 4d 61 74 |;.....if| (!Q3Mat|
|000050b0| 72 69 78 34 78 34 5f 43 | 6f 6d 70 61 72 65 28 26 |rix4x4_C|ompare(&|
|000050c0| 73 70 69 6e 2c 20 26 69 | 64 65 6e 74 69 74 79 29 |spin, &i|dentity)|
|000050d0| 29 09 2f 2f 20 64 6f 20 | 6e 6f 74 68 69 6e 67 20 |).// do |nothing |
|000050e0| 69 66 20 6e 6f 20 73 70 | 69 6e 0d 09 09 09 09 7b |if no sp|in.....{|
|000050f0| 09 0d 09 09 09 09 09 51 | 33 4d 61 74 72 69 78 34 |.......Q|3Matrix4|
|00005100| 78 34 5f 4d 75 6c 74 69 | 70 6c 79 28 26 72 6f 74 |x4_Multi|ply(&rot|
|00005110| 61 74 69 6f 6e 2c 20 26 | 73 70 69 6e 2c 20 26 72 |ation, &|spin, &r|
|00005120| 6f 74 61 74 69 6f 6e 29 | 3b 0d 09 09 09 09 09 50 |otation)|;......P|
|00005130| 33 56 69 65 77 65 72 43 | 68 65 63 6b 52 6f 74 61 |3ViewerC|heckRota|
|00005140| 74 69 6f 6e 28 76 69 65 | 77 65 72 29 3b 0d 09 09 |tion(vie|wer);...|
|00005150| 09 09 09 50 33 56 69 65 | 77 65 72 44 72 61 77 44 |...P3Vie|werDrawD|
|00005160| 65 65 70 28 76 69 65 77 | 65 72 2c 20 66 61 6c 73 |eep(view|er, fals|
|00005170| 65 29 3b 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |e);.....|.break;.|
|00005180| 09 09 09 09 7d 0d 09 09 | 09 7d 0d 09 7d 0d 0d 09 |....}...|.}..}...|
|00005190| 53 65 74 50 6f 72 74 28 | 6f 6c 64 50 6f 72 74 29 |SetPort(|oldPort)|
|000051a0| 3b 0d 09 72 65 74 75 72 | 6e 20 72 65 74 76 61 6c |;..retur|n retval|
|000051b0| 3b 0d 7d 0d 0d 42 6f 6f | 6c 65 61 6e 20 50 33 56 |;.}..Boo|lean P3V|
|000051c0| 69 65 77 65 72 41 64 6a | 75 73 74 43 75 72 73 6f |iewerAdj|ustCurso|
|000051d0| 72 28 50 33 56 69 65 77 | 65 72 44 61 74 61 2a 20 |r(P3View|erData* |
|000051e0| 63 6f 6e 73 74 20 76 69 | 65 77 65 72 2c 20 50 6f |const vi|ewer, Po|
|000051f0| 69 6e 74 2a 20 63 6f 6e | 73 74 20 70 74 29 0d 09 |int* con|st pt)..|
|00005200| 2f 2f 20 74 72 69 65 73 | 20 68 61 6e 64 6c 69 6e |// tries| handlin|
|00005210| 67 20 63 75 72 73 6f 72 | 2c 20 72 65 74 75 72 6e |g cursor|, return|
|00005220| 73 20 66 61 6c 73 65 20 | 69 66 20 63 61 6c 6c 65 |s false |if calle|
|00005230| 72 20 73 68 6f 75 6c 64 | 20 68 61 6e 64 6c 65 20 |r should| handle |
|00005240| 63 75 72 73 6f 72 0d 7b | 0d 09 42 6f 6f 6c 65 61 |cursor.{|..Boolea|
|00005250| 6e 09 09 72 65 74 76 61 | 6c 20 3d 20 66 61 6c 73 |n..retva|l = fals|
|00005260| 65 3b 0d 0d 09 69 66 20 | 28 50 74 49 6e 52 65 63 |e;...if |(PtInRec|
|00005270| 74 28 2a 70 74 2c 20 26 | 76 69 65 77 65 72 2d 3e |t(*pt, &|viewer->|
|00005280| 62 6f 75 6e 64 73 29 29 | 0d 09 7b 09 49 6e 69 74 |bounds))|..{.Init|
|00005290| 43 75 72 73 6f 72 28 29 | 3b 0d 09 09 72 65 74 76 |Cursor()|;...retv|
|000052a0| 61 6c 20 3d 20 74 72 75 | 65 3b 0d 09 7d 0d 09 72 |al = tru|e;..}..r|
|000052b0| 65 74 75 72 6e 20 72 65 | 74 76 61 6c 3b 0d 7d 0d |eturn re|tval;.}.|
|000052c0| 0d 0d 54 51 33 56 69 65 | 77 4f 62 6a 65 63 74 20 |..TQ3Vie|wObject |
|000052d0| 50 33 56 69 65 77 65 72 | 47 65 74 56 69 65 77 28 |P3Viewer|GetView(|
|000052e0| 50 33 56 69 65 77 65 72 | 44 61 74 61 2a 20 63 6f |P3Viewer|Data* co|
|000052f0| 6e 73 74 20 76 69 65 77 | 65 72 29 0d 09 2f 2f 20 |nst view|er)..// |
|00005300| 72 65 74 75 72 6e 73 20 | 74 68 65 20 76 69 65 77 |returns |the view|
|00005310| 20 61 73 73 6f 63 69 61 | 74 65 64 20 74 6f 20 74 | associa|ted to t|
|00005320| 68 65 20 67 69 76 65 6e | 20 76 69 65 77 65 72 20 |he given| viewer |
|00005330| 2d 20 64 6f 65 73 20 6e | 6f 74 20 69 6e 63 72 65 |- does n|ot incre|
|00005340| 61 73 65 0d 09 2f 2f 20 | 69 74 73 20 6f 77 6e 65 |ase..// |its owne|
|00005350| 72 20 63 6f 75 6e 74 0d | 7b 0d 09 72 65 74 75 72 |r count.|{..retur|
|00005360| 6e 20 76 69 65 77 65 72 | 2d 3e 76 69 65 77 3b 0d |n viewer|->view;.|
|00005370| 7d 0d 0d 0d 0d 23 70 72 | 61 67 6d 61 20 6d 61 72 |}....#pr|agma mar|
|00005380| 6b 20 2d 0d 0d 73 74 61 | 74 69 63 20 54 51 33 53 |k -..sta|tic TQ3S|
|00005390| 74 61 74 75 73 20 50 33 | 57 72 69 74 65 54 6f 53 |tatus P3|WriteToS|
|000053a0| 74 6f 72 61 67 65 28 50 | 33 56 69 65 77 65 72 44 |torage(P|3ViewerD|
|000053b0| 61 74 61 2a 20 63 6f 6e | 73 74 20 76 69 65 77 65 |ata* con|st viewe|
|000053c0| 72 2c 20 54 51 33 53 74 | 6f 72 61 67 65 4f 62 6a |r, TQ3St|orageObj|
|000053d0| 65 63 74 20 73 74 6f 72 | 61 67 65 29 0d 09 2f 2f |ect stor|age)..//|
|000053e0| 20 77 72 69 74 65 73 20 | 6f 75 72 20 6d 6f 64 65 | writes |our mode|
|000053f0| 6c 20 69 6e 74 6f 20 74 | 68 65 20 67 69 76 65 6e |l into t|he given|
|00005400| 20 66 69 6c 65 20 6f 62 | 6a 65 63 74 0d 7b 0d 09 | file ob|ject.{..|
|00005410| 54 51 33 46 69 6c 65 4f | 62 6a 65 63 74 09 09 66 |TQ3FileO|bject..f|
|00005420| 69 6c 65 3d 6e 69 6c 3b | 0d 09 54 51 33 53 68 61 |ile=nil;|..TQ3Sha|
|00005430| 72 65 64 4f 62 6a 65 63 | 74 09 09 76 69 65 77 48 |redObjec|t..viewH|
|00005440| 69 6e 74 73 3d 6e 69 6c | 3b 0d 09 54 51 33 53 74 |ints=nil|;..TQ3St|
|00005450| 61 74 75 73 09 09 09 72 | 65 74 76 61 6c 20 3d 20 |atus...r|etval = |
|00005460| 6b 51 33 46 61 69 6c 75 | 72 65 3b 0d 09 54 51 33 |kQ3Failu|re;..TQ3|
|00005470| 47 72 6f 75 70 50 6f 73 | 69 74 69 6f 6e 09 67 50 |GroupPos|ition.gP|
|00005480| 6f 73 3b 0d 09 0d 09 66 | 69 6c 65 20 3d 20 51 33 |os;....f|ile = Q3|
|00005490| 46 69 6c 65 5f 4e 65 77 | 28 29 3b 0d 09 69 66 20 |File_New|();..if |
|000054a0| 28 66 69 6c 65 20 3d 3d | 20 6e 69 6c 29 20 67 6f |(file ==| nil) go|
|000054b0| 74 6f 20 64 6f 6e 65 3b | 0d 09 69 66 20 28 51 33 |to done;|..if (Q3|
|000054c0| 46 69 6c 65 5f 53 65 74 | 53 74 6f 72 61 67 65 28 |File_Set|Storage(|
|000054d0| 66 69 6c 65 2c 20 73 74 | 6f 72 61 67 65 29 20 3d |file, st|orage) =|
|000054e0| 3d 20 6b 51 33 46 61 69 | 6c 75 72 65 29 20 67 6f |= kQ3Fai|lure) go|
|000054f0| 74 6f 20 64 6f 6e 65 3b | 0d 0d 09 69 66 20 28 51 |to done;|...if (Q|
|00005500| 33 46 69 6c 65 5f 4f 70 | 65 6e 57 72 69 74 65 28 |3File_Op|enWrite(|
|00005510| 66 69 6c 65 2c 20 6b 51 | 33 46 69 6c 65 4d 6f 64 |file, kQ|3FileMod|
|00005520| 65 4e 6f 72 6d 61 6c 29 | 20 3d 3d 20 6b 51 33 46 |eNormal)| == kQ3F|
|00005530| 61 69 6c 75 72 65 29 20 | 67 6f 74 6f 20 64 6f 6e |ailure) |goto don|
|00005540| 65 3b 0d 0d 09 51 33 56 | 69 65 77 5f 53 74 61 72 |e;...Q3V|iew_Star|
|00005550| 74 57 72 69 74 69 6e 67 | 28 76 69 65 77 65 72 2d |tWriting|(viewer-|
|00005560| 3e 76 69 65 77 2c 20 66 | 69 6c 65 29 3b 0d 0d 09 |>view, f|ile);...|
|00005570| 76 69 65 77 48 69 6e 74 | 73 20 3d 20 51 33 56 69 |viewHint|s = Q3Vi|
|00005580| 65 77 48 69 6e 74 73 5f | 4e 65 77 28 76 69 65 77 |ewHints_|New(view|
|00005590| 65 72 2d 3e 76 69 65 77 | 29 3b 0d 09 69 66 20 28 |er->view|);..if (|
|000055a0| 76 69 65 77 48 69 6e 74 | 73 20 21 3d 20 4e 55 4c |viewHint|s != NUL|
|000055b0| 4c 29 0d 09 7b 09 69 66 | 20 28 51 33 4f 62 6a 65 |L)..{.if| (Q3Obje|
|000055c0| 63 74 5f 53 75 62 6d 69 | 74 28 76 69 65 77 48 69 |ct_Submi|t(viewHi|
|000055d0| 6e 74 73 2c 20 76 69 65 | 77 65 72 2d 3e 76 69 65 |nts, vie|wer->vie|
|000055e0| 77 29 20 3d 3d 20 6b 51 | 33 46 61 69 6c 75 72 65 |w) == kQ|3Failure|
|000055f0| 29 09 2f 2f 20 61 64 64 | 20 69 6e 66 6f 20 6f 6e |).// add| info on|
|00005600| 20 6f 75 72 20 76 69 65 | 77 0d 09 09 7b 09 51 33 | our vie|w...{.Q3|
|00005610| 46 69 6c 65 5f 43 61 6e | 63 65 6c 28 66 69 6c 65 |File_Can|cel(file|
|00005620| 29 3b 0d 09 09 09 67 6f | 74 6f 20 64 6f 6e 65 3b |);....go|to done;|
|00005630| 0d 09 09 7d 0d 09 7d 0d | 09 09 09 0d 09 64 6f 20 |...}..}.|.....do |
|00005640| 7b 0d 09 09 69 66 20 28 | 76 69 65 77 65 72 2d 3e |{...if (|viewer->|
|00005650| 67 72 6f 75 70 20 21 3d | 20 4e 55 4c 4c 29 0d 09 |group !=| NULL)..|
|00005660| 09 7b 0d 09 09 09 69 66 | 20 28 51 33 4d 61 74 72 |.{....if| (Q3Matr|
|00005670| 69 78 54 72 61 6e 73 66 | 6f 72 6d 5f 53 75 62 6d |ixTransf|orm_Subm|
|00005680| 69 74 28 26 72 6f 74 61 | 74 69 6f 6e 2c 20 76 69 |it(&rota|tion, vi|
|00005690| 65 77 65 72 2d 3e 76 69 | 65 77 29 20 3d 3d 20 6b |ewer->vi|ew) == k|
|000056a0| 51 33 46 61 69 6c 75 72 | 65 29 0d 09 09 09 09 62 |Q3Failur|e).....b|
|000056b0| 72 65 61 6b 3b 0d 0d 09 | 09 09 51 33 47 72 6f 75 |reak;...|..Q3Grou|
|000056c0| 70 5f 47 65 74 46 69 72 | 73 74 50 6f 73 69 74 69 |p_GetFir|stPositi|
|000056d0| 6f 6e 28 76 69 65 77 65 | 72 2d 3e 67 72 6f 75 70 |on(viewe|r->group|
|000056e0| 2c 20 26 67 50 6f 73 29 | 3b 0d 09 09 09 77 68 69 |, &gPos)|;....whi|
|000056f0| 6c 65 20 28 67 50 6f 73 | 29 0d 09 09 09 7b 0d 09 |le (gPos|)....{..|
|00005700| 09 09 09 54 51 33 53 74 | 61 74 75 73 20 73 74 61 |...TQ3St|atus sta|
|00005710| 74 75 73 3b 0d 09 09 09 | 09 54 51 33 4f 62 6a 65 |tus;....|.TQ3Obje|
|00005720| 63 74 09 09 09 6f 62 6a | 65 63 74 3b 0d 0d 09 09 |ct...obj|ect;....|
|00005730| 09 09 51 33 47 72 6f 75 | 70 5f 47 65 74 50 6f 73 |..Q3Grou|p_GetPos|
|00005740| 69 74 69 6f 6e 4f 62 6a | 65 63 74 28 76 69 65 77 |itionObj|ect(view|
|00005750| 65 72 2d 3e 67 72 6f 75 | 70 2c 20 67 50 6f 73 2c |er->grou|p, gPos,|
|00005760| 20 26 6f 62 6a 65 63 74 | 29 3b 0d 09 09 09 09 73 | &object|);.....s|
|00005770| 74 61 74 75 73 20 3d 20 | 51 33 4f 62 6a 65 63 74 |tatus = |Q3Object|
|00005780| 5f 53 75 62 6d 69 74 28 | 6f 62 6a 65 63 74 2c 20 |_Submit(|object, |
|00005790| 76 69 65 77 65 72 2d 3e | 76 69 65 77 29 3b 0d 09 |viewer->|view);..|
|000057a0| 09 09 09 51 33 4f 62 6a | 65 63 74 5f 44 69 73 70 |...Q3Obj|ect_Disp|
|000057b0| 6f 73 65 28 6f 62 6a 65 | 63 74 29 3b 0d 09 09 09 |ose(obje|ct);....|
|000057c0| 09 0d 09 09 09 09 69 66 | 20 28 73 74 61 74 75 73 |......if| (status|
|000057d0| 20 21 3d 20 6b 51 33 46 | 61 69 6c 75 72 65 29 0d | != kQ3F|ailure).|
|000057e0| 09 09 09 09 09 51 33 47 | 72 6f 75 70 5f 47 65 74 |.....Q3G|roup_Get|
|000057f0| 4e 65 78 74 50 6f 73 69 | 74 69 6f 6e 28 76 69 65 |NextPosi|tion(vie|
|00005800| 77 65 72 2d 3e 67 72 6f | 75 70 2c 20 26 67 50 6f |wer->gro|up, &gPo|
|00005810| 73 29 3b 0d 09 09 09 09 | 65 6c 73 65 20 67 50 6f |s);.....|else gPo|
|00005820| 73 20 3d 20 30 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d |s = 0;..|..}...}.|
|00005830| 09 7d 20 77 68 69 6c 65 | 20 28 51 33 56 69 65 77 |.} while| (Q3View|
|00005840| 5f 45 6e 64 57 72 69 74 | 69 6e 67 28 76 69 65 77 |_EndWrit|ing(view|
|00005850| 65 72 2d 3e 76 69 65 77 | 29 20 3d 3d 20 6b 51 33 |er->view|) == kQ3|
|00005860| 56 69 65 77 53 74 61 74 | 75 73 52 65 74 72 61 76 |ViewStat|usRetrav|
|00005870| 65 72 73 65 29 3b 0d 0d | 09 69 66 28 51 33 46 69 |erse);..|.if(Q3Fi|
|00005880| 6c 65 5f 43 6c 6f 73 65 | 28 66 69 6c 65 29 20 3d |le_Close|(file) =|
|00005890| 3d 20 6b 51 33 46 61 69 | 6c 75 72 65 29 0d 09 09 |= kQ3Fai|lure)...|
|000058a0| 72 65 74 75 72 6e 20 6b | 51 33 46 61 69 6c 75 72 |return k|Q3Failur|
|000058b0| 65 3b 0d 0d 09 72 65 74 | 76 61 6c 20 3d 20 6b 51 |e;...ret|val = kQ|
|000058c0| 33 53 75 63 63 65 73 73 | 3b 0d 64 6f 6e 65 3a 0d |3Success|;.done:.|
|000058d0| 09 51 33 4f 62 6a 65 63 | 74 5f 44 69 73 70 6f 73 |.Q3Objec|t_Dispos|
|000058e0| 65 49 66 4e 6f 74 4e 69 | 6c 28 76 69 65 77 48 69 |eIfNotNi|l(viewHi|
|000058f0| 6e 74 73 29 3b 0d 09 51 | 33 4f 62 6a 65 63 74 5f |nts);..Q|3Object_|
|00005900| 44 69 73 70 6f 73 65 49 | 66 4e 6f 74 4e 69 6c 28 |DisposeI|fNotNil(|
|00005910| 66 69 6c 65 29 3b 0d 09 | 72 65 74 75 72 6e 20 72 |file);..|return r|
|00005920| 65 74 76 61 6c 3b 0d 7d | 0d 0d 0d 4f 53 45 72 72 |etval;.}|...OSErr|
|00005930| 20 50 33 56 69 65 77 65 | 72 57 72 69 74 65 46 69 | P3Viewe|rWriteFi|
|00005940| 6c 65 28 50 33 56 69 65 | 77 65 72 44 61 74 61 2a |le(P3Vie|werData*|
|00005950| 20 63 6f 6e 73 74 20 76 | 69 65 77 65 72 2c 20 6c | const v|iewer, l|
|00005960| 6f 6e 67 20 72 65 66 4e | 75 6d 29 0d 09 2f 2f 20 |ong refN|um)..// |
|00005970| 77 72 69 74 65 73 20 74 | 68 65 20 76 69 65 77 65 |writes t|he viewe|
|00005980| 72 20 64 61 74 61 20 74 | 6f 20 61 20 66 69 6c 65 |r data t|o a file|
|00005990| 0d 7b 0d 09 54 51 33 53 | 74 6f 72 61 67 65 4f 62 |.{..TQ3S|torageOb|
|000059a0| 6a 65 63 74 09 73 74 6f | 72 61 67 65 3d 6e 69 6c |ject.sto|rage=nil|
|000059b0| 3b 0d 09 4f 53 45 72 72 | 09 09 09 09 72 65 74 76 |;..OSErr|....retv|
|000059c0| 61 6c 20 3d 20 2d 31 32 | 38 3b 0d 09 09 0d 09 73 |al = -12|8;.....s|
|000059d0| 74 6f 72 61 67 65 20 3d | 20 51 33 4d 61 63 69 6e |torage =| Q3Macin|
|000059e0| 74 6f 73 68 53 74 6f 72 | 61 67 65 5f 4e 65 77 28 |toshStor|age_New(|
|000059f0| 72 65 66 4e 75 6d 29 3b | 09 09 0d 09 69 66 20 28 |refNum);|....if (|
|00005a00| 73 74 6f 72 61 67 65 20 | 3d 3d 20 4e 55 4c 4c 29 |storage |== NULL)|
|00005a10| 20 67 6f 74 6f 20 64 6f | 6e 65 3b 09 09 0d 09 69 | goto do|ne;....i|
|00005a20| 66 20 28 50 33 57 72 69 | 74 65 54 6f 53 74 6f 72 |f (P3Wri|teToStor|
|00005a30| 61 67 65 28 76 69 65 77 | 65 72 2c 20 73 74 6f 72 |age(view|er, stor|
|00005a40| 61 67 65 29 20 3d 3d 20 | 6b 51 33 46 61 69 6c 75 |age) == |kQ3Failu|
|00005a50| 72 65 29 20 67 6f 74 6f | 20 64 6f 6e 65 3b 0d 09 |re) goto| done;..|
|00005a60| 72 65 74 76 61 6c 20 3d | 20 6e 6f 45 72 72 3b 0d |retval =| noErr;.|
|00005a70| 64 6f 6e 65 3a 0d 09 51 | 33 4f 62 6a 65 63 74 5f |done:..Q|3Object_|
|00005a80| 44 69 73 70 6f 73 65 49 | 66 4e 6f 74 4e 69 6c 28 |DisposeI|fNotNil(|
|00005a90| 73 74 6f 72 61 67 65 29 | 3b 0d 09 72 65 74 75 72 |storage)|;..retur|
|00005aa0| 6e 20 72 65 74 76 61 6c | 3b 0d 7d 0d 0d 4f 53 45 |n retval|;.}..OSE|
|00005ab0| 72 72 20 50 33 56 69 65 | 77 65 72 43 6f 70 79 28 |rr P3Vie|werCopy(|
|00005ac0| 50 33 56 69 65 77 65 72 | 44 61 74 61 2a 20 63 6f |P3Viewer|Data* co|
|00005ad0| 6e 73 74 20 76 69 65 77 | 65 72 29 0d 09 2f 2f 20 |nst view|er)..// |
|00005ae0| 63 6f 70 69 65 73 20 76 | 69 65 77 65 72 20 64 61 |copies v|iewer da|
|00005af0| 74 61 20 74 6f 20 63 6c | 69 70 62 6f 61 72 64 0d |ta to cl|ipboard.|
|00005b00| 7b 0d 09 54 51 33 53 74 | 6f 72 61 67 65 4f 62 6a |{..TQ3St|orageObj|
|00005b10| 65 63 74 09 73 74 6f 72 | 61 67 65 3d 6e 69 6c 3b |ect.stor|age=nil;|
|00005b20| 0d 09 4f 53 45 72 72 09 | 09 09 09 72 65 74 76 61 |..OSErr.|...retva|
|00005b30| 6c 20 3d 20 2d 31 32 38 | 3b 0d 09 48 61 6e 64 6c |l = -128|;..Handl|
|00005b40| 65 09 09 09 09 68 3b 0d | 09 75 6e 73 69 67 6e 65 |e....h;.|.unsigne|
|00005b50| 64 20 6c 6f 6e 67 09 09 | 76 61 6c 69 64 53 69 7a |d long..|validSiz|
|00005b60| 65 3b 0d 09 6c 6f 6e 67 | 09 09 09 09 65 72 72 3b |e;..long|....err;|
|00005b70| 0d 09 09 0d 09 73 74 6f | 72 61 67 65 20 3d 20 51 |.....sto|rage = Q|
|00005b80| 33 48 61 6e 64 6c 65 53 | 74 6f 72 61 67 65 5f 4e |3HandleS|torage_N|
|00005b90| 65 77 28 6e 69 6c 2c 30 | 29 3b 09 0d 09 69 66 20 |ew(nil,0|);...if |
|00005ba0| 28 73 74 6f 72 61 67 65 | 20 3d 3d 20 4e 55 4c 4c |(storage| == NULL|
|00005bb0| 29 20 67 6f 74 6f 20 64 | 6f 6e 65 3b 09 09 0d 09 |) goto d|one;....|
|00005bc0| 69 66 20 28 50 33 57 72 | 69 74 65 54 6f 53 74 6f |if (P3Wr|iteToSto|
|00005bd0| 72 61 67 65 28 76 69 65 | 77 65 72 2c 20 73 74 6f |rage(vie|wer, sto|
|00005be0| 72 61 67 65 29 20 3d 3d | 20 6b 51 33 46 61 69 6c |rage) ==| kQ3Fail|
|00005bf0| 75 72 65 29 20 67 6f 74 | 6f 20 64 6f 6e 65 3b 0d |ure) got|o done;.|
|00005c00| 09 69 66 20 28 51 33 48 | 61 6e 64 6c 65 53 74 6f |.if (Q3H|andleSto|
|00005c10| 72 61 67 65 5f 47 65 74 | 28 73 74 6f 72 61 67 65 |rage_Get|(storage|
|00005c20| 2c 20 26 68 2c 20 26 76 | 61 6c 69 64 53 69 7a 65 |, &h, &v|alidSize|
|00005c30| 29 20 3d 3d 20 6b 51 33 | 46 61 69 6c 75 72 65 29 |) == kQ3|Failure)|
|00005c40| 0d 09 09 67 6f 74 6f 20 | 64 6f 6e 65 3b 0d 09 65 |...goto |done;..e|
|00005c50| 72 72 20 3d 20 5a 65 72 | 6f 53 63 72 61 70 28 29 |rr = Zer|oScrap()|
|00005c60| 3b 0d 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |;..if (e|rr != no|
|00005c70| 45 72 72 29 20 7b 20 72 | 65 74 76 61 6c 20 3d 20 |Err) { r|etval = |
|00005c80| 65 72 72 3b 20 67 6f 74 | 6f 20 64 6f 6e 65 3b 20 |err; got|o done; |
|00005c90| 7d 0d 09 69 66 20 28 68 | 29 0d 09 7b 0d 09 09 48 |}..if (h|)..{...H|
|00005ca0| 4c 6f 63 6b 28 68 29 3b | 0d 09 09 65 72 72 20 3d |Lock(h);|...err =|
|00005cb0| 20 50 75 74 53 63 72 61 | 70 28 76 61 6c 69 64 53 | PutScra|p(validS|
|00005cc0| 69 7a 65 2c 20 27 33 44 | 4d 46 27 2c 20 2a 68 29 |ize, '3D|MF', *h)|
|00005cd0| 3b 0d 09 09 48 55 6e 6c | 6f 63 6b 28 68 29 3b 0d |;...HUnl|ock(h);.|
|00005ce0| 09 09 69 66 20 28 65 72 | 72 20 21 3d 20 30 29 20 |..if (er|r != 0) |
|00005cf0| 7b 20 72 65 74 76 61 6c | 20 3d 20 65 72 72 3b 20 |{ retval| = err; |
|00005d00| 67 6f 74 6f 20 64 6f 6e | 65 3b 20 7d 0d 09 7d 0d |goto don|e; }..}.|
|00005d10| 09 72 65 74 76 61 6c 20 | 3d 20 6e 6f 45 72 72 3b |.retval |= noErr;|
|00005d20| 0d 64 6f 6e 65 3a 0d 09 | 51 33 4f 62 6a 65 63 74 |.done:..|Q3Object|
|00005d30| 5f 44 69 73 70 6f 73 65 | 49 66 4e 6f 74 4e 69 6c |_Dispose|IfNotNil|
|00005d40| 28 73 74 6f 72 61 67 65 | 29 3b 0d 09 72 65 74 75 |(storage|);..retu|
|00005d50| 72 6e 20 72 65 74 76 61 | 6c 3b 0d 7d 0d 0d 23 70 |rn retva|l;.}..#p|
|00005d60| 72 61 67 6d 61 20 6d 61 | 72 6b 20 2d 0d 0d 0d 73 |ragma ma|rk -...s|
|00005d70| 74 61 74 69 63 20 54 51 | 33 44 72 61 77 43 6f 6e |tatic TQ|3DrawCon|
|00005d80| 74 65 78 74 4f 62 6a 65 | 63 74 20 4d 79 4e 65 77 |textObje|ct MyNew|
|00005d90| 44 72 61 77 43 6f 6e 74 | 65 78 74 28 47 57 6f 72 |DrawCont|ext(GWor|
|00005da0| 6c 64 50 74 72 20 74 68 | 65 47 57 6f 72 6c 64 29 |ldPtr th|eGWorld)|
|00005db0| 0d 7b 0d 09 54 51 33 50 | 69 78 6d 61 70 44 72 61 |.{..TQ3P|ixmapDra|
|00005dc0| 77 43 6f 6e 74 65 78 74 | 44 61 74 61 09 6d 79 44 |wContext|Data.myD|
|00005dd0| 72 61 77 43 6f 6e 74 65 | 78 74 44 61 74 61 3b 0d |rawConte|xtData;.|
|00005de0| 09 73 74 61 74 69 63 20 | 63 6f 6e 73 74 20 54 51 |.static |const TQ|
|00005df0| 33 43 6f 6c 6f 72 41 52 | 47 42 09 63 6c 65 61 72 |3ColorAR|GB.clear|
|00005e00| 43 6f 6c 6f 72 20 3d 20 | 7b 31 2c 31 2c 31 2c 31 |Color = |{1,1,1,1|
|00005e10| 7d 3b 0d 09 50 69 78 4d | 61 70 48 61 6e 64 6c 65 |};..PixM|apHandle|
|00005e20| 20 09 09 09 09 68 50 69 | 78 4d 61 70 20 3b 0d 09 | ....hPi|xMap ;..|
|00005e30| 52 65 63 74 09 09 09 09 | 09 09 73 72 63 52 65 63 |Rect....|..srcRec|
|00005e40| 74 20 3b 0d 09 0d 09 2f | 2f 09 46 69 6c 6c 20 69 |t ;..../|/.Fill i|
|00005e50| 6e 20 64 72 61 77 20 63 | 6f 6e 74 65 78 74 20 64 |n draw c|ontext d|
|00005e60| 61 74 61 2e 0d 09 09 09 | 0d 09 6d 79 44 72 61 77 |ata.....|..myDraw|
|00005e70| 43 6f 6e 74 65 78 74 44 | 61 74 61 2e 64 72 61 77 |ContextD|ata.draw|
|00005e80| 43 6f 6e 74 65 78 74 44 | 61 74 61 2e 63 6c 65 61 |ContextD|ata.clea|
|00005e90| 72 49 6d 61 67 65 4d 65 | 74 68 6f 64 20 3d 20 6b |rImageMe|thod = k|
|00005ea0| 51 33 43 6c 65 61 72 4d | 65 74 68 6f 64 57 69 74 |Q3ClearM|ethodWit|
|00005eb0| 68 43 6f 6c 6f 72 3b 0d | 09 6d 79 44 72 61 77 43 |hColor;.|.myDrawC|
|00005ec0| 6f 6e 74 65 78 74 44 61 | 74 61 2e 64 72 61 77 43 |ontextDa|ta.drawC|
|00005ed0| 6f 6e 74 65 78 74 44 61 | 74 61 2e 63 6c 65 61 72 |ontextDa|ta.clear|
|00005ee0| 49 6d 61 67 65 43 6f 6c | 6f 72 20 20 3d 20 63 6c |ImageCol|or = cl|
|00005ef0| 65 61 72 43 6f 6c 6f 72 | 3b 0d 0d 09 6d 79 44 72 |earColor|;...myDr|
|00005f00| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 2e 64 72 |awContex|tData.dr|
|00005f10| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 2e 70 61 |awContex|tData.pa|
|00005f20| 6e 65 53 74 61 74 65 20 | 3d 20 6b 51 33 46 61 6c |neState |= kQ3Fal|
|00005f30| 73 65 3b 0d 09 6d 79 44 | 72 61 77 43 6f 6e 74 65 |se;..myD|rawConte|
|00005f40| 78 74 44 61 74 61 2e 64 | 72 61 77 43 6f 6e 74 65 |xtData.d|rawConte|
|00005f50| 78 74 44 61 74 61 2e 6d | 61 73 6b 53 74 61 74 65 |xtData.m|askState|
|00005f60| 20 3d 20 6b 51 33 46 61 | 6c 73 65 3b 0d 09 0d 09 | = kQ3Fa|lse;....|
|00005f70| 6d 79 44 72 61 77 43 6f | 6e 74 65 78 74 44 61 74 |myDrawCo|ntextDat|
|00005f80| 61 2e 64 72 61 77 43 6f | 6e 74 65 78 74 44 61 74 |a.drawCo|ntextDat|
|00005f90| 61 2e 64 6f 75 62 6c 65 | 42 75 66 66 65 72 53 74 |a.double|BufferSt|
|00005fa0| 61 74 65 20 3d 20 6b 51 | 33 46 61 6c 73 65 3b 0d |ate = kQ|3False;.|
|00005fb0| 0d 09 68 50 69 78 4d 61 | 70 20 3d 20 47 65 74 47 |..hPixMa|p = GetG|
|00005fc0| 57 6f 72 6c 64 50 69 78 | 4d 61 70 28 74 68 65 47 |WorldPix|Map(theG|
|00005fd0| 57 6f 72 6c 64 29 3b 0d | 09 73 72 63 52 65 63 74 |World);.|.srcRect|
|00005fe0| 20 3d 20 74 68 65 47 57 | 6f 72 6c 64 2d 3e 70 6f | = theGW|orld->po|
|00005ff0| 72 74 52 65 63 74 3b 0d | 0d 09 6d 79 44 72 61 77 |rtRect;.|..myDraw|
|00006000| 43 6f 6e 74 65 78 74 44 | 61 74 61 2e 70 69 78 6d |ContextD|ata.pixm|
|00006010| 61 70 2e 77 69 64 74 68 | 20 3d 20 73 72 63 52 65 |ap.width| = srcRe|
|00006020| 63 74 2e 72 69 67 68 74 | 20 20 2d 20 73 72 63 52 |ct.right| - srcR|
|00006030| 65 63 74 2e 6c 65 66 74 | 3b 0d 09 6d 79 44 72 61 |ect.left|;..myDra|
|00006040| 77 43 6f 6e 74 65 78 74 | 44 61 74 61 2e 70 69 78 |wContext|Data.pix|
|00006050| 6d 61 70 2e 68 65 69 67 | 68 74 3d 20 73 72 63 52 |map.heig|ht= srcR|
|00006060| 65 63 74 2e 62 6f 74 74 | 6f 6d 20 2d 20 73 72 63 |ect.bott|om - src|
|00006070| 52 65 63 74 2e 74 6f 70 | 3b 0d 09 0d 09 6d 79 44 |Rect.top|;....myD|
|00006080| 72 61 77 43 6f 6e 74 65 | 78 74 44 61 74 61 2e 70 |rawConte|xtData.p|
|00006090| 69 78 6d 61 70 2e 72 6f | 77 42 79 74 65 73 20 3d |ixmap.ro|wBytes =|
|000060a0| 20 28 2a 2a 68 50 69 78 | 4d 61 70 29 2e 72 6f 77 | (**hPix|Map).row|
|000060b0| 42 79 74 65 73 20 26 20 | 30 78 37 46 46 46 3b 0d |Bytes & |0x7FFF;.|
|000060c0| 09 6d 79 44 72 61 77 43 | 6f 6e 74 65 78 74 44 61 |.myDrawC|ontextDa|
|000060d0| 74 61 2e 70 69 78 6d 61 | 70 2e 70 69 78 65 6c 54 |ta.pixma|p.pixelT|
|000060e0| 79 70 65 20 3d 20 6b 51 | 33 50 69 78 65 6c 54 79 |ype = kQ|3PixelTy|
|000060f0| 70 65 52 47 42 33 32 3b | 0d 09 6d 79 44 72 61 77 |peRGB32;|..myDraw|
|00006100| 43 6f 6e 74 65 78 74 44 | 61 74 61 2e 70 69 78 6d |ContextD|ata.pixm|
|00006110| 61 70 2e 70 69 78 65 6c | 53 69 7a 65 20 3d 20 33 |ap.pixel|Size = 3|
|00006120| 32 3b 0d 0d 09 6d 79 44 | 72 61 77 43 6f 6e 74 65 |2;...myD|rawConte|
|00006130| 78 74 44 61 74 61 2e 70 | 69 78 6d 61 70 2e 62 69 |xtData.p|ixmap.bi|
|00006140| 74 4f 72 64 65 72 20 20 | 3d 20 6b 51 33 45 6e 64 |tOrder |= kQ3End|
|00006150| 69 61 6e 42 69 67 3b 0d | 09 6d 79 44 72 61 77 43 |ianBig;.|.myDrawC|
|00006160| 6f 6e 74 65 78 74 44 61 | 74 61 2e 70 69 78 6d 61 |ontextDa|ta.pixma|
|00006170| 70 2e 62 79 74 65 4f 72 | 64 65 72 20 3d 20 6b 51 |p.byteOr|der = kQ|
|00006180| 33 45 6e 64 69 61 6e 42 | 69 67 3b 0d 09 0d 09 6d |3EndianB|ig;....m|
|00006190| 79 44 72 61 77 43 6f 6e | 74 65 78 74 44 61 74 61 |yDrawCon|textData|
|000061a0| 2e 70 69 78 6d 61 70 2e | 69 6d 61 67 65 20 3d 20 |.pixmap.|image = |
|000061b0| 47 65 74 50 69 78 42 61 | 73 65 41 64 64 72 28 68 |GetPixBa|seAddr(h|
|000061c0| 50 69 78 4d 61 70 29 3b | 0d 09 0d 09 72 65 74 75 |PixMap);|....retu|
|000061d0| 72 6e 20 51 33 50 69 78 | 6d 61 70 44 72 61 77 43 |rn Q3Pix|mapDrawC|
|000061e0| 6f 6e 74 65 78 74 5f 4e | 65 77 28 26 6d 79 44 72 |ontext_N|ew(&myDr|
|000061f0| 61 77 43 6f 6e 74 65 78 | 74 44 61 74 61 29 3b 0d |awContex|tData);.|
|00006200| 7d 0d 0d 50 69 63 48 61 | 6e 64 6c 65 20 50 33 56 |}..PicHa|ndle P3V|
|00006210| 69 65 77 65 72 47 65 74 | 50 69 63 74 28 50 33 56 |iewerGet|Pict(P3V|
|00006220| 69 65 77 65 72 44 61 74 | 61 2a 20 63 6f 6e 73 74 |iewerDat|a* const|
|00006230| 20 76 69 65 77 65 72 2c | 20 6c 6f 6e 67 20 72 65 | viewer,| long re|
|00006240| 73 6f 6c 75 74 69 6f 6e | 2c 20 73 68 6f 72 74 20 |solution|, short |
|00006250| 64 65 70 74 68 2c 20 73 | 68 6f 72 74 20 6d 6f 64 |depth, s|hort mod|
|00006260| 65 29 0d 09 2f 2f 20 72 | 65 74 75 72 6e 73 20 61 |e)..// r|eturns a|
|00006270| 20 70 69 63 74 75 72 65 | 20 6f 66 20 74 68 65 20 | picture| of the |
|00006280| 76 69 65 77 65 72 0d 09 | 2f 2f 20 72 65 73 6f 6c |viewer..|// resol|
|00006290| 75 74 69 6f 6e 3a 20 74 | 68 65 20 72 65 73 6f 6c |ution: t|he resol|
|000062a0| 75 74 69 6f 6e 20 69 6e | 20 64 70 69 0d 09 2f 2f |ution in| dpi..//|
|000062b0| 20 64 65 70 74 68 3a 20 | 74 68 65 20 64 65 70 74 | depth: |the dept|
|000062c0| 68 20 69 6e 20 62 69 74 | 73 0d 09 2f 2f 20 6d 6f |h in bit|s..// mo|
|000062d0| 64 65 3a 20 74 72 61 6e | 73 66 65 72 6d 6f 64 65 |de: tran|sfermode|
|000062e0| 20 28 65 2e 67 2e 20 73 | 72 63 43 6f 70 79 2c 20 | (e.g. s|rcCopy, |
|000062f0| 73 72 63 4f 72 29 0d 7b | 0d 09 47 57 6f 72 6c 64 |srcOr).{|..GWorld|
|00006300| 50 74 72 09 09 09 09 77 | 6f 72 6c 64 3d 6e 69 6c |Ptr....w|orld=nil|
|00006310| 3b 0d 09 52 65 63 74 09 | 09 09 09 09 62 6f 75 6e |;..Rect.|....boun|
|00006320| 64 73 20 3d 20 76 69 65 | 77 65 72 2d 3e 76 69 65 |ds = vie|wer->vie|
|00006330| 77 52 65 63 74 3b 0d 09 | 52 65 63 74 09 09 09 09 |wRect;..|Rect....|
|00006340| 09 7a 6f 6f 6d 65 64 42 | 6f 75 6e 64 73 3b 0d 09 |.zoomedB|ounds;..|
|00006350| 4f 53 45 72 72 09 09 09 | 09 09 65 72 72 3b 0d 09 |OSErr...|..err;..|
|00006360| 50 69 63 48 61 6e 64 6c | 65 09 09 09 09 72 65 74 |PicHandl|e....ret|
|00006370| 76 61 6c 20 3d 20 6e 69 | 6c 3b 0d 09 43 47 72 61 |val = ni|l;..CGra|
|00006380| 66 50 74 72 09 09 09 09 | 6f 6c 64 50 6f 72 74 3b |fPtr....|oldPort;|
|00006390| 0d 09 47 44 48 61 6e 64 | 6c 65 09 09 09 09 6f 6c |..GDHand|le....ol|
|000063a0| 64 47 44 3b 0d 09 54 51 | 33 44 72 61 77 43 6f 6e |dGD;..TQ|3DrawCon|
|000063b0| 74 65 78 74 4f 62 6a 65 | 63 74 09 6f 66 66 73 63 |textObje|ct.offsc|
|000063c0| 72 65 65 6e 43 6f 6e 74 | 65 78 74 20 3d 20 6e 69 |reenCont|ext = ni|
|000063d0| 6c 3b 0d 09 54 51 33 44 | 72 61 77 43 6f 6e 74 65 |l;..TQ3D|rawConte|
|000063e0| 78 74 4f 62 6a 65 63 74 | 09 6f 6c 64 43 6f 6e 74 |xtObject|.oldCont|
|000063f0| 65 78 74 20 3d 20 6e 69 | 6c 3b 0d 09 50 69 78 4d |ext = ni|l;..PixM|
|00006400| 61 70 48 61 6e 64 6c 65 | 20 09 09 09 68 50 69 78 |apHandle| ...hPix|
|00006410| 4d 61 70 20 3b 0d 0d 09 | 47 65 74 47 57 6f 72 6c |Map ;...|GetGWorl|
|00006420| 64 28 26 6f 6c 64 50 6f | 72 74 2c 20 26 6f 6c 64 |d(&oldPo|rt, &old|
|00006430| 47 44 29 3b 0d 09 51 33 | 56 69 65 77 5f 47 65 74 |GD);..Q3|View_Get|
|00006440| 44 72 61 77 43 6f 6e 74 | 65 78 74 28 76 69 65 77 |DrawCont|ext(view|
|00006450| 65 72 2d 3e 76 69 65 77 | 2c 20 26 6f 6c 64 43 6f |er->view|, &oldCo|
|00006460| 6e 74 65 78 74 29 3b 0d | 0d 09 4f 66 66 73 65 74 |ntext);.|..Offset|
|00006470| 52 65 63 74 28 26 62 6f | 75 6e 64 73 2c 20 2d 62 |Rect(&bo|unds, -b|
|00006480| 6f 75 6e 64 73 2e 6c 65 | 66 74 2c 20 2d 62 6f 75 |ounds.le|ft, -bou|
|00006490| 6e 64 73 2e 74 6f 70 29 | 3b 0d 09 7a 6f 6f 6d 65 |nds.top)|;..zoome|
|000064a0| 64 42 6f 75 6e 64 73 20 | 3d 20 62 6f 75 6e 64 73 |dBounds |= bounds|
|000064b0| 3b 0d 09 7a 6f 6f 6d 65 | 64 42 6f 75 6e 64 73 2e |;..zoome|dBounds.|
|000064c0| 72 69 67 68 74 20 3d 20 | 28 28 28 6c 6f 6e 67 29 |right = |(((long)|
|000064d0| 62 6f 75 6e 64 73 2e 72 | 69 67 68 74 29 2a 72 65 |bounds.r|ight)*re|
|000064e0| 73 6f 6c 75 74 69 6f 6e | 29 2f 37 32 4c 3b 0d 09 |solution|)/72L;..|
|000064f0| 7a 6f 6f 6d 65 64 42 6f | 75 6e 64 73 2e 62 6f 74 |zoomedBo|unds.bot|
|00006500| 74 6f 6d 20 3d 20 28 28 | 28 6c 6f 6e 67 29 62 6f |tom = ((|(long)bo|
|00006510| 75 6e 64 73 2e 62 6f 74 | 74 6f 6d 29 2a 72 65 73 |unds.bot|tom)*res|
|00006520| 6f 6c 75 74 69 6f 6e 29 | 2f 37 32 4c 3b 0d 0d 09 |olution)|/72L;...|
|00006530| 65 72 72 20 3d 20 4e 65 | 77 47 57 6f 72 6c 64 28 |err = Ne|wGWorld(|
|00006540| 26 77 6f 72 6c 64 2c 20 | 33 32 2c 20 26 7a 6f 6f |&world, |32, &zoo|
|00006550| 6d 65 64 42 6f 75 6e 64 | 73 2c 20 6e 69 6c 2c 20 |medBound|s, nil, |
|00006560| 6e 69 6c 2c 20 75 73 65 | 54 65 6d 70 4d 65 6d 29 |nil, use|TempMem)|
|00006570| 3b 09 2f 2f 20 63 72 65 | 61 74 65 20 6f 66 66 73 |;.// cre|ate offs|
|00006580| 63 72 65 65 6e 20 62 69 | 74 6d 61 70 20 75 73 69 |creen bi|tmap usi|
|00006590| 6e 67 20 74 65 6d 70 20 | 6d 65 6d 6f 72 79 0d 09 |ng temp |memory..|
|000065a0| 69 66 20 28 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |if (err |!= noErr|
|000065b0| 29 09 09 09 09 09 09 09 | 09 09 09 09 09 09 2f 2f |).......|......//|
|000065c0| 20 69 66 20 66 61 69 6c | 65 64 0d 09 09 65 72 72 | if fail|ed...err|
|000065d0| 20 3d 20 4e 65 77 47 57 | 6f 72 6c 64 28 26 77 6f | = NewGW|orld(&wo|
|000065e0| 72 6c 64 2c 20 33 32 2c | 20 26 7a 6f 6f 6d 65 64 |rld, 32,| &zoomed|
|000065f0| 42 6f 75 6e 64 73 2c 20 | 6e 69 6c 2c 20 6e 69 6c |Bounds, |nil, nil|
|00006600| 2c 20 30 4c 29 3b 09 09 | 2f 2f 20 74 68 65 6e 20 |, 0L);..|// then |
|00006610| 74 72 79 20 61 67 61 69 | 6e 20 77 69 74 68 20 68 |try agai|n with h|
|00006620| 65 61 70 0d 09 69 66 20 | 28 65 72 72 20 21 3d 20 |eap..if |(err != |
|00006630| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 64 6f 6e 65 |noErr) g|oto done|
|00006640| 3b 0d 09 69 66 20 28 4c | 6f 63 6b 50 69 78 65 6c |;..if (L|ockPixel|
|00006650| 73 28 47 65 74 47 57 6f | 72 6c 64 50 69 78 4d 61 |s(GetGWo|rldPixMa|
|00006660| 70 28 77 6f 72 6c 64 29 | 29 20 3d 3d 20 66 61 6c |p(world)|) == fal|
|00006670| 73 65 29 20 67 6f 74 6f | 20 64 6f 6e 65 3b 0d 0d |se) goto| done;..|
|00006680| 09 53 65 74 47 57 6f 72 | 6c 64 28 77 6f 72 6c 64 |.SetGWor|ld(world|
|00006690| 2c 20 6e 69 6c 29 3b 0d | 09 43 6c 69 70 52 65 63 |, nil);.|.ClipRec|
|000066a0| 74 28 26 7a 6f 6f 6d 65 | 64 42 6f 75 6e 64 73 29 |t(&zoome|dBounds)|
|000066b0| 3b 0d 09 45 72 61 73 65 | 52 65 63 74 28 26 7a 6f |;..Erase|Rect(&zo|
|000066c0| 6f 6d 65 64 42 6f 75 6e | 64 73 29 3b 0d 09 6f 66 |omedBoun|ds);..of|
|000066d0| 66 73 63 72 65 65 6e 43 | 6f 6e 74 65 78 74 20 3d |fscreenC|ontext =|
|000066e0| 20 4d 79 4e 65 77 44 72 | 61 77 43 6f 6e 74 65 78 | MyNewDr|awContex|
|000066f0| 74 28 77 6f 72 6c 64 29 | 3b 0d 09 69 66 20 28 6f |t(world)|;..if (o|
|00006700| 66 66 73 63 72 65 65 6e | 43 6f 6e 74 65 78 74 20 |ffscreen|Context |
|00006710| 3d 3d 20 6e 69 6c 29 20 | 67 6f 74 6f 20 64 6f 6e |== nil) |goto don|
|00006720| 65 3b 0d 09 69 66 20 28 | 51 33 56 69 65 77 5f 53 |e;..if (|Q3View_S|
|00006730| 65 74 44 72 61 77 43 6f | 6e 74 65 78 74 28 76 69 |etDrawCo|ntext(vi|
|00006740| 65 77 65 72 2d 3e 76 69 | 65 77 2c 20 6f 66 66 73 |ewer->vi|ew, offs|
|00006750| 63 72 65 65 6e 43 6f 6e | 74 65 78 74 29 20 3d 3d |creenCon|text) ==|
|00006760| 20 6b 51 33 46 61 69 6c | 75 72 65 29 20 67 6f 74 | kQ3Fail|ure) got|
|00006770| 6f 20 64 6f 6e 65 3b 0d | 09 69 66 20 28 50 33 56 |o done;.|.if (P3V|
|00006780| 69 65 77 65 72 52 65 6e | 64 65 72 28 76 69 65 77 |iewerRen|der(view|
|00006790| 65 72 29 20 3d 3d 20 6b | 51 33 46 61 69 6c 75 72 |er) == k|Q3Failur|
|000067a0| 65 29 20 67 6f 74 6f 20 | 64 6f 6e 65 3b 0d 09 69 |e) goto |done;..i|
|000067b0| 66 20 28 64 65 70 74 68 | 20 21 3d 20 33 32 29 09 |f (depth| != 32).|
|000067c0| 09 09 09 09 09 09 09 09 | 09 09 09 09 2f 2f 20 69 |........|....// i|
|000067d0| 66 20 77 65 20 6d 75 73 | 74 20 74 72 61 6e 73 66 |f we mus|t transf|
|000067e0| 6f 72 6d 20 64 65 70 74 | 68 0d 09 7b 0d 09 09 55 |orm dept|h..{...U|
|000067f0| 6e 6c 6f 63 6b 50 69 78 | 65 6c 73 28 47 65 74 47 |nlockPix|els(GetG|
|00006800| 57 6f 72 6c 64 50 69 78 | 4d 61 70 28 77 6f 72 6c |WorldPix|Map(worl|
|00006810| 64 29 29 3b 0d 09 09 55 | 70 64 61 74 65 47 57 6f |d));...U|pdateGWo|
|00006820| 72 6c 64 28 26 77 6f 72 | 6c 64 2c 20 64 65 70 74 |rld(&wor|ld, dept|
|00006830| 68 2c 26 7a 6f 6f 6d 65 | 64 42 6f 75 6e 64 73 2c |h,&zoome|dBounds,|
|00006840| 6e 69 6c 2c 6e 69 6c 2c | 73 74 72 65 74 63 68 50 |nil,nil,|stretchP|
|00006850| 69 78 29 3b 0d 09 09 69 | 66 20 28 77 6f 72 6c 64 |ix);...i|f (world|
|00006860| 3d 3d 6e 69 6c 29 20 67 | 6f 74 6f 20 64 6f 6e 65 |==nil) g|oto done|
|00006870| 3b 09 09 09 09 09 09 09 | 09 09 09 2f 2f 20 64 6f |;.......|...// do|
|00006880| 6e 27 74 20 6b 6e 6f 77 | 20 69 66 20 74 68 69 73 |n't know| if this|
|00006890| 20 65 76 65 72 20 63 61 | 6e 20 68 61 70 70 65 6e | ever ca|n happen|
|000068a0| 0d 09 09 69 66 20 28 4c | 6f 63 6b 50 69 78 65 6c |...if (L|ockPixel|
|000068b0| 73 28 47 65 74 47 57 6f | 72 6c 64 50 69 78 4d 61 |s(GetGWo|rldPixMa|
|000068c0| 70 28 77 6f 72 6c 64 29 | 29 20 3d 3d 20 66 61 6c |p(world)|) == fal|
|000068d0| 73 65 29 20 67 6f 74 6f | 20 64 6f 6e 65 3b 0d 09 |se) goto| done;..|
|000068e0| 7d 0d 09 68 50 69 78 4d | 61 70 20 3d 20 47 65 74 |}..hPixM|ap = Get|
|000068f0| 47 57 6f 72 6c 64 50 69 | 78 4d 61 70 28 77 6f 72 |GWorldPi|xMap(wor|
|00006900| 6c 64 29 3b 0d 09 72 65 | 74 76 61 6c 20 3d 20 4f |ld);..re|tval = O|
|00006910| 70 65 6e 50 69 63 74 75 | 72 65 28 26 62 6f 75 6e |penPictu|re(&boun|
|00006920| 64 73 29 3b 0d 09 69 66 | 20 28 72 65 74 76 61 6c |ds);..if| (retval|
|00006930| 20 3d 3d 20 6e 69 6c 29 | 20 67 6f 74 6f 20 64 6f | == nil)| goto do|
|00006940| 6e 65 3b 0d 09 43 6f 70 | 79 42 69 74 73 28 2a 28 |ne;..Cop|yBits(*(|
|00006950| 42 69 74 4d 61 70 2a 2a | 29 68 50 69 78 4d 61 70 |BitMap**|)hPixMap|
|00006960| 2c 20 2a 28 42 69 74 4d | 61 70 2a 2a 29 68 50 69 |, *(BitM|ap**)hPi|
|00006970| 78 4d 61 70 2c 20 26 7a | 6f 6f 6d 65 64 42 6f 75 |xMap, &z|oomedBou|
|00006980| 6e 64 73 2c 20 26 62 6f | 75 6e 64 73 2c 20 6d 6f |nds, &bo|unds, mo|
|00006990| 64 65 2c 20 6e 69 6c 29 | 3b 0d 09 43 6c 6f 73 65 |de, nil)|;..Close|
|000069a0| 50 69 63 74 75 72 65 28 | 29 3b 0d 09 69 66 20 28 |Picture(|);..if (|
|000069b0| 51 44 45 72 72 6f 72 28 | 29 20 21 3d 20 6e 6f 45 |QDError(|) != noE|
|000069c0| 72 72 29 0d 09 7b 09 4b | 69 6c 6c 50 69 63 74 75 |rr)..{.K|illPictu|
|000069d0| 72 65 28 72 65 74 76 61 | 6c 29 3b 0d 09 09 72 65 |re(retva|l);...re|
|000069e0| 74 76 61 6c 20 3d 20 6e | 69 6c 3b 0d 09 09 67 6f |tval = n|il;...go|
|000069f0| 74 6f 20 64 6f 6e 65 3b | 0d 09 7d 0d 64 6f 6e 65 |to done;|..}.done|
|00006a00| 3a 0d 09 53 65 74 47 57 | 6f 72 6c 64 28 6f 6c 64 |:..SetGW|orld(old|
|00006a10| 50 6f 72 74 2c 20 6f 6c | 64 47 44 29 3b 0d 09 69 |Port, ol|dGD);..i|
|00006a20| 66 20 28 6f 6c 64 43 6f | 6e 74 65 78 74 29 0d 09 |f (oldCo|ntext)..|
|00006a30| 7b 09 51 33 56 69 65 77 | 5f 53 65 74 44 72 61 77 |{.Q3View|_SetDraw|
|00006a40| 43 6f 6e 74 65 78 74 28 | 76 69 65 77 65 72 2d 3e |Context(|viewer->|
|00006a50| 76 69 65 77 2c 20 6f 6c | 64 43 6f 6e 74 65 78 74 |view, ol|dContext|
|00006a60| 29 3b 0d 09 09 51 33 4f | 62 6a 65 63 74 5f 44 69 |);...Q3O|bject_Di|
|00006a70| 73 70 6f 73 65 49 66 4e | 6f 74 4e 69 6c 28 6f 6c |sposeIfN|otNil(ol|
|00006a80| 64 43 6f 6e 74 65 78 74 | 29 3b 0d 09 7d 0d 09 51 |dContext|);..}..Q|
|00006a90| 33 4f 62 6a 65 63 74 5f | 44 69 73 70 6f 73 65 49 |3Object_|DisposeI|
|00006aa0| 66 4e 6f 74 4e 69 6c 28 | 6f 66 66 73 63 72 65 65 |fNotNil(|offscree|
|00006ab0| 6e 43 6f 6e 74 65 78 74 | 29 3b 0d 09 69 66 20 28 |nContext|);..if (|
|00006ac0| 77 6f 72 6c 64 29 20 44 | 69 73 70 6f 73 65 47 57 |world) D|isposeGW|
|00006ad0| 6f 72 6c 64 28 77 6f 72 | 6c 64 29 3b 0d 09 72 65 |orld(wor|ld);..re|
|00006ae0| 74 75 72 6e 20 72 65 74 | 76 61 6c 3b 09 09 09 09 |turn ret|val;....|
|00006af0| 09 09 09 09 0d 7d 0d 0d | 23 70 72 61 67 6d 61 20 |.....}..|#pragma |
|00006b00| 6d 61 72 6b 20 2d 0d 0d | 76 6f 69 64 20 50 33 56 |mark -..|void P3V|
|00006b10| 69 65 77 65 72 53 65 74 | 53 70 6f 74 4c 69 67 68 |iewerSet|SpotLigh|
|00006b20| 74 28 50 33 56 69 65 77 | 65 72 44 61 74 61 2a 20 |t(P3View|erData* |
|00006b30| 63 6f 6e 73 74 20 76 69 | 65 77 65 72 2c 20 6c 6f |const vi|ewer, lo|
|00006b40| 6e 67 20 69 64 78 2c 20 | 42 6f 6f 6c 65 61 6e 20 |ng idx, |Boolean |
|00006b50| 73 74 61 74 65 29 0d 09 | 2f 2f 20 73 77 69 74 63 |state)..|// switc|
|00006b60| 68 65 73 20 74 68 65 20 | 73 70 6f 74 6c 69 67 68 |hes the |spotligh|
|00006b70| 74 20 77 69 74 68 20 67 | 69 76 65 6e 20 69 6e 64 |t with g|iven ind|
|00006b80| 65 78 20 6f 6e 20 6f 72 | 20 6f 66 66 0d 09 2f 2f |ex on or| off..//|
|00006b90| 20 69 64 78 3d 09 30 09 | 6c 65 66 74 0d 09 2f 2f | idx=.0.|left..//|
|00006ba0| 09 09 31 09 66 72 6f 6e | 74 0d 09 2f 2f 09 09 32 |..1.fron|t..//..2|
|00006bb0| 09 72 69 67 68 74 0d 09 | 2f 2f 09 09 33 09 72 65 |.right..|//..3.re|
|00006bc0| 61 72 0d 7b 0d 09 69 6e | 74 09 63 6f 75 6e 74 2c |ar.{..in|t.count,|
|00006bd0| 69 3b 0d 09 70 6f 69 6e | 74 4c 69 67 68 74 44 61 |i;..poin|tLightDa|
|00006be0| 74 61 5b 69 64 78 5d 2e | 6c 69 67 68 74 44 61 74 |ta[idx].|lightDat|
|00006bf0| 61 2e 69 73 4f 6e 20 3d | 20 28 54 51 33 42 6f 6f |a.isOn =| (TQ3Boo|
|00006c00| 6c 65 61 6e 29 73 74 61 | 74 65 3b 0d 09 51 33 4c |lean)sta|te;..Q3L|
|00006c10| 69 67 68 74 5f 53 65 74 | 53 74 61 74 65 28 76 69 |ight_Set|State(vi|
|00006c20| 65 77 65 72 2d 3e 73 70 | 6f 74 4c 69 67 68 74 73 |ewer->sp|otLights|
|00006c30| 5b 69 64 78 5d 2c 20 28 | 54 51 33 42 6f 6f 6c 65 |[idx], (|TQ3Boole|
|00006c40| 61 6e 29 73 74 61 74 65 | 29 3b 0d 09 63 6f 75 6e |an)state|);..coun|
|00006c50| 74 20 3d 20 30 3b 09 09 | 09 09 09 2f 2f 20 63 6f |t = 0;..|...// co|
|00006c60| 75 6e 74 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f |unt the |number o|
|00006c70| 66 20 6c 69 67 68 74 73 | 20 74 68 61 74 20 61 72 |f lights| that ar|
|00006c80| 65 20 6f 6e 0d 09 66 6f | 72 20 28 69 3d 30 3b 20 |e on..fo|r (i=0; |
|00006c90| 69 3c 34 3b 20 69 2b 2b | 29 0d 09 09 69 66 20 28 |i<4; i++|)...if (|
|00006ca0| 50 33 56 69 65 77 65 72 | 47 65 74 53 70 6f 74 4c |P3Viewer|GetSpotL|
|00006cb0| 69 67 68 74 28 76 69 65 | 77 65 72 2c 20 69 29 29 |ight(vie|wer, i))|
|00006cc0| 20 63 6f 75 6e 74 20 2b | 3d 20 31 3b 0d 09 69 66 | count +|= 1;..if|
|00006cd0| 20 28 63 6f 75 6e 74 20 | 3e 20 30 29 0d 09 7b 09 | (count |> 0)..{.|
|00006ce0| 66 6c 6f 61 74 09 62 72 | 69 67 68 74 6e 65 73 73 |float.br|ightness|
|00006cf0| 20 3d 20 30 2e 38 2f 63 | 6f 75 6e 74 3b 09 09 2f | = 0.8/c|ount;../|
|00006d00| 2f 20 6e 6f 72 6d 61 6c | 69 7a 65 20 62 72 69 67 |/ normal|ize brig|
|00006d10| 68 74 6e 65 73 73 20 74 | 6f 20 61 20 74 6f 74 61 |htness t|o a tota|
|00006d20| 6c 20 6f 66 20 30 2e 38 | 2c 20 74 68 69 73 20 6c |l of 0.8|, this l|
|00006d30| 6f 6f 6b 73 20 62 65 74 | 74 65 72 0d 09 09 66 6f |ooks bet|ter...fo|
|00006d40| 72 20 28 69 3d 30 3b 20 | 69 3c 34 3b 20 69 2b 2b |r (i=0; |i<4; i++|
|00006d50| 29 0d 09 09 7b 09 70 6f | 69 6e 74 4c 69 67 68 74 |)...{.po|intLight|
|00006d60| 44 61 74 61 5b 69 5d 2e | 6c 69 67 68 74 44 61 74 |Data[i].|lightDat|
|00006d70| 61 2e 62 72 69 67 68 74 | 6e 65 73 73 20 3d 20 62 |a.bright|ness = b|
|00006d80| 72 69 67 68 74 6e 65 73 | 73 3b 0d 09 09 09 51 33 |rightnes|s;....Q3|
|00006d90| 4c 69 67 68 74 5f 53 65 | 74 42 72 69 67 68 74 6e |Light_Se|tBrightn|
|00006da0| 65 73 73 28 76 69 65 77 | 65 72 2d 3e 73 70 6f 74 |ess(view|er->spot|
|00006db0| 4c 69 67 68 74 73 5b 69 | 5d 2c 20 62 72 69 67 68 |Lights[i|], brigh|
|00006dc0| 74 6e 65 73 73 29 3b 0d | 09 09 7d 0d 09 7d 0d 09 |tness);.|..}..}..|
|00006dd0| 09 09 0d 09 50 33 56 69 | 65 77 65 72 49 6e 76 61 |....P3Vi|ewerInva|
|00006de0| 6c 69 64 61 74 65 28 76 | 69 65 77 65 72 29 3b 0d |lidate(v|iewer);.|
|00006df0| 7d 0d 0d 42 6f 6f 6c 65 | 61 6e 20 50 33 56 69 65 |}..Boole|an P3Vie|
|00006e00| 77 65 72 47 65 74 53 70 | 6f 74 4c 69 67 68 74 28 |werGetSp|otLight(|
|00006e10| 50 33 56 69 65 77 65 72 | 44 61 74 61 2a 20 63 6f |P3Viewer|Data* co|
|00006e20| 6e 73 74 20 76 69 65 77 | 65 72 2c 20 6c 6f 6e 67 |nst view|er, long|
|00006e30| 20 69 64 78 29 0d 09 2f | 2f 20 72 65 74 75 72 6e | idx)../|/ return|
|00006e40| 73 20 74 68 65 20 73 74 | 61 74 75 73 20 28 6f 6e |s the st|atus (on|
|00006e50| 2f 6f 66 66 29 20 6f 66 | 20 74 68 65 20 67 69 76 |/off) of| the giv|
|00006e60| 65 6e 20 73 70 6f 74 20 | 6c 69 67 68 74 0d 09 2f |en spot |light../|
|00006e70| 2f 20 69 64 78 3d 09 30 | 09 6c 65 66 74 0d 09 2f |/ idx=.0|.left../|
|00006e80| 2f 09 09 31 09 66 72 6f | 6e 74 0d 09 2f 2f 09 09 |/..1.fro|nt..//..|
|00006e90| 32 09 72 69 67 68 74 0d | 09 2f 2f 09 09 33 09 72 |2.right.|.//..3.r|
|00006ea0| 65 61 72 0d 7b 0d 09 54 | 51 33 42 6f 6f 6c 65 61 |ear.{..T|Q3Boolea|
|00006eb0| 6e 09 69 73 4f 6e 3b 0d | 09 51 33 4c 69 67 68 74 |n.isOn;.|.Q3Light|
|00006ec0| 5f 47 65 74 53 74 61 74 | 65 28 76 69 65 77 65 72 |_GetStat|e(viewer|
|00006ed0| 2d 3e 73 70 6f 74 4c 69 | 67 68 74 73 5b 69 64 78 |->spotLi|ghts[idx|
|00006ee0| 5d 2c 20 26 69 73 4f 6e | 29 3b 0d 09 72 65 74 75 |], &isOn|);..retu|
|00006ef0| 72 6e 20 69 73 4f 6e 20 | 3d 3d 20 6b 51 33 54 72 |rn isOn |== kQ3Tr|
|00006f00| 75 65 3b 0d 7d 0d 0d 76 | 6f 69 64 20 50 33 56 69 |ue;.}..v|oid P3Vi|
|00006f10| 65 77 65 72 53 65 74 5a | 28 50 33 56 69 65 77 65 |ewerSetZ|(P3Viewe|
|00006f20| 72 44 61 74 61 2a 20 63 | 6f 6e 73 74 20 76 69 65 |rData* c|onst vie|
|00006f30| 77 65 72 2c 20 42 6f 6f | 6c 65 61 6e 20 76 65 72 |wer, Boo|lean ver|
|00006f40| 74 69 63 61 6c 29 0d 09 | 2f 2f 20 69 66 20 76 65 |tical)..|// if ve|
|00006f50| 72 74 69 63 61 6c 3d 74 | 72 75 65 2c 20 74 68 65 |rtical=t|rue, the|
|00006f60| 20 7a 2d 61 78 69 73 20 | 69 73 20 68 65 6c 64 20 | z-axis |is held |
|00006f70| 76 65 72 74 69 63 61 6c | 0d 09 2f 2f 20 65 6c 73 |vertical|..// els|
|00006f80| 65 20 7a 20 69 73 20 61 | 72 62 69 74 72 61 72 79 |e z is a|rbitrary|
|00006f90| 0d 7b 0d 09 69 66 20 28 | 47 65 74 43 6f 6e 74 72 |.{..if (|GetContr|
|00006fa0| 6f 6c 56 61 6c 75 65 28 | 76 69 65 77 65 72 2d 3e |olValue(|viewer->|
|00006fb0| 7a 56 65 72 74 69 63 61 | 6c 43 74 6c 29 20 21 3d |zVertica|lCtl) !=|
|00006fc0| 20 76 65 72 74 69 63 61 | 6c 29 0d 09 7b 09 76 69 | vertica|l)..{.vi|
|00006fd0| 65 77 65 72 2d 3e 7a 56 | 65 72 74 69 63 61 6c 20 |ewer->zV|ertical |
|00006fe0| 3d 20 7a 56 65 72 74 69 | 63 61 6c 20 3d 20 76 65 |= zVerti|cal = ve|
|00006ff0| 72 74 69 63 61 6c 3b 0d | 09 09 69 66 20 28 76 69 |rtical;.|..if (vi|
|00007000| 65 77 65 72 2d 3e 66 6c | 61 67 73 20 26 20 6b 33 |ewer->fl|ags & k3|
|00007010| 46 6c 61 67 57 69 74 68 | 50 6f 70 75 70 73 29 0d |FlagWith|Popups).|
|00007020| 09 09 09 53 65 74 43 6f | 6e 74 72 6f 6c 56 61 6c |...SetCo|ntrolVal|
|00007030| 75 65 28 76 69 65 77 65 | 72 2d 3e 7a 56 65 72 74 |ue(viewe|r->zVert|
|00007040| 69 63 61 6c 43 74 6c 2c | 20 76 65 72 74 69 63 61 |icalCtl,| vertica|
|00007050| 6c 29 3b 0d 09 09 50 33 | 56 69 65 77 65 72 43 68 |l);...P3|ViewerCh|
|00007060| 65 63 6b 52 6f 74 61 74 | 69 6f 6e 28 76 69 65 77 |eckRotat|ion(view|
|00007070| 65 72 29 3b 0d 09 09 50 | 33 56 69 65 77 65 72 49 |er);...P|3ViewerI|
|00007080| 6e 76 61 6c 69 64 61 74 | 65 28 76 69 65 77 65 72 |nvalidat|e(viewer|
|00007090| 29 3b 0d 09 09 4d 61 6b | 65 53 70 69 6e 56 65 72 |);...Mak|eSpinVer|
|000070a0| 74 69 63 61 6c 49 66 4e | 65 63 65 73 73 61 72 79 |ticalIfN|ecessary|
|000070b0| 28 76 69 65 77 65 72 29 | 3b 0d 09 7d 0d 7d 0d 0d |(viewer)|;..}.}..|
|000070c0| 76 6f 69 64 20 50 33 56 | 69 65 77 65 72 53 65 74 |void P3V|iewerSet|
|000070d0| 53 70 69 6e 28 50 33 56 | 69 65 77 65 72 44 61 74 |Spin(P3V|iewerDat|
|000070e0| 61 2a 20 63 6f 6e 73 74 | 20 76 69 65 77 65 72 2c |a* const| viewer,|
|000070f0| 20 42 6f 6f 6c 65 61 6e | 20 64 6f 53 70 69 6e 29 | Boolean| doSpin)|
|00007100| 0d 09 2f 2f 20 69 66 20 | 64 6f 53 70 69 6e 20 3d |..// if |doSpin =|
|00007110| 20 74 72 75 65 2c 20 73 | 70 69 6e 6e 69 6e 67 20 | true, s|pinning |
|00007120| 69 73 20 65 6e 61 62 6c | 65 64 2c 20 65 6c 73 65 |is enabl|ed, else|
|00007130| 20 64 69 73 61 62 6c 65 | 64 0d 7b 0d 09 53 65 74 | disable|d.{..Set|
|00007140| 43 6f 6e 74 72 6f 6c 56 | 61 6c 75 65 28 76 69 65 |ControlV|alue(vie|
|00007150| 77 65 72 2d 3e 73 70 69 | 6e 43 74 6c 2c 20 64 6f |wer->spi|nCtl, do|
|00007160| 53 70 69 6e 29 3b 0d 09 | 64 6f 53 70 69 6e 44 65 |Spin);..|doSpinDe|
|00007170| 66 61 75 6c 74 20 3d 20 | 64 6f 53 70 69 6e 3b 0d |fault = |doSpin;.|
|00007180| 7d 0d 0d 76 6f 69 64 20 | 50 33 56 69 65 77 65 72 |}..void |P3Viewer|
|00007190| 53 65 74 50 72 6f 6a 65 | 63 74 69 6f 6e 28 50 33 |SetProje|ction(P3|
|000071a0| 56 69 65 77 65 72 44 61 | 74 61 2a 20 63 6f 6e 73 |ViewerDa|ta* cons|
|000071b0| 74 20 76 69 65 77 65 72 | 2c 20 42 6f 6f 6c 65 61 |t viewer|, Boolea|
|000071c0| 6e 20 70 61 72 61 6c 6c | 65 6c 29 0d 09 2f 2f 20 |n parall|el)..// |
|000071d0| 73 65 74 73 20 74 68 65 | 20 70 72 6f 6a 65 63 74 |sets the| project|
|000071e0| 69 6f 6e 20 6d 6f 64 65 | 3a 20 74 6f 20 70 61 72 |ion mode|: to par|
|000071f0| 61 6c 6c 65 6c 20 69 66 | 20 70 61 72 61 6c 6c 65 |allel if| paralle|
|00007200| 6c 20 69 73 20 74 72 75 | 65 2c 0d 09 2f 2f 20 74 |l is tru|e,..// t|
|00007210| 6f 20 70 6f 69 6e 74 20 | 70 72 6f 6a 65 63 74 69 |o point |projecti|
|00007220| 6f 6e 20 6f 74 68 65 72 | 77 69 73 65 0d 7b 0d 09 |on other|wise.{..|
|00007230| 76 69 65 77 65 72 2d 3e | 70 61 72 61 6c 6c 65 6c |viewer->|parallel|
|00007240| 20 3d 20 70 61 72 61 6c | 6c 65 6c 3b 0d 09 53 65 | = paral|lel;..Se|
|00007250| 74 75 70 43 61 6d 65 72 | 61 73 28 76 69 65 77 65 |tupCamer|as(viewe|
|00007260| 72 29 3b 0d 09 50 33 56 | 69 65 77 65 72 49 6e 76 |r);..P3V|iewerInv|
|00007270| 61 6c 69 64 61 74 65 28 | 76 69 65 77 65 72 29 3b |alidate(|viewer);|
|00007280| 0d 7d 0d 0d 42 6f 6f 6c | 65 61 6e 20 50 33 56 69 |.}..Bool|ean P3Vi|
|00007290| 65 77 65 72 47 65 74 50 | 72 6f 6a 65 63 74 69 6f |ewerGetP|rojectio|
|000072a0| 6e 28 50 33 56 69 65 77 | 65 72 44 61 74 61 2a 20 |n(P3View|erData* |
|000072b0| 63 6f 6e 73 74 20 76 69 | 65 77 65 72 29 0d 09 2f |const vi|ewer)../|
|000072c0| 2f 20 67 65 74 73 20 74 | 68 65 20 70 72 6f 6a 65 |/ gets t|he proje|
|000072d0| 63 74 69 6f 6e 20 6d 6f | 64 65 3a 20 74 72 75 65 |ction mo|de: true|
|000072e0| 20 69 66 20 70 61 72 61 | 6c 6c 65 6c 2c 0d 09 2f | if para|llel,../|
|000072f0| 2f 20 66 61 6c 73 65 20 | 69 66 20 70 6f 69 6e 74 |/ false |if point|
|00007300| 20 70 72 6f 6a 65 63 74 | 69 6f 6e 0d 7b 0d 09 72 | project|ion.{..r|
|00007310| 65 74 75 72 6e 20 76 69 | 65 77 65 72 2d 3e 70 61 |eturn vi|ewer->pa|
|00007320| 72 61 6c 6c 65 6c 3b 0d | 7d 0d 0d 23 70 72 61 67 |rallel;.|}..#prag|
|00007330| 6d 61 20 6d 61 72 6b 20 | 2d 0d 0d 76 6f 69 64 20 |ma mark |-..void |
|00007340| 50 33 56 69 65 77 65 72 | 47 65 74 53 65 74 74 69 |P3Viewer|GetSetti|
|00007350| 6e 67 73 28 50 33 56 69 | 65 77 65 72 44 61 74 61 |ngs(P3Vi|ewerData|
|00007360| 2a 20 63 6f 6e 73 74 20 | 76 69 65 77 65 72 2c 20 |* const |viewer, |
|00007370| 50 33 56 69 65 77 65 72 | 53 65 74 74 69 6e 67 73 |P3Viewer|Settings|
|00007380| 2a 20 63 6f 6e 73 74 20 | 73 65 74 74 69 6e 67 73 |* const |settings|
|00007390| 29 0d 09 2f 2f 20 72 65 | 74 75 72 6e 73 20 74 68 |)..// re|turns th|
|000073a0| 65 20 63 75 72 72 65 6e | 74 20 73 65 74 74 69 6e |e curren|t settin|
|000073b0| 67 73 20 6f 66 20 74 68 | 65 20 76 69 65 77 65 72 |gs of th|e viewer|
|000073c0| 0d 7b 0d 09 69 6e 74 09 | 69 3b 0d 09 66 6f 72 20 |.{..int.|i;..for |
|000073d0| 28 69 3d 30 3b 20 69 3c | 34 3b 20 69 2b 2b 29 0d |(i=0; i<|4; i++).|
|000073e0| 09 09 73 65 74 74 69 6e | 67 73 2d 3e 73 70 6f 74 |..settin|gs->spot|
|000073f0| 73 5b 69 5d 20 3d 20 50 | 33 56 69 65 77 65 72 47 |s[i] = P|3ViewerG|
|00007400| 65 74 53 70 6f 74 4c 69 | 67 68 74 28 76 69 65 77 |etSpotLi|ght(view|
|00007410| 65 72 2c 20 69 29 3b 0d | 09 73 65 74 74 69 6e 67 |er, i);.|.setting|
|00007420| 73 2d 3e 69 73 50 61 72 | 61 6c 6c 65 6c 20 3d 20 |s->isPar|allel = |
|00007430| 50 33 56 69 65 77 65 72 | 47 65 74 50 72 6f 6a 65 |P3Viewer|GetProje|
|00007440| 63 74 69 6f 6e 28 76 69 | 65 77 65 72 29 3b 0d 09 |ction(vi|ewer);..|
|00007450| 73 65 74 74 69 6e 67 73 | 2d 3e 63 61 6d 65 72 61 |settings|->camera|
|00007460| 44 61 74 61 20 3d 20 70 | 6f 69 6e 74 43 61 6d 44 |Data = p|ointCamD|
|00007470| 61 74 61 2e 63 61 6d 65 | 72 61 44 61 74 61 3b 0d |ata.came|raData;.|
|00007480| 09 73 65 74 74 69 6e 67 | 73 2d 3e 72 6f 74 61 74 |.setting|s->rotat|
|00007490| 69 6f 6e 20 3d 20 72 6f | 74 61 74 69 6f 6e 3b 0d |ion = ro|tation;.|
|000074a0| 7d 0d 0d 76 6f 69 64 20 | 50 33 56 69 65 77 65 72 |}..void |P3Viewer|
|000074b0| 53 65 74 53 65 74 74 69 | 6e 67 73 28 50 33 56 69 |SetSetti|ngs(P3Vi|
|000074c0| 65 77 65 72 44 61 74 61 | 2a 20 63 6f 6e 73 74 20 |ewerData|* const |
|000074d0| 76 69 65 77 65 72 2c 20 | 50 33 56 69 65 77 65 72 |viewer, |P3Viewer|
|000074e0| 53 65 74 74 69 6e 67 73 | 2a 20 63 6f 6e 73 74 20 |Settings|* const |
|000074f0| 73 65 74 74 69 6e 67 73 | 29 0d 09 2f 2f 20 61 70 |settings|)..// ap|
|00007500| 70 6c 69 65 73 20 74 68 | 65 20 73 65 74 74 69 6e |plies th|e settin|
|00007510| 67 73 20 74 6f 20 74 68 | 65 20 76 69 65 77 65 72 |gs to th|e viewer|
|00007520| 0d 7b 0d 09 69 6e 74 09 | 69 3b 0d 09 66 6f 72 20 |.{..int.|i;..for |
|00007530| 28 69 3d 30 3b 20 69 3c | 34 3b 20 69 2b 2b 29 0d |(i=0; i<|4; i++).|
|00007540| 09 09 50 33 56 69 65 77 | 65 72 53 65 74 53 70 6f |..P3View|erSetSpo|
|00007550| 74 4c 69 67 68 74 28 76 | 69 65 77 65 72 2c 20 69 |tLight(v|iewer, i|
|00007560| 2c 20 73 65 74 74 69 6e | 67 73 2d 3e 73 70 6f 74 |, settin|gs->spot|
|00007570| 73 5b 69 5d 29 3b 0d 09 | 50 33 56 69 65 77 65 72 |s[i]);..|P3Viewer|
|00007580| 53 65 74 50 72 6f 6a 65 | 63 74 69 6f 6e 28 76 69 |SetProje|ction(vi|
|00007590| 65 77 65 72 2c 20 73 65 | 74 74 69 6e 67 73 2d 3e |ewer, se|ttings->|
|000075a0| 69 73 50 61 72 61 6c 6c | 65 6c 29 3b 0d 09 70 6f |isParall|el);..po|
|000075b0| 69 6e 74 43 61 6d 44 61 | 74 61 2e 63 61 6d 65 72 |intCamDa|ta.camer|
|000075c0| 61 44 61 74 61 20 3d 20 | 73 65 74 74 69 6e 67 73 |aData = |settings|
|000075d0| 2d 3e 63 61 6d 65 72 61 | 44 61 74 61 3b 0d 09 72 |->camera|Data;..r|
|000075e0| 6f 74 61 74 69 6f 6e 20 | 3d 20 73 65 74 74 69 6e |otation |= settin|
|000075f0| 67 73 2d 3e 72 6f 74 61 | 74 69 6f 6e 3b 0d 09 53 |gs->rota|tion;..S|
|00007600| 65 74 75 70 43 61 6d 65 | 72 61 73 28 76 69 65 77 |etupCame|ras(view|
|00007610| 65 72 29 3b 0d 7d 0d 0d | 00 00 00 00 00 00 00 00 |er);.}..|........|
|00007620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007680| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00007690| 00 00 00 02 0a 53 74 61 | 74 69 6f 6e 65 72 79 69 |.....Sta|tioneryi|
|000076a0| 01 00 00 00 00 01 00 00 | 11 c0 ad 45 42 b9 ad 45 |........|...EB..E|
|000076b0| 0e 50 6c 6f 74 33 44 56 | 69 65 77 65 72 2e 63 65 |.Plot3DV|iewer.ce|
|000076c0| 02 00 00 00 54 45 58 54 | 43 57 49 45 01 00 b2 94 |....TEXT|CWIE....|
|000076d0| 00 00 54 45 58 54 43 57 | 49 45 01 00 b2 94 b2 00 |..TEXTCW|IE......|
|000076e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000076f0| 00 00 ad b9 57 79 00 00 | 75 98 00 00 01 9a 43 53 |....Wy..|u.....CS|
|00007700| 31 00 00 69 00 ae 00 00 | 00 00 17 d1 00 00 00 00 |1..i....|........|
|00007710| 77 10 00 00 80 00 00 00 | 00 1a 81 0b 00 1a c0 00 |w.......|........|
|00007720| aa 63 3d 00 ad 73 56 43 | 00 00 00 00 00 00 00 00 |.c=..sVC|........|
|00007730| 00 00 00 00 00 00 00 00 | 00 00 17 c1 00 00 1a ac |........|........|
|00007740| 00 01 1a e4 00 01 00 00 | 00 00 1a ad 00 1b 27 a8 |........|......'.|
|00007750| 00 03 27 b5 00 05 00 00 | 00 00 00 00 00 00 0c 00 |..'.....|........|
|00007760| 00 00 00 02 06 53 79 73 | 74 65 6d c1 02 00 02 00 |.....Sys|tem.....|
|00007770| 7a 73 79 73 4d 41 43 53 | 31 00 00 69 00 ae 00 00 |zsysMACS|1..i....|
|00007780| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00007790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000077a0| 00 00 00 00 00 00 00 03 | 00 04 00 58 00 04 03 3d |........|...X...=|
|000077b0| 02 5a 00 58 00 04 03 3d | 02 5a ae 11 82 f3 00 00 |.Z.X...=|.Z......|
|000077c0| 4e 30 00 00 4e 3c 00 00 | 46 68 01 4e 00 00 00 04 |N0..N<..|Fh.N....|
|000077d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000077e0| 00 00 00 46 02 71 c9 e8 | 23 42 00 00 00 1c 00 46 |...F.q..|#B.....F|
|000077f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00007800| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00007810| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00007820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00007870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+