home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / geo_demo / cscglob5.bas < prev    next >
BASIC Source File  |  1992-07-17  |  4KB  |  92 lines

  1. 'Global Module
  2.  
  3. '3D CyberSpace viewer from...
  4.  
  5. 'Ivory Tower Software
  6. 'Richard Wagner, vice president, development
  7. 'CIS 76427,2611
  8.  
  9. 'Copyright 1992, all rights reserved.
  10.  
  11. 'You may use this VB source code in your programs if you include attribution in your
  12. 'startup and "about" screens in the form: "Portions of this program copyright by
  13. 'Ivory Tower Software, used with permission."
  14.  
  15. 'If you do use this code in your application, please let us know. We would like to
  16. 'take a look at it. Your comments and suggestions for improving this software are
  17. 'welcome.
  18.  
  19. Type PointAPI
  20.   X As Integer
  21.   Y As Integer
  22. End Type
  23.  
  24. 'Declare Windows API function:
  25. Declare Function Polygon Lib "GDI" (ByVal hDC As Integer, lpPoints As PointAPI, ByVal nCount As Integer) As Integer
  26.  
  27. 'Declare GEO.DLL subroutine:
  28. Declare Sub SolidRotate Lib "Geo.dll" (ByVal o1#, ByVal o2#, ByVal o3#, ByVal p1#, ByVal p2#, ByVal p3#, r1#, r2#, r3#, ByVal theta#)
  29. Declare Sub ThreeDXForm Lib "Geo.dll" (ByVal W%, ByVal D%, ByVal X!, ByVal Y!, ByVal Z!, ByVal VPX!, ByVal VPY!, ByVal VPZ!, ByVal WPX!, ByVal WPY!, ByVal WPZ!, ByVal RPX!, ByVal RPY!, ByVal RPZ!, ByVal SPX!, ByVal SPY!, ByVal SPZ!, PXr!, PYr!, PZr!)
  30.  
  31. Global Const sfPi = 3.1415927               'Single float Pi is the ratio of a circle's circumference to its diameter
  32.  
  33. Global sfViewPointX As Single               'View point coordinates in World Space
  34. Global sfViewPointY As Single
  35. Global sfViewPointZ As Single
  36.  
  37. Global sfWinPointX As Single                'Center of view window in World Space
  38. Global sfWinPointY As Single
  39. Global sfWinPointZ As Single
  40.  
  41. Global sfRpointX As Single                  'Right edge of view widow in World Space
  42. Global sfRpointY As Single
  43. Global sfRpointZ As Single
  44.  
  45. Global sfSpointX As Single                  'Top edge of view widow in World Space
  46. Global sfSpointY As Single
  47. Global sfSpointZ As Single
  48.  
  49. Global iObjectX(326, 1 To 100) As Integer   'Object X coordinate array, 326 types of objects with up to 100 points each
  50. Global iObjectY(326, 1 To 100) As Integer   'Object Y coordinate array, 326 types of objects with up to 100 points each
  51. Global iObjectZ(326, 1 To 100) As Integer   'Object Z coordinate array, 326 types of objects with up to 100 points each
  52. Global iNumPoints(326) As Integer           'Index array of number of points in object types
  53.  
  54.  
  55. Global iObjectType(160) As Integer          'Object type (1 = cube, 2 = point, etc.)
  56. Global iLocationX(160) As Integer           'Object center
  57. Global iLocationY(160) As Integer
  58. Global iLocationZ(160) As Integer
  59. Global iColor(160) As Integer               'Object iColor
  60. Global sfSize(160) As Single                'sfSize Factor
  61.  
  62. Global iNumObjects As Integer               'Number of objects in world space (up to 160 (memory limit))
  63.  
  64. Global iPx(100) As Integer                  'Integer mapped-to-window object point for PlaceObject
  65. Global iPy(100) As Integer
  66. Global iPz(100) As Integer
  67.  
  68. Global PxOld(200, 100)  As Integer          'Old point for PlaceObject erase
  69. Global PyOld(200, 100)  As Integer
  70. Global PzOld(200, 100)  As Integer
  71.  
  72. Global sfDSquared(160) As Single           'Square of object center distance from viewpoint, single floating
  73. Global iObjOrder(160) As Integer           'Object index order by distance from ViewPoint (farthest first)
  74.  
  75. Global iInView(160) As Integer             'Object is in view
  76. Global iInViewPrev(160) As Integer         'Object was in view
  77.  
  78. Global iSCNum As Integer                   'Spinning cube object number for Timer1 event
  79.  
  80.  
  81. 'This demo represents a collaboration by
  82.  
  83. '   Ivory Tower Software
  84.  
  85. '           and
  86.  
  87. '    Software Sculptors
  88.  
  89. 'We hope you like it, and we hope that you will consider licensing GEO.DLL for
  90. 'royalty-free use with your applications.
  91.  
  92.