## Re: [stella] Real 3D Space Calculations

 Subject: Re: [stella] Real 3D Space Calculations From: "Thomas Jentzsch" Date: Fri, 24 Aug 2001 13:26:36 +0200
```Manuel wrote:
> now I'd just like to know how *real* 3D would work.

Real 3D inside a 2600, that sounds real hard to me.

> Would I put the (0/0/0) Spot in the absolute center
> (i.e. the coordinates would range from -127 to +128)
> or in one of the corners (As said above with linear
> coordinates from 0 - 255)?

I'd go for -127 to +128, could result in easier visibilty calculations, but I'm not sure.
But you'd need a good understanding of the overflow-flag :)

> Would I put my own ship at (0/0/0) or would it float
> around as an atom as well?

Depends, I would say. If the ship is the center of the world, all it's movements had to be added to all other objects. But you'd save 3 bytes of RAM for the ship coordinates.

> Can anybody give me some math theory in what'd be the
> easiest way to calculate which enemies are in sight
> and how far they are (based on the above descissions)

There are various sources, where this has been discussed already (i.E. c't). Go into the web, the chances are better than just asking the list. Games like Elite did this on a 6510, so it's possible. The extra limiting factors of the 6507 are RAM and cpu time, but that should only limit the number of objects and/or framerate.

> (I'd need three extra bytes here, for the
>  screen x-y coordinates and the size as well I assume?
>  That'd make 8 bytes per enemie in eye-sight and 5 for any
>  enemie behind me, right? Phew...)

Don't forget the direction that your ship is heading to. You will definitely need some triangular 'functions' (= lots of tables).

And not every object that is in front of you is visible, in real 3D there is something like a visibility cone(?).

If you won't have 256 different shapes for each distance, some distance and visiblity calculations could be less accurate than the size of your world. That should reduce complexity somehow.

> To encourage you more I state here:
>
> "It can't be done!"

Never say never :)  No, I won't! - Not now... :)

Have fun!
Thomas
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |

______________________________________________________________________________
Ferienklick.de - Urlaub ist schoen!
Hier geht's zum Traumstrand: http://ferienklick.de/?PP=2-5-100-105-13

-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

```