[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 8 bit 3-d game
brendan.robert@gmail.com wrote:
I ran into Wayout as well -- even contacted one of the folks that used
to work at Sirius Software (the publisher of Wayout.) Aparently it was
written by a single person who guarded the source quite greedily.
I was looking at some example raycaster source (see these examples:
http://www.student.kuleuven.ac.be/~m0216922/CG/raycasting.html
http://developer.mozilla.org/en/docs/A_Basic_RayCaster
) and decided that if I had a fast sin/cos table-driven function then I
could implement a basic raycaster at least using lo-res. For some
reason, the stinking thing has a bug in it which causes things to look
really odd, but it kinda works for now.
My example is online http://www.brendandy.com/apple/raycast with Acme
source files if you want to muck about with the source and/or fix it.
;-) I've tried to use macros in the source to minimize on expensive
JSR calls. I can't say I'm perfect at assembler (ok, so I more or less
suck compared to someone that does embedded programming all day) but
hopefully this at least starts an interesting conversation that may
lead to something interesting and/or productive.
(oh yeah, use I J K and L to move around)
Actually I have some old 3D perspective transformation formulas I
devised back around '81. I assume it is common knowledge but...
They are vector based and don't use any trigonometric functions but
needs floating point not too bad to calculate but in basic it takes time.
I should actually write more about how it works but...
http://home.online.no/~kr-lund/3D.htm
in this page there is a link to
http://home.online.no/~kr-lund/PERS.BAS
2000-2020 is the calculations done for the viewer it assumes that the
viewer is in point A1,A2,A3 and is looking at origo (0,0,0) while
E1,E2,E3 is (0,-1,0) down for the viewer.
3000 is the calculation done for each point defined by X,Y,Z
the output is P,Q which is the point on the screen after some scaling
1000 does a fairly simple hidden line based on getting the nearest lines
to draw first (as set up by the IF's in lines 115-125)
It is the sombrero-like math function that you see in my page but with
20 by 20 "squares" the output here is 202 by 162 and was for a
tectronics monitor which would do straight line (not jagged lines made
up by pixels)
Maybe I should make an applesoft version, that would be fun.
Note: there are some div by zero situations...
Knut