home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 October / pcp156b.iso / handson / files / wilf / FORMX.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1999-07-16  |  15.9 KB  |  594 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   7770
  5.    ClientLeft      =   3600
  6.    ClientTop       =   2340
  7.    ClientWidth     =   9060
  8.    Height          =   8235
  9.    Left            =   3540
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   7770
  12.    ScaleWidth      =   9060
  13.    Top             =   1935
  14.    Width           =   9180
  15.    Begin VB.CommandButton Command12 
  16.       Caption         =   "3D EXAMPLE6"
  17.       Height          =   495
  18.       Left            =   7560
  19.       TabIndex        =   11
  20.       Top             =   6720
  21.       Width           =   1335
  22.    End
  23.    Begin VB.CommandButton Command11 
  24.       Caption         =   "3D EXAMPLE5"
  25.       Height          =   495
  26.       Left            =   7560
  27.       TabIndex        =   10
  28.       Top             =   5400
  29.       Width           =   1335
  30.    End
  31.    Begin VB.CommandButton Command10 
  32.       Caption         =   "3D EXAMPLE4"
  33.       Height          =   495
  34.       Left            =   7560
  35.       TabIndex        =   9
  36.       Top             =   4080
  37.       Width           =   1335
  38.    End
  39.    Begin VB.CommandButton Command9 
  40.       Caption         =   "3D EXAMPLE3"
  41.       Height          =   495
  42.       Left            =   7560
  43.       TabIndex        =   8
  44.       Top             =   2760
  45.       Width           =   1335
  46.    End
  47.    Begin VB.CommandButton Command8 
  48.       Caption         =   "3D EXAMPLE2"
  49.       Height          =   495
  50.       Left            =   7560
  51.       TabIndex        =   7
  52.       Top             =   1440
  53.       Width           =   1335
  54.    End
  55.    Begin VB.CommandButton Command7 
  56.       Caption         =   "3D EXAMPLE1"
  57.       Height          =   495
  58.       Left            =   7560
  59.       TabIndex        =   6
  60.       Top             =   120
  61.       Width           =   1335
  62.    End
  63.    Begin VB.CommandButton Command6 
  64.       Caption         =   "2D EXAMPLE6"
  65.       Height          =   495
  66.       Left            =   120
  67.       TabIndex        =   5
  68.       Top             =   6720
  69.       Width           =   1335
  70.    End
  71.    Begin VB.CommandButton Command5 
  72.       Caption         =   "2D EXAMPLE5"
  73.       Height          =   495
  74.       Left            =   120
  75.       TabIndex        =   4
  76.       Top             =   5400
  77.       Width           =   1335
  78.    End
  79.    Begin VB.CommandButton Command4 
  80.       Caption         =   "2D EXAMPLE4"
  81.       Height          =   495
  82.       Left            =   120
  83.       TabIndex        =   3
  84.       Top             =   4080
  85.       Width           =   1335
  86.    End
  87.    Begin VB.CommandButton Command3 
  88.       Caption         =   "2D EXAMPLE3"
  89.       Height          =   495
  90.       Left            =   120
  91.       TabIndex        =   2
  92.       Top             =   2880
  93.       Width           =   1335
  94.    End
  95.    Begin VB.CommandButton Command2 
  96.       Caption         =   "2D EXAMPLE 2"
  97.       Height          =   495
  98.       Left            =   120
  99.       TabIndex        =   1
  100.       Top             =   1440
  101.       Width           =   1335
  102.    End
  103.    Begin VB.CommandButton Command1 
  104.       Caption         =   "2D EXAMPLE 1"
  105.       Height          =   495
  106.       Left            =   120
  107.       TabIndex        =   0
  108.       Top             =   120
  109.       Width           =   1335
  110.    End
  111. Attribute VB_Name = "Form1"
  112. Attribute VB_Creatable = False
  113. Attribute VB_Exposed = False
  114. Dim Shared Shape2D(2000, 2) As Single
  115. Dim Shared Shape3D(2000, 3) As Single
  116. Dim Shared Object3D(2000)
  117. Sub Draw2D(Obj As Integer, Colr As Integer)
  118. ' Obj  = entry number in Shape2D
  119. ' Colr = QBColor number
  120. i = Obj
  121. PSet (Shape2D(i, 1), Shape2D(i, 2))
  122.     i = i + 1
  123.     Line -(Shape2D(i, 1), Shape2D(i, 2)), QBColor(Colr)
  124. Loop Until Shape2D(i + 1, 1) = 9999
  125. Line -(Shape2D(Obj, 1), Shape2D(Obj, 2)), QBColor(Colr)
  126. End Sub
  127. Sub Pitch(OldObj As Integer, CentreX As Single, CentreY As Single, CentreZ As Single, Angle As Single)
  128. ' OldObj  = input number in Shape3D
  129. ' CentreX = X ordinate of centre
  130. ' CentreY = Y ordinate or centre
  131. ' CentreZ = Z ordinate or centre
  132. ' Angle   = Degrees of rotation anticlockwise
  133. ' assign variable rather than repeat calculation
  134. SinY = Sin(Angle * 0.0174533)
  135. CosY = Cos(Angle * 0.0174533)
  136. i = OldObj - 1
  137. ' process each point on the shape
  138.     i = i + 1
  139.     j = Object3D(i) - 1
  140.     Do
  141.         j = j + 1
  142.         OldX = Shape3D(j, 1) - CentreX
  143.         OldY = Shape3D(j, 2) - CentreY
  144.         OldZ = Shape3D(j, 3) - CentreZ
  145.         Shape3D(j, 2) = OldY * CosY - OldZ * SinY + CentreY
  146.         Shape3D(j, 3) = OldY * SinY + OldZ * CosY + CentreZ
  147.     Loop Until Shape3D(j + 1, 1) = 9999
  148. Loop Until Object3D(i + 1) = 9999
  149. End Sub
  150. Sub Sketch(Obj As Integer, Colr As Integer, Alpha As Single, Phi As Single)
  151. ' Obj   = entry number in Object3D
  152. ' Colr  = QBColor number
  153. ' Alpha = attack angle to horizon (passed inward)
  154. ' Phi   = vantage angle (passed inward)
  155. Dim i, j As Integer
  156. i = Obj
  157.     j = Object3D(i)
  158.     Draw3D j, Colr, Alpha, Phi
  159.     i = i + 1
  160. Loop Until Object3D(i) = 9999
  161. End Sub
  162. Sub Draw3D(Obj As Integer, Colr As Integer, Alpha As Single, Phi As Single)
  163. ' Obj   = entry number in Shape2D
  164. ' Colr  = QBColor number
  165. ' Alpha = attack angle to horizon
  166. ' Phi   = vantage angle
  167. Dim NewX As Single, NewY As Single, OrigX As Single, OrigY As Single
  168. Dim TanAlpha As Single, Length As Single
  169. TanAlpha = Tan(Alpha * 0.0174533)
  170. i = Obj
  171. GoSub Resolve
  172. OrigX = NewX: OrigY = NewY
  173. PSet (OrigX, OrigY)
  174.     i = i + 1
  175.     GoSub Resolve
  176.     Line -(NewX, NewY), QBColor(Colr)
  177. Loop Until Shape3D(i + 1, 1) = 9999
  178. Line -(OrigX, OrigY), QBColor(Colr)
  179. Exit Sub
  180. Resolve:
  181.     X = Shape3D(i, 1)
  182.     Y = Shape3D(i, 2)
  183.     Z = Shape3D(i, 3)
  184.     If Abs(TanAlpha) < 0.01 Then
  185.         Length = 0
  186.     Else
  187.         Length = Z / TanAlpha
  188.     End If
  189.     NewX = X + Length * Cos(Phi * 0.0174533)
  190.     NewY = Y + Length * Sin(Phi * 0.0174533)
  191.     Return
  192. End Sub
  193. Sub Enlarge2D(OldObj As Integer, NewObj As Integer, CentreX As Single, CentreY As Single, Factor As Single)
  194. ' OldObj  = input number in Shape2D
  195. ' NewObj  = output number in Shape2D
  196. ' CentreX = X ordinate of centre of enlargement
  197. ' CentreY = Y ordinate or centre of enlargement
  198. ' Factor  = Enlargement (>1) or Shrinkage (<1) factor
  199. i = OldObj - 1
  200. j = NewObj - 1
  201. ' process each point on the shape
  202.     i = i + 1
  203.     j = j + 1
  204.     Shape2D(j, 1) = (Shape2D(i, 1) - CentreX) * Factor + CentreX
  205.     Shape2D(j, 2) = (Shape2D(i, 2) - CentreY) * Factor + CentreY
  206. Loop Until Shape2D(i + 1, 1) = 9999
  207. ' add a drogue to output
  208. Shape2D(j + 1, 1) = 9999
  209. End Sub
  210. Sub Rotate2D(OldObj As Integer, NewObj As Integer, CentreX As Single, CentreY As Single, Angle As Single)
  211. ' OldObj  = input number in Shape2D
  212. ' NewObj  = output number in Shape2D
  213. ' CentreX = X ordinate of centre of enlargement
  214. ' CentreY = Y ordinate or centre of enlargement
  215. ' Angle   = Degrees of rotation anticlockwise
  216. ' assign variable rather than repeat calculation
  217. SinX = Sin(Angle * 0.0174533)
  218. CosX = Cos(Angle * 0.0174533)
  219. i = OldObj - 1
  220. j = NewObj - 1
  221. ' process each point on the shape
  222.     i = i + 1
  223.     j = j + 1
  224.     OldX = Shape2D(i, 1) - CentreX
  225.     OldY = Shape2D(i, 2) - CentreY
  226.     Shape2D(j, 1) = OldX * CosX - OldY * SinX + CentreX
  227.     Shape2D(j, 2) = OldX * SinX + OldY * CosX + CentreY
  228. Loop Until Shape2D(i + 1, 1) = 9999
  229. Shape2D(j + 1, 1) = 9999
  230. End Sub
  231. Sub Roll(OldObj As Integer, CentreX As Single, CentreY As Single, CentreZ As Single, Angle As Single)
  232. ' OldObj  = input number in Shape3D
  233. ' CentreX = X ordinate of centre
  234. ' CentreY = Y ordinate or centre
  235. ' CentreZ = Z ordinate or centre
  236. ' Angle   = Degrees of rotation anticlockwise
  237. ' assign variable rather than repeat calculation
  238. SinX = Sin(Angle * 0.0174533)
  239. CosX = Cos(Angle * 0.0174533)
  240. i = OldObj - 1
  241. ' process each point on the shape
  242.     i = i + 1
  243.     j = Object3D(i) - 1
  244.     Do
  245.         j = j + 1
  246.         OldX = Shape3D(j, 1) - CentreX
  247.         OldY = Shape3D(j, 2) - CentreY
  248.         OldZ = Shape3D(j, 3) - CentreZ
  249.         Shape3D(j, 1) = OldX * CosX - OldY * SinX + CentreX
  250.         Shape3D(j, 2) = OldX * SinX + OldY * CosX + CentreY
  251.     Loop Until Shape3D(j + 1, 1) = 9999
  252. Loop Until Object3D(i + 1) = 9999
  253. End Sub
  254. Sub Move2D(OldObj As Integer, NewObj As Integer, XChange As Single, YChange As Single)
  255. ' OldObj  = input number in Shape2D
  256. ' NewObj  = output number in Shape2D
  257. ' XChange = amount of movement along X axis
  258. ' YChange = amount of movement along Y axis
  259. i = OldObj - 1
  260. j = NewObj - 1
  261. ' process each point on the shape
  262.     i = i + 1
  263.     j = j + 1
  264.     Shape2D(j, 1) = Shape2D(i, 1) + XChange
  265.     Shape2D(j, 2) = Shape2D(i, 2) + YChange
  266. Loop Until Shape2D(i + 1, 1) = 9999
  267. Shape2D(j + 1, 1) = 9999
  268. End Sub
  269. Sub X3Reset()
  270. BackColor = QBColor(10)
  271. Scale (-50, 50)-(50, -50)
  272. For i = 1 To 2000
  273.     Object3D(i) = 9999
  274.     Shape3D(i, 1) = 9999
  275. End Sub
  276. Sub XCrosshairs(CentreX As Single, CentreY As Single)
  277. ' draw crosshairs
  278. DrawWidth = 2
  279. Line (CentreX, CentreY + 2)-(CentreX, CentreY - 2)
  280. Line (CentreX + 2, CentreY)-(CentreX - 2, CentreY)
  281. End Sub
  282. Sub X2Reset()
  283. BackColor = QBColor(10)
  284. Scale (-50, 50)-(50, -50)
  285. For i = 1 To 2000
  286.     Shape2D(i, 1) = 9999
  287. Line (-100, 0)-(100, 0), QBColor(0)
  288. Line (0, -100)-(0, 100), QBColor(0)
  289. End Sub
  290. Sub XSetShape2D()
  291. ' set up the shape
  292. Shape2D(1, 1) = 0: Shape2D(1, 2) = 0
  293. Shape2D(2, 1) = 10: Shape2D(2, 2) = 0
  294. Shape2D(3, 1) = 20: Shape2D(3, 2) = 10
  295. Shape2D(4, 1) = 20: Shape2D(4, 2) = 20
  296. Shape2D(5, 1) = 10: Shape2D(5, 2) = 30
  297. Shape2D(6, 1) = 0: Shape2D(6, 2) = 30
  298. Shape2D(7, 1) = -10: Shape2D(7, 2) = 20
  299. Shape2D(8, 1) = -10: Shape2D(8, 2) = 10
  300. End Sub
  301. Sub XSetShape3D()
  302. ' set up the pyramid shape
  303. ' first side
  304. Shape3D(1, 1) = 20
  305. Shape3D(1, 2) = 0
  306. Shape3D(1, 3) = 20
  307. Shape3D(2, 1) = -20
  308. Shape3D(2, 2) = 0
  309. Shape3D(2, 3) = 20
  310. Shape3D(3, 1) = 0
  311. Shape3D(3, 2) = 40
  312. Shape3D(3, 3) = 0
  313. 'second side
  314. Shape3D(5, 1) = 20
  315. Shape3D(5, 2) = 0
  316. Shape3D(5, 3) = 20
  317. Shape3D(6, 1) = 20
  318. Shape3D(6, 2) = 0
  319. Shape3D(6, 3) = -20
  320. Shape3D(7, 1) = 0
  321. Shape3D(7, 2) = 40
  322. Shape3D(7, 3) = 0
  323. 'third side
  324. Shape3D(9, 1) = 20
  325. Shape3D(9, 2) = 0
  326. Shape3D(9, 3) = -20
  327. Shape3D(10, 1) = -20
  328. Shape3D(10, 2) = 0
  329. Shape3D(10, 3) = -20
  330. Shape3D(11, 1) = 0
  331. Shape3D(11, 2) = 40
  332. Shape3D(11, 3) = 0
  333. 'fourth side
  334. Shape3D(13, 1) = -20
  335. Shape3D(13, 2) = 0
  336. Shape3D(13, 3) = 20
  337. Shape3D(14, 1) = -20
  338. Shape3D(14, 2) = 0
  339. Shape3D(14, 3) = -20
  340. Shape3D(15, 1) = 0
  341. Shape3D(15, 2) = 40
  342. Shape3D(15, 3) = 0
  343. 'fifth side
  344. Shape3D(17, 1) = -20
  345. Shape3D(17, 2) = 0
  346. Shape3D(17, 3) = 20
  347. Shape3D(18, 1) = -20
  348. Shape3D(18, 2) = 0
  349. Shape3D(18, 3) = -20
  350. Shape3D(19, 1) = 20
  351. Shape3D(19, 2) = 0
  352. Shape3D(19, 3) = -20
  353. Shape3D(20, 1) = 20
  354. Shape3D(20, 2) = 0
  355. Shape3D(20, 3) = 20
  356. 'declare the 3D shape
  357. Object3D(1) = 1
  358. Object3D(2) = 5
  359. Object3D(3) = 9
  360. Object3D(4) = 13
  361. Object3D(5) = 17
  362. 'set up the cube shape
  363. ' first side
  364. Shape3D(22, 1) = -20
  365. Shape3D(22, 2) = 20
  366. Shape3D(22, 3) = 20
  367. Shape3D(23, 1) = -20
  368. Shape3D(23, 2) = -20
  369. Shape3D(23, 3) = 20
  370. Shape3D(24, 1) = -20
  371. Shape3D(24, 2) = -20
  372. Shape3D(24, 3) = -20
  373. Shape3D(25, 1) = -20
  374. Shape3D(25, 2) = 20
  375. Shape3D(25, 3) = -20
  376. 'second side
  377. Shape3D(27, 1) = -20
  378. Shape3D(27, 2) = 20
  379. Shape3D(27, 3) = 20
  380. Shape3D(28, 1) = 20
  381. Shape3D(28, 2) = 20
  382. Shape3D(28, 3) = 20
  383. Shape3D(29, 1) = 20
  384. Shape3D(29, 2) = 20
  385. Shape3D(29, 3) = -20
  386. Shape3D(30, 1) = -20
  387. Shape3D(30, 2) = 20
  388. Shape3D(30, 3) = -20
  389. 'third side
  390. Shape3D(32, 1) = 20
  391. Shape3D(32, 2) = 20
  392. Shape3D(32, 3) = 20
  393. Shape3D(33, 1) = 20
  394. Shape3D(33, 2) = -20
  395. Shape3D(33, 3) = 20
  396. Shape3D(34, 1) = 20
  397. Shape3D(34, 2) = -20
  398. Shape3D(34, 3) = -20
  399. Shape3D(35, 1) = 20
  400. Shape3D(35, 2) = 20
  401. Shape3D(35, 3) = -20
  402. 'fourth side
  403. Shape3D(37, 1) = 20
  404. Shape3D(37, 2) = -20
  405. Shape3D(37, 3) = 20
  406. Shape3D(38, 1) = 20
  407. Shape3D(38, 2) = -20
  408. Shape3D(38, 3) = -20
  409. Shape3D(39, 1) = -20
  410. Shape3D(39, 2) = -20
  411. Shape3D(39, 3) = -20
  412. Shape3D(40, 1) = -20
  413. Shape3D(40, 2) = -20
  414. Shape3D(40, 3) = 20
  415. 'fifth side
  416. Shape3D(42, 1) = -20
  417. Shape3D(42, 2) = 20
  418. Shape3D(42, 3) = 20
  419. Shape3D(43, 1) = 20
  420. Shape3D(43, 2) = 20
  421. Shape3D(43, 3) = 20
  422. Shape3D(44, 1) = 20
  423. Shape3D(44, 2) = -20
  424. Shape3D(44, 3) = 20
  425. Shape3D(45, 1) = -20
  426. Shape3D(45, 2) = -20
  427. Shape3D(45, 3) = 20
  428. 'sixth side
  429. Shape3D(47, 1) = -20
  430. Shape3D(47, 2) = 20
  431. Shape3D(47, 3) = -20
  432. Shape3D(48, 1) = 20
  433. Shape3D(48, 2) = 20
  434. Shape3D(48, 3) = -20
  435. Shape3D(49, 1) = 20
  436. Shape3D(49, 2) = -20
  437. Shape3D(49, 3) = -20
  438. Shape3D(50, 1) = -20
  439. Shape3D(50, 2) = -20
  440. Shape3D(50, 3) = -20
  441. 'declare the 3D shape
  442. Object3D(7) = 22
  443. Object3D(8) = 27
  444. Object3D(9) = 32
  445. Object3D(10) = 37
  446. Object3D(11) = 42
  447. Object3D(12) = 47
  448. End Sub
  449. Sub Yaw(OldObj As Integer, CentreX As Single, CentreY As Single, CentreZ As Single, Angle As Single)
  450. ' OldObj  = input number in Shape3D
  451. ' CentreX = X ordinate of centre
  452. ' CentreY = Y ordinate or centre
  453. ' CentreZ = Z ordinate or centre
  454. ' Angle   = Degrees of rotation anticlockwise
  455. ' assign variable rather than repeat calculation
  456. SinX = Sin(Angle * 0.0174533)
  457. CosX = Cos(Angle * 0.0174533)
  458. i = OldObj - 1
  459. ' process each point on the shape
  460.     i = i + 1
  461.     j = Object3D(i) - 1
  462.     Do
  463.         j = j + 1
  464.         OldX = Shape3D(j, 1) - CentreX
  465.         OldY = Shape3D(j, 2) - CentreY
  466.         OldZ = Shape3D(j, 3) - CentreZ
  467.         Shape3D(j, 1) = OldX * CosX - OldZ * SinX + CentreX
  468.         Shape3D(j, 3) = OldX * SinX + OldZ * CosX + CentreZ
  469.     Loop Until Shape3D(j + 1, 1) = 9999
  470. Loop Until Object3D(i + 1) = 9999
  471. End Sub
  472. Private Sub Command1_Click()
  473. X2Reset
  474. XSetShape2D
  475. XCrosshairs 10, -15
  476.       
  477. For i = 1 To 80
  478.     DrawWidth = 1:  Draw2D 1, 4
  479.     Move2D 1, 1, -0.7, 2.5
  480.     Enlarge2D 1, 1, 10, -15, 0.95
  481. DrawWidth = 2:  Draw2D 1, 4
  482. End Sub
  483. Private Sub Command10_Click()
  484. X3Reset
  485. XSetShape3D
  486. ' pyramid
  487. Sketch 1, 0, 60, 40
  488. For i = 1 To 5
  489.     Pitch 1, 0, 0, 0, 5
  490.     Sketch 1, 12, 60, 40
  491. Sketch 1, 1, 60, 40
  492. End Sub
  493. Private Sub Command11_Click()
  494. X3Reset
  495. XSetShape3D
  496. ' pyramid
  497. Sketch 1, 0, 60, 40
  498. For i = 1 To 5
  499.     Yaw 1, 0, 0, 0, 5
  500.     Sketch 1, 12, 60, 40
  501. Sketch 1, 1, 60, 40
  502. End Sub
  503. Private Sub Command12_Click()
  504. X3Reset
  505. XSetShape3D
  506. ' pyramid
  507. Roll 1, 0, 0, 0, 70
  508. Pitch 1, 0, 0, 0, 160
  509. Yaw 1, 0, 0, 0, 30
  510. Sketch 1, 12, 60, 40
  511. End Sub
  512. Private Sub Command2_Click()
  513. X2Reset
  514. XSetShape2D
  515. XCrosshairs 10, -15
  516.       
  517. For i = 1 To 80
  518.     DrawWidth = 1:  Draw2D 1, 4
  519.     Move2D 1, 1, -0.3, -2.4
  520.     Enlarge2D 1, 1, 10, -15, 1.02
  521. DrawWidth = 2:  Draw2D 1, 4
  522. End Sub
  523. Private Sub Command3_Click()
  524. X2Reset
  525. XSetShape2D
  526. XCrosshairs -10, 20
  527.       
  528. For i = 1 To 80
  529.     DrawWidth = 1:  Draw2D 1, 4
  530.     Move2D 1, 1, -0.3, -0.2
  531.     Enlarge2D 1, 1, -10, 20, 1.005
  532. DrawWidth = 2:  Draw2D 1, 4
  533. End Sub
  534. Private Sub Command4_Click()
  535. X2Reset
  536. XSetShape2D
  537. XCrosshairs 5, 15
  538.       
  539. For i = 1 To 80
  540.     DrawWidth = 1:  Draw2D 1, 4
  541.     Enlarge2D 1, 1, 5, 15, 1.01
  542. DrawWidth = 2:  Draw2D 1, 4
  543. End Sub
  544. Private Sub Command5_Click()
  545. X2Reset
  546. XSetShape2D
  547. XCrosshairs 5, 15
  548.       
  549. For i = 1 To 80
  550.     DrawWidth = 1:  Draw2D 1, 4
  551.     Enlarge2D 1, 1, 5, 15, 0.99
  552. DrawWidth = 2:  Draw2D 1, 4
  553. End Sub
  554. Private Sub Command6_Click()
  555. X2Reset
  556. XSetShape2D
  557.       
  558. DrawWidth = 2:  Draw2D 1, 1
  559. Move2D 1, 1, 5, 15
  560. DrawWidth = 2:  Draw2D 1, 4
  561. Move2D 1, 1, -17, -20
  562. Rotate2D 1, 1, 30, -30, 17
  563. DrawWidth = 2:  Draw2D 1, 14
  564. End Sub
  565. Private Sub Command7_Click()
  566. X3Reset
  567. XSetShape3D
  568. ' cube
  569. Sketch 7, 1, 70, -20
  570. End Sub
  571. Private Sub Command8_Click()
  572. X3Reset
  573. XSetShape3D
  574. ' pyramid
  575. Sketch 1, 12, 60, 40
  576. End Sub
  577. Private Sub Command9_Click()
  578. X3Reset
  579. XSetShape3D
  580. ' pyramid
  581. Sketch 1, 0, 60, 40
  582. For i = 1 To 5
  583.     Roll 1, 0, 0, 0, 5
  584.     Sketch 1, 12, 60, 40
  585. Sketch 1, 1, 60, 40
  586. End Sub
  587. Private Sub Form_Load()
  588.   X3Reset
  589. End Sub
  590. Private Sub Form_Paint()
  591. Line (-100, 0)-(100, 0), QBColor(0)
  592. Line (0, -100)-(0, 100), QBColor(0)
  593. End Sub
  594.