home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 55
/
Amiga_Dream_55.iso
/
RISCOS
/
MAGAZINE
/
NEWS
/
3DENGI.ZIP
/
3DEngine
/
!ReadMe
next >
Wrap
Text File
|
1998-08-13
|
7KB
|
178 lines
PlotLib/ModelLib
Release 0.03 ----------------
Wassit all about then?
~~~~~~~~~~~~~~~~~~~~~~
For a long time, I have wanted to see a freely available 3D engine for
RISC OS, to allow people (myself included) to have something to use as
a basis for 3D work.
Interested developers, prepared to sign the stringent license form,
have been able to sign up to get a copy of the TAG3 library and specs,
but this is a process with enough hurdles to overcome (getting the
form, agreeing to the terms, getting accepted by TBA, sorting out the
release of anything you produces) that it acts as a discouragement for
many.
Then, Martin Piper, the author of the TAG3 engine, released a simple
demonstration engine on to the net to encourage people to play. When
prompted he gave the following statement about its copyright status:
> OK, I declare this code as freely available to anyone who wants to
> use it. There is no fee for using this code, or parts or sections,
> in your own programs. The copyright for this specific released
> source code found on TBA's website is entirely in the public domain
> and the original author, ie me!, decalares he waives all copyright
> for the aforementioned release of source code.
>
>
> Important! All other released work from TBA is not in the public
> domain and copyright still rests with the originating
> author(s)/company and the above statement does not effect in anyway
> existing license conditions for previous or future software
> releases.
>
> I only ask that if anyone improves the code and they think it would
> be useful for other people to see the changes then they should
> attempt to keep some sort of log of changes. Also email the new code
> back to myself so I can keep a database of changes and maintain it
> in some sort of tidy state. ;-)
This proves that he is a nice chap :-)
I have taken the code and played with it for a bit, with the results
that:
1) The central cores of the polygon plotting loops are in ARM code.
2) The ploygon routines now (optionally) clip to the edge of the
screen.
3) Plotters have been implemented for 8 and 16 bit modes as well as
the original 24 bit modes.
4) WIN32 support has been removed (I wasn't prepared to invest the
time to keep it up to date).
5) The original (bugged) Gouraud shading code has been fixed,
optimised and ARMcoded. It now uses the same intensity of lighting
for R,G and B; so no coloured lights - sorry. If there is a demand I
can add this back again, but that costs lots of registers, and there
are none spare so it would slow it all down.
6) Many more plotters have been added: You can now choose between
Untextured/Textured/Textures-with-transparent-bits plotters with or
without Gouraud shading and alpha levels.
7) By changing the #define MAX_VERTICES_ON_FACE in PlotLib:PlotLib.h
you can now compile in support for quad (or more) plotters rather than
just triangles. In theory any convex polygons can be plotted. ModelLib
is limited in its support of this - it only copes with 3 or 4 vertexed
polygons.
8) The code has been structured into several different sections;
first, a central plotting library (imaginatively named PlotLib) that
contains the plotting routines- People just needing a polygon
plotter can use this. Second, there is a library (even more
imaginatively called ModelLib) that handles models- people wanting to
load and display 3D models can use this. Finally there is the
rest of Martins' example application, now restructured to show the use
of these libraries.
Building it
~~~~~~~~~~~
Unpack it.
Run !ModelLib to set the paths and open the filer window. Run AMU on
the Makefile, don't use !Make or you deserve all you get, and much
worse too.
Run !PlotLib to set the paths and open the filer window. Run AMU on
the Makefile.
Run AMU on the top level makefile.
The code has been tested under Norcroft Cv5 and Objasm only, but it
will probably work under the free equivalents. I don't have the time
to test it under different schemes - sorry.
If you have Dr Smiths C Development Toolkit then a HierProf build
of the example application can be generated to show where its spending
its time. A MemCheck build is now also available so you can see how
marvellously bug free it all is. Oh yes.
Copyright
~~~~~~~~~
Given that Martin has given up his rights to the code, it would be
poor form for me to do anything else, so the distribution rights for
this software are as follows:
1) The code/documentation/libraries etc may be copied freely and no
charge (other than reasonable media/copying costs) may be charged for
it.
2) A copy of this file must be kept with the code. If you change the
code, then by all means add your own top level ReadMe, but do either
include this original file or at least include a pointer to where
people can get it.
3) If you use these libraries in a program of your own, no royalty or
license is payable to anyone.
4) No warranty is given. If the code works, count yourself lucky. If
it doesn't its your fault.
5) This is NOT a TBA software or a Warm Silence Software Ltd product.
While I will certainly try to help people as much as my
time/commitments/inclination allows, no support is guaranteed.
The following points can't be legislated, but it would nice if:
1) If you make changes to the engine that might be useful to other
people, please share them; sending them back to me is a good idea.
2) If you write anything interesting using these libraries (God
forbid a game!) then offering us a free copy might be considered
polite!
3) Most importantly, let us know what you think of it all...
Happy Hacking...
Robin Watts <Robin.Watts@wss.co.uk>
---------------------------------------------------------------------
Thanks to:
* Martin Piper for releasing the code originally.
* Matt Bloch for testing it out, being enthusiastic and generally
being a good person to bounce ideas off.
---------------------------------------------------------------------
Release Log:
0.01: Martins release
0.02: First release as PlotLib/ModelLib
0.03: Gouraud shading of textured polygons reintroduced
0.04: Gouraud shading of flat polygons introduced. This should be
a complete set. Phew.
Fixed division-by-zero bug in the plotters.
0.05: Fixed problems with lines getting negative.
Removed need for rowbytes.
0.06: Added Transparent texture support.
Fixed R<->G bug with Flat Gouraud plotting in 8 bit modes.
Fixed #defines causing unclipped versions to be compiled.
Added compile time support for changing the number of vertices
in a face; so quad plotters are now available.
0.06b Tiny tweaks, and reincluded the precompiled demo app - Oops!