realbasic-games
[Top] [All Lists]

Re: fast, smooth updates

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: fast, smooth updates
From: Thomas Cunningham <mauitom at maui dot net>
Date: Tue, 22 Jul 2003 16:21:34 -1000
> At 2:25 AM -0400 7/21/03, John Balestrieri wrote:
>> Short & sweet, here it is a simple framework for benching Rb3D
>> animation frame controllers:

FWIW, I added this to the open event of RB3D Space. The model is from
Offword by Jeff Quan <jquan at mindspring dot com>.

  Dim f As FolderItem
  Dim modelCode As String
  Dim obj As Object3D
  Dim i As Integer
  f = GetFolderItem("policeviper.3DMF")
  If f <> Nil and f.Exists then
    // get the 3DMF code for the model
    modelCode = f.OpenAsTextFile.ReadAll
    
    // create an object
    
    For i = 1 to 10
      obj = New Object3D
      obj.Position.X = i*rnd*20
      obj.Position.y = i*rnd*20
      obj.Position.z = i*rnd*20
      // give the object a shape specified by the 3DMF
      obj.AddShapeFromString modelCode
      
      // add the object to this Rb3DSpace
      Rb3DSpace1.objects.Append obj
    Next
    // catch any error
  else
    msgBox "policeviper.3DMF NOT loaded"
    
  end if
  
  me.Camera.Position.z = 500
  me.DebugCube = TRUE

I also added a slowestTime and fastestTime property just to get a feel for
the worst/best scenarios. The project could use a statistics print out of
some sort (median elapsed time, etc.). The overall worst and best times are
about the same in my brief tests, for all three methods, the frequencies of
these do vary a lot.

Funny how it speeds up as you first move the mouse.

Thomas C.


---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
.


<Prev in Thread] Current Thread [Next in Thread>