home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modRender"
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- Option Explicit
-
- Global App As Application
- Global Dr As Drawing
- Global V As View
- Global Rs As Renders
- Global R As Render
- Global Rv As RenderView
- Global CurRenderMode As ImsiRenderMode
-
- Sub RenderManager()
- frmRender.Show vbModal
- Call CleanUp
- End Sub
-
- Private Sub CleanUp()
- Set Rv = Nothing
- Set R = Nothing
- Set Rs = Nothing
- Set V = Nothing
- Set Dr = Nothing
- Set App = Nothing
- End Sub
-
- Public Sub RenderEx1()
- Dim i%, j%, rcount%
- Dim rnd As Render
- Dim rmodes As Variant
- With Application.Renders
- rcount = .count
- For i = 0 To rcount - 1
- Set rnd = .Item(i)
- Debug.Print "Render: " & rnd.Name
- rmodes = rnd.modes
- If VarType(rmodes) <> vbEmpty Then
- For j = 0 To UBound(rmodes)
- Debug.Print " Mode: " & rmodes(j)
- Next
- Else
- Debug.Print " No modes"
- End If
- rmodes = rnd.RadExtendedModes
- If VarType(rmodes) <> vbEmpty Then
- For j = 0 To UBound(rmodes)
- Debug.Print " RadExtendedMode: " & rmodes(j)
- Next
- Else
- Debug.Print " No radiosity modes"
- End If
- Next
- End With
- End Sub
-
- Public Sub RenderEx2()
- Dim rnd As Render
- Dim vw As View
- Dim opic As IPicture
-
- 'Set up the rendering type
- Set rnd = Application.Renders("OpenGL")
- rnd.DefaultMode = imsiRenderModeGouraud
-
- 'Set up the camera
- Set vw = ActiveDrawing.ActiveView
- vw.Camera.Perspective = True
-
- 'Run the rendering process
- Set opic = rnd.Run(vw)
- If Not opic Is Nothing Then
- SavePicture opic, "D:\Test.bmp"
- End If
- End Sub
-