home *** CD-ROM | disk | FTP | other *** search
/ Microsoft DirectX SDK 7.0 / Dx7.bin / DXF / samples / multimedia / vbsamples / d3drm / src / quickstart / quickstart.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-03  |  2.6 KB  |  78 lines

  1. VERSION 5.00
  2. Object = "{08216199-47EA-11D3-9479-00AA006C473C}#2.0#0"; "RMCONTROL.OCX"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Direct3DRM Quick Start"
  6.    ClientHeight    =   3495
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4860
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3495
  14.    ScaleWidth      =   4860
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.Timer Timer1 
  17.       Left            =   3000
  18.       Top             =   2400
  19.    End
  20.    Begin RMControl7.RMCanvas RMCanvas1 
  21.       Height          =   3510
  22.       Left            =   0
  23.       TabIndex        =   0
  24.       Top             =   0
  25.       Width           =   4875
  26.       _ExtentX        =   8599
  27.       _ExtentY        =   6191
  28.    End
  29. Attribute VB_Name = "Form1"
  30. Attribute VB_GlobalNameSpace = False
  31. Attribute VB_Creatable = False
  32. Attribute VB_PredeclaredId = True
  33. Attribute VB_Exposed = False
  34. Option Explicit
  35. Private Sub Form_Load()
  36.           
  37.           'All objects from the DX library must be
  38.           'strongly typed
  39.           Dim frame As Direct3DRMFrame3
  40.           Dim mesh As Direct3DRMMeshBuilder3
  41.           
  42.           With RMCanvas1
  43.             'Initialize our RMcontrol
  44.             .StartWindowed
  45.             
  46.             'Create a Frame to contain our objects
  47.             'by default its at (0,0,0)
  48.             'Frames are containers for geometry that
  49.             'help position and orient the geometry in a scene
  50.             'we also parent the frame to the scene
  51.             Set frame = .D3DRM.CreateFrame(.SceneFrame)
  52.             
  53.             'Create a MeshBuilder and load an x file into it
  54.             'MeshBuilders hold the actual geometry.
  55.             'please note the meshbuilders can not load
  56.             'files with frame information in them
  57.             'for such files use frame.load
  58.             
  59.             Set mesh = .D3DRM.CreateMeshBuilder()
  60.             mesh.LoadFromFile App.Path + "\egg.x", 0, D3DRMLOAD_FROMFILE, Nothing, Nothing
  61.             
  62.             'here we add the MeshBuilder to the frame
  63.             frame.AddVisual mesh
  64.             
  65.             'we set the frame spinning about the (1,1,1) axis
  66.             'at .04 radians per second
  67.             frame.SetRotation Nothing, 1, 1, 1, 0.04
  68.           End With
  69.           
  70.           'We start a timer
  71.           Timer1.Interval = 1
  72.         End Sub
  73. Private Sub Timer1_Timer()
  74.           'update our simulation
  75.           RMCanvas1.Update
  76. End Sub
  77.         
  78.