home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Zone / VRZONE.ISO / mac / PC / MISC3D / EEDEMO / EEDEMO.DOC < prev    next >
Text File  |  1993-08-12  |  3KB  |  78 lines

  1. EEDEMO v0.1
  2.  
  3. Notes on first version:
  4.  
  5. Only one BOB file per world allowed.  Just include a line like this:
  6.  
  7. bobscript filename
  8.  
  9. filename is the name of the BOB program. It must have the extension ".bob",
  10. but do not specify the extension in the wld file.
  11.  
  12.  The "main" function is executed immediately after compilation. It
  13. really is just for initialization, since most BOB procedures will
  14. be called in response to an event.(such as a timer, or a mouseclick)
  15.  All variables have to be inside a function.  To make a variable Global,
  16. just initialize it in "main".
  17.  
  18.  
  19. To associate a function with an Object, you must first "name"
  20. the object in the wld.  Then call the ScheduleTask function in BOB.
  21. ScheduleTask takes 4 parameters:
  22.    a BOB object or 0
  23.    the name of an object from the WLD file
  24.    the name of a BOB function to call
  25.    how often to call this function(the period)
  26.  
  27. tsk = ScheduleTask(0,"ball", "ballfunc", 30); // gets called every 30
  28.                           // frames or so
  29. In this example, your BOB file should contain a function named
  30. "ballfunc", and your .WLD file should contain an Object named "ball".
  31. Note the first parameter - 0.  If you do not use a BOB class object
  32. be sure to pass a 0 for this param.
  33.  
  34.  If you want to delete a task, you must have saved the task handle
  35. returned by ScheduleTask.  Then use it in a call to DeleteTask:
  36.  
  37.     DeleteTask(tsk); 
  38.  
  39.  A task can Delete itself, and re-Schedule itself.
  40. This doesn't affect the object, just the task associated with it.
  41. Deleting the object is another story altogether...  one thats not
  42. yet implemented.
  43.  
  44.  
  45.  
  46. For a better, more Object-Oriented approach, see the example TASKCLS.BOB
  47.  
  48.  
  49.  
  50. So, what do you do in these BOB procs that are called by Tasks?  Right
  51. now, these are the only functions implemented:
  52.     
  53.  
  54.   Moveto(x,y,z);          //move to absolute position
  55.   Move(dx,dy,dz);         //move relative to current position
  56.   Rotate(dx,dy,dz);       //rotate relative to current rotation
  57.  
  58. these work on the "current" object only.  So this limits tasks to manipulating
  59. one object at a time.  I don't like this, and i'm going to change it soon...
  60.  
  61.   MoveCamera(dx,dy,dz);   //move camera position relative
  62.   TurnCamera(dx,dy,dz);   //turn camera relative to current view rotation
  63.   RefreshDisplay();       //Refreshes display. useful for repeated operations
  64.   EventLoop();            //also refreshes display. collects user input.
  65.   GetArea();              //returns name of area the Camera is currently in.
  66.   PopMsg(msg);            //pops a message up in a box
  67.   GetKey();               //returns next keypress
  68.  
  69.  
  70.  
  71.  I'm still working on better examples.  Different methods.  Truly 
  72. object-oriented Objects...  but there's only so much time in a day...
  73.  
  74. If you have any suggestions, complaints, or whatever, I'd be happy to hear 
  75. from you.
  76.    Eric Elliott
  77.    72427,716
  78.