home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / turbocad / v8trial / TurboCADv8ProfessionalNoReg.exe / Data.Cab / F41825_modRender.bas < prev    next >
Encoding:
BASIC Source File  |  2001-10-16  |  2.4 KB  |  84 lines

  1. Attribute VB_Name = "modRender"
  2. '******************************************************************'
  3. '*                                                                *'
  4. '*                      TurboCAD for Windows                      *'
  5. '*                   Copyright (c) 1993 - 2001                    *'
  6. '*             International Microcomputer Software, Inc.         *'
  7. '*                            (IMSI)                              *'
  8. '*                      All rights reserved.                      *'
  9. '*                                                                *'
  10. '******************************************************************'
  11.  
  12. Option Explicit
  13.  
  14. Global App As Application
  15. Global Dr As Drawing
  16. Global V As View
  17. Global Rs As Renders
  18. Global R As Render
  19. Global Rv As RenderView
  20. Global CurRenderMode As ImsiRenderMode
  21.  
  22. Sub RenderManager()
  23.     frmRender.Show vbModal
  24.     Call CleanUp
  25. End Sub
  26.  
  27. Private Sub CleanUp()
  28.     Set Rv = Nothing
  29.     Set R = Nothing
  30.     Set Rs = Nothing
  31.     Set V = Nothing
  32.     Set Dr = Nothing
  33.     Set App = Nothing
  34. End Sub
  35.  
  36. Public Sub RenderEx1()
  37.     Dim i%, j%, rcount%
  38.     Dim rnd As Render
  39.     Dim rmodes As Variant
  40.     With Application.Renders
  41.         rcount = .count
  42.         For i = 0 To rcount - 1
  43.             Set rnd = .Item(i)
  44.             Debug.Print "Render: " & rnd.Name
  45.             rmodes = rnd.modes
  46.             If VarType(rmodes) <> vbEmpty Then
  47.                 For j = 0 To UBound(rmodes)
  48.                     Debug.Print " Mode: " & rmodes(j)
  49.                 Next
  50.             Else
  51.                 Debug.Print " No modes"
  52.             End If
  53.             rmodes = rnd.RadExtendedModes
  54.             If VarType(rmodes) <> vbEmpty Then
  55.                 For j = 0 To UBound(rmodes)
  56.                     Debug.Print " RadExtendedMode: " & rmodes(j)
  57.                 Next
  58.             Else
  59.                 Debug.Print " No radiosity modes"
  60.             End If
  61.         Next
  62.     End With
  63. End Sub
  64.  
  65. Public Sub RenderEx2()
  66.     Dim rnd As Render
  67.     Dim vw As View
  68.     Dim opic As IPicture
  69.     
  70.     'Set up the rendering type
  71.     Set rnd = Application.Renders("OpenGL")
  72.     rnd.DefaultMode = imsiRenderModeGouraud
  73.     
  74.     'Set up the camera
  75.     Set vw = ActiveDrawing.ActiveView
  76.     vw.Camera.Perspective = True
  77.     
  78.     'Run the rendering process
  79.     Set opic = rnd.Run(vw)
  80.     If Not opic Is Nothing Then
  81.         SavePicture opic, "D:\Test.bmp"
  82.     End If
  83. End Sub
  84.