home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / programming / amos / a3dmodelsim / readme < prev    next >
Text File  |  1998-05-09  |  12KB  |  256 lines

  1.             A  3D simulation of radio control model jet.
  2.                            (using amos 3d)
  3.  
  4.   Author: David Lawrence.        e-mail..   muddle@voyager.co.nz
  5.  
  6. Best with fast  A1200.  ( There is a crude time limit to prevent very fast
  7. machines from producing  uncontrollable flight.  Remove at will)
  8.                     ...........................
  9.  
  10.                            Notes on A500 use.
  11.  
  12.  A500 with 1mb, will ONLY WORK IF the user has Amos Voodoo 3d xtn. to run the
  13. source code. Ideally control and speed  variables should  be changed to allow
  14. for slower frame  rate.  Then the sound frequency variable would have to be
  15. changed from it's direct relation to the SPEED variable.  ( you have to poke
  16. hardware to alter frequency while a sample loop is 'playing' in amos.
  17.  See code)               
  18.  
  19.  An amos autoexec floppy disc version of the program will also run on
  20.  an A500 with 1 mb.   Which would be nice for those without amos or the
  21. 3d extension,  but I don't think this can be archived to aminet in a
  22.  way that will work..??     And would that be legal?
  23.         Any advice .. anyone?
  24.    also.. I'm  not too keen on making and sending floppy disks all round
  25. the world from way down here (new zealand)... Sorry.
  26.               ........................................
  27.  
  28.  
  29. Will run on PAL or NSTC, the last by accident since the model sits on the
  30. ground in sight in nstc with some screen out of view. Ideally the user could
  31. redo the prog. to smaller screen.
  32.  
  33.  
  34. The archive includes:-
  35. - a compiled workbench version for non-amos users
  36. - amos source code
  37. - the necessary sample bank, screens, 3d objects
  38.  
  39. -   ( note- the 3d library is part of the compiled version ..it's not
  40.          useable as an amos extension.
  41.       Also note, the 3d extension referred to herein is
  42.        the voodoo 3d extn,  not 'stars'  or  other)
  43.  
  44.  
  45. The program expects all the above archive to be extracted into
  46.  the same directory.(any name)
  47.  
  48. Please advise author if things don't appear to be working,  as I can't
  49. be quite sure if the prog. is  relying on something on my hard drive
  50.  which may not be on others. I think it's just getting the normal math lib.
  51.  
  52.                           -------------
  53.  
  54.  This archive is put here so that other amos  programmers can freely
  55. modify, improve on,  (or just have a good laugh at )  one persons attempt
  56. to overcome rotation limits in amos 3d.  It should be possible to make
  57. some sort of more interesting game out of the basic program. e.g. Missiles,
  58.  3d targets, or  'round the  pylons' racing against a  computer opponent.
  59.  
  60. Or for those who can happily use the object modeller, one could improve the
  61. plane or convert it  ( and the sound bank) to various curious aircraft.
  62. Or to a flapping dragon or whatever.
  63. The whole scene could be changed from a vaguely N.Z. rural flavour to
  64. an airport, or fururistic .....
  65.  
  66. The background could just be a 'rainbow'  horizon to enable greater speed
  67. for more 3d interaction.   The rainbow has to move up and down with the
  68. view elevation.  It works, I  tried it somewhere on the old A500 for speed.
  69.  
  70. It might be best to just poke a custom copper list on the fly to create a
  71. split or change in a colour register(s) at a movable raster line.
  72.         ( A command to do this is an almost incomprehensible
  73. ommission from standard Amos, of a basic, simple and very  useful command..
  74. The ' rainbow' commands are  usable,  but complex and limited.  Good grief.
  75. you can only change one colour register for a start.. a sad effort I think )
  76.  
  77.  
  78.  
  79. Amos programmers, note that the full rotation in 3d requires a background
  80. much larger than a standard screen can be.  Hence two linked screens
  81. are used.. anyone who knows how to simplify this, or create a larger screen
  82. is hereby urged to tell me....
  83. If A3d  didn't use a masking method to draw one could use the machine code
  84. copy command,  which would be faster and could handle the size... but...
  85.             . ......................
  86.  
  87. If anyone wants to obtain amos 3d I have no suggestions that are legal.
  88. You could try annoying Europress?. They are unlikely to respond, and it
  89.  sounds like maybe someone else has the rights to the 3d code and object
  90. modeller.   (But you could still annoy them any way..... )
  91. It was on a mag. disk some years ago, you may find a friend who has a copy.
  92. They must be around somewhere.
  93.  
  94.          As an alternative :-
  95. It should be possible to use AMCAF vector rotations for Amos pro to make a
  96. similar program.   I think that's what I would do now if starting again.
  97. And you could make use of full colours etc. And make a better object modeller.
  98. .....at least as long as you kept it all simple.
  99. But it would be a LOT OF WORK,and probably need some assembler routines
  100. if you wanted to handle  large numbers of co-ords. Or to check for surfaces
  101. and lines both in front of and  behind the viewpoint.
  102. This would not matter with a simple  'object way out there'  model sim.
  103.  
  104.                  ........ ....................
  105.  
  106.  
  107.                        ABOUT AMOS 3D
  108.  
  109. This writer was depressed  to discover that amos3d is not ideal.
  110. It is quite fast for a blitter system, and I find the commands fit my
  111.  approach .
  112.       BUT...
  113. There are very restricted colour choices, it can write over screen
  114. edges and  crash from (seemingly)  memory problems, and since it uses
  115. masking to draw objects ( probably to gain speed), it is incompatible
  116. with other drawing operations.   Also the screen conversion doesn't handle
  117. off screen positions.
  118.  And the object modeller though it has some good ideas, drives me completely
  119. up the wall !!!!..
  120. Hence the minimal objects in  programs I make).
  121.  
  122.     But above all the rotation angles are limited, and do not match the
  123. manual which implies the ability to rotate objects and viewpoint about
  124. their own axes with simple commands..
  125.  In fact the z rotation axis  of objects  and viewpoint remain
  126. permanently aligned with the z axis of the co-ord world.
  127.  
  128.    It did not have to be that way as the amcaf vector rotations for example
  129. seem to rotate relative to their current alignment.. using matrix maths.
  130.   It may be possible to use  complex  sin* cos formula to make amos3d
  131. work that way,  but all my attempts failed at the angle extremes..
  132. (My '3dtests' dir is full of things like;- 3dcalc, novertcalc, nearlythere,
  133.  finally?, .... very depressing.)
  134.                          -------------------
  135.  
  136.   The partial solution used here and in my other programs, is to change the
  137.  normal point of view and hence the apparent way the objects rotate.
  138.     It's as simple as setting the initial view angle at rt. angles to normal
  139. on the A angle axis .
  140. And then being sure you put your objects in the new world ground plane
  141. of X, Y co-ords   (instead of x,z as normal) with their A angles also moved
  142.  one rt angle...
  143.  
  144.       It may be clearest to visualize as follows;-
  145. Imagine you have stuck your head into the co-ord world through your monitor
  146. and are looking straight down.   Now twist  your head to look to your right.
  147. The effect from your point of view, is that the world z axis now seems
  148. vertical ( i.e. off the  top of your head.. Ha! joke)  while the x goes away
  149. into the distance ahead and the y goes from side to side.
  150.  
  151.     Your ground objects are put on the new ground plane,( which from the
  152.  old point of view was the plane parallel with the screen )
  153.      For convenience I chose start angles which gave positive z upwards,
  154. positive x away into distance, y positive  to the right,   but the x,y
  155. (set by initial  angles ) could be any chosen direction.
  156.                            
  157.    The main thing is that while the z axis rotations still remain aligned
  158. with the 'world' z axis, this is no longer the longitudinal Z  axis of the
  159. objects and viewpoint... from your new  point of view.
  160.  
  161.                               -------------- 
  162.    It is possible now to point an object  in any world direction on  the
  163. z axis (angle c), elevate  with angle B, and roll any angle with A.
  164.  
  165. I'll  call this;-   mode3
  166.  
  167.  The limits of this are:-
  168.          1.   The object can not use td forward, since the rolling angle A
  169. is not the axis used by td forward.
  170.  Instead you have to use a sin/cos formula to move.( see source code.)
  171.          2. since the viewpoint cannot align along the A angle/ axis
  172. the VIEWPOINT  cannot be flown about as in a proper flight sim.
  173.          3. A seperate 'yaw' response is too difficult to arrange.
  174.  
  175.     None the less it is possible to fly  an object around properly if
  176. it is saved from the object modeller at right angles (pointed left) to the
  177. normal angle.  (if you used td forward it would go sideways)
  178.  
  179.    This is the mode used by the jet model simulator. It was very tricky
  180. to understand how to adjust the rotation angles as the object pointed
  181. upwards in the world..  because the roll angle (A) gradually becomes a change
  182. in the direction in the world. (angle C )
  183.   It's in the source code,  but if anyone needs more I could supply extra
  184. notes... once I've  re- worked it out myself!  (Don't think this was worked
  185. out by a blinding quick brain.  It mostly happened by hours of experiment
  186. over many months, and step by step advance.   NOW it seems simple)
  187.  
  188.                   ..............................
  189.  
  190.       It is possible though, to use td foward for objects and viewpoint
  191. with the world in this orientation,  if you use angle  B for rolling and A
  192. for elevation.     Angle C  still sets world direction.
  193.    Call this mode 2
  194.  
  195.  
  196. The limits of this mode are:-
  197.          1. the B rolling axis  is always parallel to the 'ground' plane.
  198.            (Though you can point it in any direction on that plane.)
  199. Therefore when you elevate with angle A  and try to roll with B, the object
  200. or view 'skews' or 'barrel rolls' it's nose around in an arc.
  201. The greater the elevation the greater the skew.
  202.   It is possible to use a simple sin (or cos?, I forget) to reverse the
  203. skew in the inverted part of the roll.
  204.              This is just enough to make it useable as a limited flight
  205. sim with a proper travelling viewpoint but held within limits up and down.
  206.  
  207.  See example. ( to be uploaded to aminet if this gets there!).. A3Dsimplesim.
  208.  
  209.  Or to use to fly independent targets or enemies  which bank and
  210. fly with some realism.
  211.  
  212.            See example .to be uploaded ..   A3Ddefence
  213.  
  214.  
  215. There are other possibilities with both  modes, and there are probably
  216. proper games that could be written along these lines- especially for fast
  217. machines.
  218. ..  but the writer is done for now.  Too much trial and error.
  219.                                      
  220. I should mention that the td 'bearing' command does not work in the
  221. new world order.  It works only  for direction in the x,z plane  and not
  222. the new x,y plane.  I have a method which should enable it's use, but since I
  223. never needed the command it is untried. ( You have to substitute the co-ord
  224. positions as if they were in the old mode,  use td bearing command,  then
  225.  put results back into the new world..  I think.   e-mail if desperate)
  226.  
  227. Td face command is also affected- it puts  the object horizontal on the OLD
  228. ground plane i.e. stands it on end in the new world,  and then spins it on
  229. that plane to face the viewpoint or other ob.    It would be rather
  230. complicated to try and use that.
  231.  
  232.  
  233.                      ------------------------
  234.  
  235. Feel free to use anything here for your own programs. Or to upgrade the
  236. whole thing,  I have spent too much time worrying to optimise !
  237.  There may well be some other way to improve A3d ..  go to it.
  238.  
  239.  I really believe  that a complete new, and faster 3d system- using fast ram
  240.  (bit planes or chunky) and cpu drawing techniques is what is needed for amos.
  241.  It may be possible to do quite a lot with the amcaf vector rotation
  242.  commands.    But then, one needs a polygon command which doesn't crash
  243. the machine when off screen right somewhere!
  244.  
  245. I  hope someone might  come up with something before the Amiga expiry date
  246.  passes.
  247.         Or my expiry date!!
  248.  
  249. Also... sorry to have not got this stuff out much earlier when amos and 3d
  250. were  still around,  and this might have been a bit more use.
  251.  But I felt isolated in a bit of a personal black hole,  and the internet
  252. was not on my event horizon at all.
  253.  
  254.  
  255.                   Good luck all.    David L.
  256.