VERSION 5.00
Object = "{34F681D0-3640-11CF-9294-00AA00B8A733}#1.0#0"; "danim.dll"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "DX Eperiments"
   ClientHeight    =   5535
   ClientLeft      =   3960
   ClientTop       =   975
   ClientWidth     =   6975
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5535
   ScaleWidth      =   6975
   Begin VB.Frame Frame1 
      Caption         =   "DirectX Animation Control"
      Height          =   4575
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6735
      Begin DirectAnimationCtl.DAViewerControlWindowed DA 
         Height          =   4215
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   6495
         OpaqueForHitDetect=   -1  'True
         UpdateInterval  =   0.033
      End
   End
   Begin ComctlLib.ImageList ImageList 
      Left            =   6240
      Top             =   4920
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   100
      ImageHeight     =   100
      MaskColor       =   12632256
      _Version        =   327682
      BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
         NumListImages   =   3
         BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":2B62
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":92D4
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Base As String
Public pi As Double

Public Sub Form_Load()

Set m = DA.MeterLibrary

Base = App.Path + "\"

Set speed = m.LocalTime
dimension = 0.03

Set half = m.DANumber(0.5)
Set Hue = m.Abs(m.Sin(m.Div(speed, m.DANumber(10))))
Set animcolour = m.ColorHslAnim(Hue, half, half)

Set backDrop = m.SolidColorImage(m.Gray)

Set numbers = ImportImage(Base + "box.bmp")
Set numbers = numbers.Transform(Scale2(5, 5)).MapToUnitSquare

Set Camera = m.PerspectiveCamera(2 * dimension, 1.1 * dimension)

Set Light = m.PointLight.Transform(m.Translate3(dimension / 2, dimension / 4, 1.5 * dimension))

'Set BallOfFusingAtoms = m.AmbientLight.LightColor(animcolour).LightRange(2)

Set cubeGeo = m.ImportGeometry(Base + "cuboid.x") '.DiffuseColor(animcolour)"

'Set cubeGeo = cubeGeo.Transform(m.Translate3(0, 0, 0))

Set cubeGeo = cubeGeo.Transform(m.Scale3Uniform(dimension / 11))

Set Two = m.Rotate3RateDegrees(m.XVector3, 20)

Set three = m.Rotate3RateDegrees(m.YVector3, 30)

Set Mover = m.Compose3(Two, three)
           
Set cubeGeo = cubeGeo.Transform(Mover)

Set cubeGeo = cubeGeo.Texture(numbers)

'Set cubeGeo = m.UnionGeometry(cubeGeo, BallOfFusingAtoms)

Set cubeGeo = m.UnionGeometry(cubeGeo, Light)

Set FinalImg = cubeGeo.Render(Camera)

Set FinalImg = Overlay(FinalImg, backDrop)

DA.Image = FinalImg
     
DA.Start

End Sub
