BBS: Inland Empire Archive
Date: 05-05-92 (09:37)             Number: 156
From: RICH GELDREICH               Refer#: NONE
  To: DAVID BLISS                   Recvd: NO  
Subj: Re:3-d                         Conf: (2) Quik_Bas
> Since you're our resident 3d expert, do you suppose you could help me
> out with a problem??  I am writing a game that plays on a cubical
> (8x8x8) board.  I have it all set up in an array.  Do you have any
> idea how i could put this into a cube (perspectivical) and rotate it
> on the screen???
> dave

    Well, if you don't want to use any assembly, then I highly recommend
that you use just lines to represent the cubes(and use a screen mode
which allows page flipping). This would allow some really quick updating
of the screen(although I've got some good, fast polyfill algorithms they
don't even touch simple lines).

    What you ask really isn't that hard(although my explanation might
make it hard! I'll try).

    For starters, I'm going to post my 3-D wireframe program again with
some documentation on it, to help you(and a couple other people that
asked). (It's neat to note that over 1/2 of the wireframe program I
posted really has nothing to do with 3-D graphics! The setup routines
just optimize the list for maximum speed).

    Well, to make this 8x8x8 3-D grid, you must store each X,Y, & Z
coordinate in an array along with another array which tells which 2
points to connect together to form a line. You'd rotate the points, and
then "throw" them into perspective.

    Next, you would draw all of the lines that are visible on the

    The hard part is actually finding all of those damn points and
lines! It took my hours to draw that simple, mediocre shuttle craft in
my 3-D demo(and, once I finished making all of those 3-D points, I found
out that I did it wrong! That is why the wireframe program you received
had to optimize the list...)

    I'll tell you what: I'll get an 8x8x8 cube rotating for you, and
I'll post it. You can then look at it and copy/change as much as you
want. (to make things easy, I'll assume that your never going to go
inside of the 3-D grid...)

    Rich Geldreich

--- RBBSMAIL 17.2A
 * Origin: Computer Co-Op RBBS HST, 609-784-9404 Voorhees
NJ (RBBS-PC 1:266/29)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET